Postfix:禁用本地邮件传递

Postfix:禁用本地邮件传递

每当我给“root”发送电子邮件时,我希望它被转发到[电子邮件保护](而不是本地交付)。

然而,我不断收到这样的信息:

Feb  9 17:41:54 botmaster postfix/smtp[29969]: B6E0B808F5: to=<[email protected]>, relay=none, delay=0.01, delays=0.01/0/0.01/0, dsn=5.4.6, status=bounced (mail for botmaster.corp.flatturtle.com loops back to myself)

这是我的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 (by FlatTurtle)
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.

myhostname = mx.flatturtle.com
#alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
local_transport = error:local delivery is disabled
mydestination = localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 172.27.0.0/18 85.12.6.130/32
#mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
relay_domains = /home/mx/postfix_transport
unknown_local_recipient_reject_code = 550 

smtpd_recipient_restrictions =
        permit_sasl_authenticated,
        permit_mynetworks,
        reject_unauth_destination,
        reject_unauth_pipelining,
        reject_rbl_client sbl-xbl.spamhaus.org,
        check_policy_service unix:private/postgrey,
        permit

有几种方法可以禁用本地传送,但似乎都不起作用(或者至少我一直收到该消息)。

挖掘 mx flatturtle.com:

flatturtle.com.     14679   IN  MX  30 mx.flatturtle.com.
flatturtle.com.     14679   IN  MX  10 mail.flatturtle.com.

挖掘 mx.flatturtle.com:

mx.flatturtle.com.          604800  IN  CNAME   mail2.rootspirit.com.
mail2.rootspirit.com.       21600   IN  CNAME   one.rootspirit.com.
one.rootspirit.com.         21600   IN  A       95.211.44.129

挖掘 mail.flatturtle.com:

mail.flatturtle.com.    444387  IN  CNAME   mail.rootspirit.com.
mail.rootspirit.com.    10265   IN  A       85.12.6.130

挖掘 flatturtle.com:

flatturtle.com.     14594   IN  A   85.12.6.130

挖掘 botmaster.corp.flatturtle.com:

botmaster.corp.flatturtle.com. 4680 IN  A   95.211.44.129

答案1

“邮件循环回到我自己”只有一个原因:postfix 正在向它负责的收件人域发送邮件,例如 RCPT TO:[电子邮件保护],而 $myhostname 是 example.org 的 MX。

没有配置可以解决这个问题,因为它是你配置了什么

将 root 的别名添加到 Postfix 框以外的某个地方,例如:

root:  [email protected]

答案2

Postfix 不允许将电子邮件发送到 SMTP 横幅中具有相同 myhostname 的目标 SMTP 服务器。那么您必须将当前的 myhostname 设置为 backup.example.org 或其他名称。

myhostname 是机器名,为了避免此问题,您可以将 MX 服务器名称设置为“dexter.example.org”,将备份服务器名称设置为“deedee.example.org”。RFC 1178 规定“使用主题名称”。

答案3

我发现了一种解决方法,即在名称服务器上创建一个新域名:“botmaster.corp.flatturtle.com”。

MX 记录指向另一个 SMTP 服务器。

因此邮件根(添加了@botmaster.corp.flatturtle.com 域)被转发并正确传递。

相关内容