免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2940 | 回复: 6
打印 上一主题 下一主题

[Mail] Postfix邮件Pop3登录时报错 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-10-31 10:11 |只看该作者 |倒序浏览
本帖最后由 43670827 于 2013-10-31 10:27 编辑

通过网页形式可以正常登录,并发送邮件。但是使用POP3时。日志中打印以下错误。
Oct 31 04:25:10 mail1 postfix/smtpd[6769]: 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[6769]: warning: unknown[xxx.251.xx.161]: SASL LOGIN authentication failed: generic failure
Oct 31 04:25:10 mail1 postfix/smtpd[6769]: lost connection after AUTH from unknown[xx.251.xx.161]

网上搜了一圈子,没有看的太明白。。有的是说
/usr/local/courier-authlib/etc/authlib/authmysqlrc和/etc/postfix/main.cf中的domain目录不一致。也有说UID不一致。
我都没有发现。
我的postconf -n结果如下:
[root@mail1 log]# 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

论坛徽章:
16
IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每月发帖之星
日期:2015-09-11 19:30:52IT运维版块每周发帖之星
日期:2015-09-11 19:20:31IT运维版块每日发帖之星
日期:2015-08-26 06:20:00每日论坛发贴之星
日期:2015-08-20 06:20:00IT运维版块每日发帖之星
日期:2015-08-20 06:20:002015年辞旧岁徽章
日期:2015-03-03 16:54:15金牛座
日期:2014-05-04 16:58:09双子座
日期:2013-12-17 16:44:37辰龙
日期:2013-11-22 15:20:59狮子座
日期:2013-11-18 22:55:08射手座
日期:2013-11-12 10:54:26
2 [报告]
发表于 2013-10-31 11:28 |只看该作者
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。

论坛徽章:
0
3 [报告]
发表于 2013-11-01 17:52 |只看该作者
回复 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了

论坛徽章:
0
4 [报告]
发表于 2013-11-01 17:53 |只看该作者
当然网上还有很多相同的报错,但是不同的问题。
比如说。courier-authlib的配置文件mysqlrc中有多作的空格。
/etc/hosts里面没有Localhost等等的

论坛徽章:
16
IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每月发帖之星
日期:2015-09-11 19:30:52IT运维版块每周发帖之星
日期:2015-09-11 19:20:31IT运维版块每日发帖之星
日期:2015-08-26 06:20:00每日论坛发贴之星
日期:2015-08-20 06:20:00IT运维版块每日发帖之星
日期:2015-08-20 06:20:002015年辞旧岁徽章
日期:2015-03-03 16:54:15金牛座
日期:2014-05-04 16:58:09双子座
日期:2013-12-17 16:44:37辰龙
日期:2013-11-22 15:20:59狮子座
日期:2013-11-18 22:55:08射手座
日期:2013-11-12 10:54:26
5 [报告]
发表于 2013-11-01 18:01 |只看该作者
回复 3# 43670827


    不错。。。加油。

论坛徽章:
24
天蝎座
日期:2014-05-13 18:05:59IT运维版块每日发帖之星
日期:2015-11-26 06:20:00操作系统版块每月发帖之星
日期:2015-12-02 14:57:54IT运维版块每月发帖之星
日期:2016-01-07 23:01:56IT运维版块每周发帖之星
日期:2016-01-07 23:04:2615-16赛季CBA联赛之青岛
日期:2016-01-23 07:58:272016猴年福章徽章
日期:2016-02-18 15:30:3415-16赛季CBA联赛之北控
日期:2016-03-23 14:20:06IT运维版块每日发帖之星
日期:2016-04-01 06:20:0015-16赛季CBA联赛之吉林
日期:2016-06-28 13:51:54IT运维版块每日发帖之星
日期:2016-07-01 06:20:00IT运维版块每日发帖之星
日期:2015-11-23 06:20:00
6 [报告]
发表于 2013-11-01 19:57 |只看该作者
好冷清沒人回答。貌似很多都喜歡用mysql。要是不怎麼大型的 系統帳號來做 省事多了

论坛徽章:
0
7 [报告]
发表于 2013-11-27 22:51 |只看该作者
woxizishen 发表于 2013-11-01 19:57
好冷清沒人回答。貌似很多都喜歡用mysql。要是不怎麼大型的 系統帳號來做 省事多了


同感,我也喜欢用系统账号做
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP