Tag Archives: smtp

postfix和postgrey问题

公司的邮件服务器收不到外来邮件了,日志里有这样的错误:

554 Service unavailable; Client host [xxx.xxx.xxx.xxx] blocked using relays.ordb.org; ordb.org was shut down on December 18, 2006. Please remove from your mailserver.;

对应main.cf里的配置是这样的:

smtpd_client_restrictions = permit_mynetworks, warn_if_reject reject_rbl_client sbl.spamhaus.org, warn_if_reject reject_rbl_client relays.ordb.org, warn_if_reject reject_rbl_client blackholes.easynet.nl, warn_if_reject reject_rbl_client dnsbl.njabl.org

改成只保留smtpd_client_restrictions = permit_mynetworks, 又有新信息出现:

postfix/smtpd[16212]: warning: problem talking to server 127.0.0.1:60000: Connection timed out

127.0.0.1:60000是postgrey工作的端口,用ps和netstat 发现postgrey进程还在,但top命令发现它占用了99%的CPU,而且用/etc/init.d/postgrey stop停不掉,只好kill掉,并改postfix里相应的设置,去掉postgrey检查:

smtpd_recipient_restrictions = reject_unauth_pipelining, permit_mynetworks,permit_sasl_authenticated, reject_non_fqdn_recipient,reject_unauth_destination, check_policy_service inet:127.0.0.1:60000,permit

重启postfix,邮件可以收到了。再恢复smtpd_client_restrictions的配置,去掉relays.ordb.org检查,邮件可以收到。顺便搞清楚了warn_if_reject的含义:有它在时并不真正的拒绝邮件。

postgrey的问题还没找到解决办法,不知道为什么会hang在那里,暂时不用它了。

==== 2008-05-14 ====
补充: 将Berkeley DB由原来的4.3升级到4.4以后,postgrey正常了。
搜索到的相关信息:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=441069
https://bugs.edge.launchpad.net/ubuntu/gutsy/+source/db4.4/+bug/153996

升级系统导致Postfix的SMTP认证失败(Cyrus-SASL + MySQL)

日志里这样的错误信息:
warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory

最终发现原因:main.cf里smtpd_sasl_path的设置错误,可能是更新修改的。
把smtpd_sasl_path=/etc/postfix/sasl:/usr/lib/sasl2改成smtpd_sasl_path=smtpd后,重启postfix和courier-authdaemon,问题解决。