我在我的 Ubuntu 16.04 服务器 (DigitalOcean) 上安装了 Postfix,对于我的网站:example.com,我添加了一个 A 记录 mail.example.com 和一个由 mail.example.com 处理的 example.com 的 MX 记录
它正在运行,但是当我检查我的 mail.example.com wu-ith MXToolBox 时,我收到 1 个警告
Result
SMTP Banner Check Reverse DNS does not match SMTP Banner
这是 /etc/postfix/main.cf
/etc/postfix/main.cf
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# TLS parameters
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:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = example.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, example.com, example, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
home_mailbox = Maildir/
virtual_alias_maps = hash:/etc/postfix/virtual
smtpd_client_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination reject_rbl_client zen.spamhaus.org reject_rbl_client bl.spamcop.net reject_rbl_client cbl.abuseat.org reject_unknown_client permit
policyd-spf_time_limit = 3600
smtpd_recipient_restrictions =
reject_unauth_destination,
check_policy_service unix:private/policyd-spf
# Milter configuration
# OpenDKIM
milter_default_action = accept
# Postfix ≥ 2.6 milter_protocol = 6, Postfix ≤ 2.5 milter_protocol = 2
milter_protocol = 6
smtpd_milters = local:/opendkim/opendkim.sock
non_smtpd_milters = local:/opendkim/opendkim.sock
答案1
错误消息非常直接。横幅与反向 DNS 记录不匹配。您必须向托管服务提供商更新反向记录,或者更新横幅以匹配现有的反向记录。
当客户端连接时,横幅是邮件服务器发送的第一行:
[~]$ nc localhost 25
220 example.com ESMTP Postfix (Debian/GNU)
它由配置行给出
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
$myhostname
被主机配置的主机名替换,并被$mail_name
正在使用的 MTA 替换。但是您不必使用变量:
smtpd_banner = example.com ESMTP Postfix (Ubuntu)
将工作。
要实际更改反向 DNS,您必须咨询提供商帮助台。对于 DO,这篇帮助文章可能会有帮助。