我的局域网上有两台服务器:mail.example.com 和 alpha.example.com。alpha.example.com 上的脚本会将电子邮件发送到[电子邮件保护]alpha.example.com 上的 Sendmail MTA 将此电子邮件发送到 mail.example.com。其“发件人”地址为[电子邮件保护]
mail.example.com 上的 Postfix 拒绝了此请求,邮件日志显示“发件人地址被拒绝:未找到域名“
Sep 29 13:58:20 mail postfix/smtpd[22938]: NOQUEUE: reject: RCPT from unknown[1.2.3.4]: 450 4.1.8 <[email protected]>: Sender address rejected: Domain not found; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<alpha.example.com>
我不明白为什么 mail.example.com 找不到域 alpha.example.com。mail.example.com 上的 /etc/hosts 有一个条目
1.2.3.4 alpha alpha.example.com
我可以从 mail.example.com ping 这两个名称
这是 Postfix main.cf
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
mydestination = mail.localdomain, mail.localdomain, localhost.localdomain, localhost, /etc/postfix/mydomains
unknown_local_recipient_reject_code = 550
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
recipient_delimiter = +
home_mailbox = Mail/
mailbox_size_limit = 0
disable_vrfy_command = yes
smtpd_helo_required = yes
smtpd_recipient_restrictions =
permit_mynetworks
reject_unauth_destination
reject_unauth_pipelining
reject_invalid_hostname
reject_non_fqdn_sender
reject_unknown_sender_domain
reject_non_fqdn_recipient
reject_unknown_recipient_domain
reject_rbl_client dnsbl.njabl.org
reject_rbl_client dnsbl.sorbs.net
reject_rbl_client bl.spamcop.net
permit
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
myhostname = bubba.localdomain
myorigin = /etc/mailname
relayhost = mail.<my ISP>.com
inet_interfaces = all
smtp_sasl_security_options = noplaintext, noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_auth_enable = no
我曾在 serverfault.com 上简要查看过类似的问题,但在我的 main.cf 中我没有看到 smtp_sender_restrictions 部分,所以我不清楚如何让 Postfix 停止拒绝来自[电子邮件保护]。
答案1
将 alpha.example.com 添加到 /etc/postfix/mydomains 解决了该问题。
在具有数十或数百台服务器的局域网上,维护起来会很烦人,也许有一个更通用的解决方案?