我的设置是,我的中央邮件服务器 CM 转发到反垃圾邮件服务器 cacti,后者充当 SMTP 服务器。CM 上的电子邮件地址之一已收到 40 封电子邮件,这些电子邮件显然是 Cacti 发出的退回通知,如下所示:
The mail system *<[email protected]>: mail for cacti.snowbarre.co.za loops back to myself
Final-Recipient: rfc822; [email protected]
Original-Recipient: rfc822;[email protected]
Action: failed
Status: 5.4.6
Diagnostic-Code: X-Postfix; mail for cacti.snowbarre.co.za loops back to myself*
即使没有发送任何邮件,他也会收到这些邮件。巧合的是,在我向 Cacti 服务器发送垃圾邮件的那天,他开始收到这些邮件。垃圾邮件来源已找到并处理,但该客户仍不断收到这些发送失败的邮件。
我检查了 main.cf,发现mydestination = $myhostname, localhost.localdomain, localhost
有这行。这只影响了服务器上一个电子邮件地址,该服务器上大约有 12000 个邮箱,因此可能不是全局问题。
root@cacti:~# postconf -n
2bounce_notice_recipient = [email protected]
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
bounce_notice_recipient = [email protected]
bounce_template_file = /etc/postfix/bounce.cf
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
debug_peer_level = 6
debug_peer_list = 172.17.243.13
delay_notice_recipient = [email protected]
error_notice_recipient = [email protected]
header_checks = regexp:/etc/postfix/header_checks
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
message_size_limit = 15000000
mydestination = smtp.snowbarreco.za, localhost.snowbarre.co.za, localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 10.20.0.0/16 172.16.0.0/16
172.17.0.0/16 196.x.x.0/24 196.x.x.0/24 196.x.x.0/26 192.168.0.0/16
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions =
permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
答案1
要修复此错误,请将系统 FQDN 添加到 mydestination 或 Relay_domains。Postfix 接受 virtual_mailbox_domains、virtual_alias_domains 中列出的域的邮件,以及解析为 inet_interfaces 和 proxy_interfaces 中列出的 IP 地址的域的邮件。使用 postconf 或编辑 main.cf 文件来更新 mydestination:
mydestination = localhost.$mydomain, localhost, mail.example.com
service postfix reload