Postfix smtp 问题

Postfix smtp 问题

我有一个带有 dovecot 的 postfix 邮件服务器。如果我通过 Gmail smtp(中继主机)发送邮件,gmail.com 服务器会成功接收邮件,但如果我从 Gmail 地址向我的 postfix 服务器发送邮件,服务器将无法接收邮件。日志中不会显示收到的邮件。25 端口已打开。

这是 main.cf:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

append_dot_mydomain = no

myhostname = domnain.xyz
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = localhost, domnain.xyz

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128

mailbox_size_limit = 5000000000
recipient_delimiter = +
inet_interfaces = all
relayhost = [smtp.gmail.com]:587
#smtpd_sasl_type = cyrus
#smtpd_sasl_auth_enable = yes
#smtpd_sasl_security_options = noanonymous
#broken_sasl_auth_clients = yes

# Enable SASL authentication
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
#smtp_tls_security_level = encrypt

smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination

smtpd_tls_security_level = may
smtp_tls_security_level = may
smtp_tls_note_starttls_offer = yes
smtpd_tls_cert_file = /etc/ssl/certs/key_xyz.crt
smtpd_tls_key_file = /etc/ssl/private/server.key
smtpd_tls_CAfile = /etc/ssl/certs/key_xyz.ca-bundle
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

smtpd_sender_restrictions = permit_sasl_authenticated, reject_unauthenticated_sender_login_mismatch

相关内容