我的服务器上的交付问题已经有一段时间了,但只有在发送到外部地址时,转发到我自己的电子邮件地址才有效。这个问题已经困扰很久了,必须解决它。一直在网上搜索“Postfix Relay Access Denied”,但没有一个解决方案为我修复它,尽管我确实做了一些更改。
我在 Linode 上托管。这是我的 main.cf 文件
# 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 (Debian/GNU)
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
smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks reject_unauth_destination
myhostname = mail.emergenceguardian.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = spiritualselftransformation.com, www.spiritualselftransformation.com, localhost, localhost.spiritualselftransformation.com, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_alias_domains = emergenceguardian.com shamanicattraction.com satrimono.com
virtual_alias_maps = hash:/etc/postfix/virtual
home_mailbox = mail/
我错过了什么?
该服务器应该 1. 将特定域的电子邮件转发到我在其他地方托管的电子邮件帐户 2. 允许从我的网站发送电子邮件
另外,如果我写的是spiritualselftransformation.com 或emergeguardian.com,对mydestination 有什么影响?我不知道这是否重要,但 EmergenceGuardian 电子邮件的 DNS 已链接到 ProtonMail。
你还有什么建议调整的吗?
谢谢
原来问题是我的应用程序被配置为发送到指向公共服务器 IP 的服务器的公共地址,然后被拒绝。我必须将公共 IP 添加到 mynetworks 中,或者将应用程序配置为发送到 localhost。