postfix+dovecot+mysql+postfixadmin 验证问题
遇到的问题是这样的,环境是Centos 7 X86_64,php 5.3.29编译安装的,apache 2.4.12编译安装的,mysql 5.6.21编译安装的,postfix系统默认安装,使用postfixadmin创建的邮件,可以telnet 25端口没有问题,telnet 110端口的时候提示-ERR Authentication failed.查看mail.log看到如下的错误。May 20 21:25:37 mail dovecot: auth-worker(6717): Error: mysql(localhost): Connect failed to database (postfix): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) - waiting for 1 seconds before retry
May 20 21:25:37 mail dovecot: auth-worker(6717): Error: mysql(localhost): Connect failed to database (postfix): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) - waiting for 1 seconds before retry
May 20 21:25:38 mail dovecot: auth-worker(6717): Error: mysql(localhost): Connect failed to database (postfix): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) - waiting for 5 seconds before retry
May 20 21:25:38 mail dovecot: auth-worker(6717): Error: mysql(localhost): Connect failed to database (postfix): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) - waiting for 5 seconds before retry
May 20 21:25:43 mail dovecot: auth-worker(6717): Error: mysql(localhost): Connect failed to database (postfix): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) - waiting for 25 seconds before retry
May 20 21:25:43 mail dovecot: auth-worker(6717): Error: mysql(localhost): Connect failed to database (postfix): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) - waiting for 25 seconds before retry
May 20 21:26:08 mail dovecot: auth-worker(6717): Error: mysql(localhost): Connect failed to database (postfix): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) - waiting for 125 seconds before retry
May 20 21:26:08 mail dovecot: auth-worker(6717): Error: mysql(localhost): Connect failed to database (postfix): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) - waiting for 125 seconds before retry
May 20 21:26:37 mail dovecot: auth-worker(6717): Error: mysql: Query timed out (no free connections for 60 secs): SELECT CONCAT('/var/vmail/', maildir) AS home, 2000 AS uid, 2000 AS gid, CONCAT('*:bytes=', quota) as quota_rule FROM mailbox WHERE username = 'test2@demo.com' AND active='1'
May 20 21:26:37 mail dovecot: auth-worker(6717): Error: sql(test2@demo.com): User query failed: Not connected to database
May 20 21:26:37 mail dovecot: auth: Error: auth worker: Aborted request: Lookup timed out
May 20 21:26:37 mail dovecot: lda: Error: user test2@demo.com: Auth USER lookup failed
May 20 21:26:37 mail dovecot: lda: Fatal: Internal error occurred. Refer to server log for more information.
May 20 21:26:37 mail dovecot: auth-worker(6719): Error: mysql(localhost): Connect failed to database (postfix): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) - waiting for 1 seconds before retry
May 20 21:26:38 mail postfix/pipe: 026844043CD4: to=<test2@demo.com>, relay=dovecot, delay=83731, delays=83670/0.04/0/61, dsn=4.3.0, status=deferred (temporary failure)
May 20 21:26:38 mail dovecot: auth-worker(6719): Error: mysql(localhost): Connect failed to database (postfix): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) - waiting for 5 seconds before retry
May 20 21:26:43 mail dovecot: auth-worker(6719): Error: mysql(localhost): Connect failed to database (postfix): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) - waiting for 25 seconds before retry
May 20 21:27:08 mail dovecot: auth-worker(6719): Error: mysql(localhost): Connect failed to database (postfix): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) - waiting for 125 seconds before retrypostfix配置如下:# postconf -n
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
default_destination_concurrency_limit = 10
default_process_limit = 500
disable_dns_lookups = yes
dovecot_destination_recipient_limit = 1
inet_interfaces = all
inet_protocols = ipv4
message_size_limit = 15360000
mydestination = localhost
mydomain = demo.com
myhostname = mail.demo.com
mynetworks = 127.0.0.0/8
myorigin = $mydomain
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_invalid_hostname, reject_non_fqdn_hostname, reject_unknown_sender_domain, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unauth_pipelining, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:2000
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_transport = dovecot
virtual_uid_maps = static:2000dovecot 配置如下:# dovecot -n
# 2.2.10: /etc/dovecot/dovecot.conf
# OS: Linux 3.10.0-229.4.2.el7.x86_64 x86_64 CentOS Linux release 7.1.1503 (Core)xfs
auth_mechanisms = plain login cram-md5
dict {
quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
}
disable_plaintext_auth = no
first_valid_uid = 2000
last_valid_uid = 2000
listen = *
mail_location = maildir:/var/vmail/%d/%n
mbox_write_locks = fcntl
passdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
plugin {
quota = dict:User quota::proxy::quota
quota_rule = *:storage=1G
}
postmaster_address = postmaster@demo.com
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0666
user = postfix
}
unix_listener auth-client {
group = postfix
mode = 0600
user = postfix
}
unix_listener auth-userdb {
group = vmail
mode = 0600
user = vmail
}
}
service dict {
unix_listener dict {
group = vmail
mode = 0600
user = vmail
}
}
ssl_cert = </etc/pki/dovecot/certs/dovecot.pem
ssl_key = </etc/pki/dovecot/private/dovecot.pem
userdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
protocol lda {
mail_plugins = quota
}
protocol pop3 {
mail_plugins = quota
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
pop3_uidl_format = %08Xu%08Xv
}网上找不到这个解决办法,求高手们指点,小弟在此感谢 加QQ1474804934 加QQ1474804934 没人知道嘛? smtpd_sasl_path = private/auth
这一句错了。
改为
smtpd_sasl_path = smtpd
新建一个文件,路径自己调整,内容如下
pwcheck_method: auxprop
auxprop_plugin: sql
mech_list: plain login
sql_engine: mysql
sql_hostnames: 127.0.0.1
sql_user: root
sql_passwd: xxxx
sql_database: xxx
sql_select: select password from user where mail='%u@%r'
页:
[1]