我在CentOS 6上运行Postfix 2.6.6,正如这篇文章的标题所述,我在接收来自外部源的反弹电子邮件时遇到了问题。 这里是一个例子:
testing1:从Gmail发送一封电子邮件到“我的域名”上的无效电子邮件帐户,并从我们的服务器收到550 5.1.1消息。 按预期工作。
testing2:从“我的域名”发送内部电子邮件到“我的域名”上的无效电子邮件帐户,并立即收到550 5.1.1消息。 按预期工作。
testing3:从“我的域名”发送一封电子邮件到一个无效的Gmail帐户,我什么也收不回来。 问题。
这里的问题是,如果我们的一个员工发送一封电子邮件给一个无效的帐户,并且他们没有收到任何来自外部服务器的退回消息,他们会认为它已经交付,而事实上,所有。
有任何想法吗? 不完全确定哪些设置要改变。 谢谢!
postconf -n:
alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases allow_percent_hack = no broken_sasl_auth_clients = yes command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 2 default_destination_recipient_limit = 100 home_mailbox = Maildir/ html_directory = no inet_protocols = ipv4 initial_destination_concurrency = 3 mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME mailbox_size_limit = 0 mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man message_size_limit = 25480000 milter_default_action = accept milter_protocol = 2 mydestination = $myhostname, localhost.$mydomain, localhost, my.domain.com newaliases_path = /usr/bin/newaliases.postfix non_smtpd_milters = inet:localhost:8891 readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES recipient_delimiter = + sample_directory = /usr/share/doc/postfix-2.6.6/samples sender_bcc_maps = hash:/etc/postfix/bcc sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtpd_client_restrictions = reject_rbl_client sbl.spamhaus.org smtpd_end_of_data_restrictions = check_policy_service inet:127.0.0.1:10031 smtpd_helo_required = yes smtpd_helo_restrictions = permit_mynetworks, reject_invalid_helo_hostname, permit smtpd_milters = inet:localhost:8891 smtpd_recipient_limit = 100 smtpd_recipient_restrictions = reject_unauth_pipelining, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unlisted_recipient, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, permit smtpd_reject_unlisted_sender = yes smtpd_sasl_auth_enable = yes smtpd_sasl_authenticated_header = yes smtpd_sender_restrictions = permit_mynetworks, reject_non_fqdn_sender, reject_unknown_sender_domain, permit smtpd_tls_CAfile = /etc/postfix/postfix.ca.pem smtpd_tls_cert_file = /etc/postfix/postfix.cert.pem smtpd_tls_key_file = /etc/postfix/postfix.key.pem smtpd_tls_mandatory_ciphers = high smtpd_tls_security_level = may unknown_local_recipient_reject_code = 550 virtual_alias_maps = hash:/etc/postfix/virtual
maillog条目显示:
# grep 5D23C6314E maillog Nov 12 21:32:47 apache3 postfix/smtpd[29004]: 5D23C6314E: client=S0106c8fb267f18ed.cg.shawcable.net[174.0.76.61], sasl_method=LOGIN, [email protected] Nov 12 21:32:47 apache3 postfix/cleanup[28695]: 5D23C6314E: message-id=<00e801cffefa$d97f9550$8c7ebff0$@[email protected]> Nov 12 21:32:47 apache3 postfix/qmgr[16105]: 5D23C6314E: from=<[email protected]>, size=31705, nrcpt=1 (queue active) Nov 12 21:32:47 apache3 postfix/smtp[28967]: 5D23C6314E: to=<randomkw092kd982890293982928kdlskd028938random839892@gmail.com>, relay=gmail-smtp-in.l.google.com[74.125.28.27]:25, delay=0.83, delays=0.58/0/0.19/0.07, dsn=5.1.1, status=bounced (host gmail-smtp-in.l.google.com[74.125.28.27] said: 550-5.1.1 The email account that you tried to reach does not exist. Please try 550-5.1.1 double-checking the recipient's email address for typos or 550-5.1.1 unnecessary spaces. Learn more at 550 5.1.1 http://support.google.com/mail/bin/answer.py?answer=6596 cr1si15800531pdb.30 - gsmtp (in reply to RCPT TO command)) Nov 12 21:32:47 apache3 postfix/qmgr[16105]: 5D23C6314E: removed
master.cf
smtp inet n - n - - smtpd -o smtpd_sasl_auth_enable=yes smtps inet n - n - - smtpd pickup fifo n - n 60 1 pickup cleanup unix n - n - 0 cleanup qmgr fifo n - n 300 1 qmgr tlsmgr unix - - n 1000? 1 tlsmgr rewrite unix - - n - - trivial-rewrite bounce unix - - n - 0 discard defer unix - - n - 0 bounce trace unix - - n - 0 bounce verify unix - - n - 1 verify flush unix n - n 1000? 0 flush proxymap unix - - n - - proxymap proxywrite unix - - n - 1 proxymap smtp unix - - n - - smtp relay unix - - n - - smtp -o smtp_fallback_relay= showq unix n - n - - showq error unix - - n - - error retry unix - - n - - error discard unix - - n - - discard local unix - nn - - local virtual unix - nn - - virtual lmtp unix - - n - - lmtp anvil unix - - n - 1 anvil scache unix - - n - 1 scache submission inet n - n - - smtpd -o smtpd_sasl_auth_enable=yes
正如所料,有问题的行来自master.cf 。 这里你的罪魁祸首
bounce unix - - n - 0 discard
这是默认的master.cf内容
bounce unix - - n - 0 bounce
这种变化已经造成了失败的交付反弹将被默默地丢弃。 解决scheme :将该行replace为默认行。
我不知道谁对这个变化负责。 也许有人试图通过下面这个错误的build议来抑制反弹:(
无论如何,你的第一个和第二个testing并不涉及你的后缀反弹。 该行为被称为拒绝,并由smtpd进程处理。