Postfix邮件Pop3登录时报错
本帖最后由 43670827 于 2013-10-31 10:27 编辑通过网页形式可以正常登录,并发送邮件。但是使用POP3时。日志中打印以下错误。
Oct 31 04:25:10 mail1 postfix/smtpd: warning: SASL authentication failure: could not verify password
Oct 31 04:25:10 mail1 authdaemond: failed to connect to mysql server (server=localhost., userid=extmail.): Unknown MySQL server host 'localhost.' (1)
Oct 31 04:25:10 mail1 postfix/smtpd: warning: unknown: SASL LOGIN authentication failed: generic failure
Oct 31 04:25:10 mail1 postfix/smtpd: lost connection after AUTH from unknown
网上搜了一圈子,没有看的太明白。。有的是说
/usr/local/courier-authlib/etc/authlib/authmysqlrc和/etc/postfix/main.cf中的domain目录不一致。也有说UID不一致。
我都没有发现。
我的postconf -n结果如下:
# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
fallback_transport = /usr/bin/procmail
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
local_recipient_maps =
mail_owner = postfix
mailbox_transport = /usr/bin/procmail
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 14336000
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = mail1.xxxx ###信息我屏蔽了。
myhostname = mail1.xxx ####信息我屏蔽了。
mynetworks = xx.251.xx.0/24, 127.0.0.0/8 ####信息我屏蔽了。
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_banner = Welcome to our $myhostname ESMTP
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_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:89
virtual_mailbox_base = /var/mailbox
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 20971520
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_transport = virtual
virtual_uid_maps = static:89
Oct 31 04:25:10 mail1 authdaemond: failed to connect to mysql server (server=localhost., userid=extmail.): Unknown MySQL server host 'localhost.' (1)
不建议连mysql用咯calhost。 回复 2# wenhq
问题搞定了。是postfix向mysql查询用户时,传入的用户名与数据库不一致引起的。
定位方法如下:
1.打开courier-authlib配置文件中authdaemonrc,我这次的安装路径为/usr/local/courier-authlib/etc/authlib/
2.修改其中的log级别字段,默认情况下为0,将它改成2后,查看然后重新通过客户端发送邮件,查看maillog日志。
这时发现了。登录时的详细执行的sql语句。。去掉sql的条件后,是可以发现该用户的,仔细比对时,发现Postfix传过来的用户名和数据库的不一致。
这一点我在网上一个高手的问题中找到了答案,
问题出在了postfix配置文件main.cf中有一个配置项,
smtpd_sasl_local_domain = $myhostname
postfix向mysql传递用户名的时候在前面拼装了这个$myhostname,我这次是把它改成正常的domain就OK了 当然网上还有很多相同的报错,但是不同的问题。
比如说。courier-authlib的配置文件mysqlrc中有多作的空格。
/etc/hosts里面没有Localhost等等的 回复 3# 43670827
不错。。。加油。 好冷清沒人回答。貌似很多都喜歡用mysql。要是不怎麼大型的 系統帳號來做 省事多了 woxizishen 发表于 2013-11-01 19:57 static/image/common/back.gif
好冷清沒人回答。貌似很多都喜歡用mysql。要是不怎麼大型的 系統帳號來做 省事多了
同感,我也喜欢用系统账号做
页:
[1]