Postfix 出站邮件不起作用

Postfix 出站邮件不起作用

我的 postfix 服务器上的出站邮件出现了问题。postfix 通过 virtualmin/webmin 进行管理。传入邮件运行正常,没有任何问题。

当我尝试向任何外部地址发送邮件时,出现以下错误

Connect to eur.olc.protection.outlook.com[104.47.22.161]:25: Connection timed out

或者

connect to alt2.gmail-smtp-in.l.google.com[2404:6800:4008:c07::1b]:25: Network is unreachable

DNS 在这台服务器上运行良好,我可以 ping 我想要的每个外部域

 ping google.com
PING google.com (172.217.20.78) 56(84) bytes of data.
64 bytes from ams15s33-in-f14.1e100.net (172.217.20.78): icmp_seq=1 ttl=54 time=13.7 ms
64 bytes from ams15s33-in-f14.1e100.net (172.217.20.78): icmp_seq=2 ttl=54 time=22.0 ms
64 bytes from ams15s33-in-f14.1e100.net (172.217.20.78): icmp_seq=3 ttl=54 time=12.2 ms
^C
--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 12.277/16.027/22.072/4.315 ms

DNS 通过 Cloudflare 管理,MX 记录设置为仅 dns(非代理)

这是我的 postfix 配置

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

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 = mail.{DOMAINAME}.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, DOMAINAME.com, localhost.$mydomain, $mydomain
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_protocols = all
virtual_alias_maps = hash:/etc/postfix/virtual
sender_bcc_maps = hash:/etc/postfix/bcc
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtp_tls_security_level = may
allow_percent_hack = no
mynetworks_style = subnet

如果需要任何其他信息请告诉我

答案1

它看起来不像是后缀或 DNS 问题(两个主机都在错误消息中得到解决)。第二次尝试时无法访问网络可能来自未正确配置的 IPv6 网络。连接超时可能是由于防火墙配置过于严格,请尝试 telnet 到 104.47.22.161 端口 25,而不是 ping,后者是不同的协议。

相关内容