我有一个邮件服务器(Postfix/Dovecot),其配置如下:电子邮件发送到每个虚拟用户的本地邮箱,并转发到 Google Apps 地址(例如[电子邮件保护])。
一切正常,邮件已发送到服务器邮箱和 Google。
然而,日志中出现了一个奇怪的问题。在服务器路由邮件后,它会收到来自 Google Apps 服务器的连接,该连接引用了它们刚刚收到的电子邮件 - 它会拒绝该电子邮件,原因是“中继访问被拒绝”。我不确定为什么会发生这种情况,也不知道 Google 会发送什么样的响应。
这不是一个大问题,但我很好奇它是什么......我怀疑这是我忽略的一些非常明显的东西,但我的搜索能力却在逃避我!
示例(已清理的)邮件日志:
Mar 20 13:51:03 services postfix/pipe[15363]: 076BF13A005: to=<[email protected]>, relay=dovecot, delay=0.93, delays=0.45/0.01/0/0.47, dsn=2.0.0, status=sent (delivered via dovecot service)
Mar 20 13:51:04 services postfix/smtp[15364]: 076BF13A005: to=<[email protected]>, orig_to=<[email protected]>, relay=gmail-smtp-in.l.google.com[173.194.78.27]:25, delay=1.1, delays=0.45/0.01/0.09/0.57, dsn=2.0.0, status=sent (250 2.0.0 OK 1363787301 fu5si2128331wib.94 - gsmtp)
Mar 20 13:51:04 services postfix/qmgr[20596]: 076BF13A005: removed
Mar 20 13:51:05 services postfix/smtpd[15356]: connect from mail-la0-f69.google.com[209.85.215.69]
Mar 20 13:51:05 services postfix/smtpd[15356]: NOQUEUE: reject: RCPT from mail-la0-f69.google.com[209.85.215.69]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-la0-f69.google.com>
Mar 20 13:51:05 services postfix/smtpd[15356]: disconnect from mail-la0-f69.google.com[209.85.215.69]
postconf -n 输出:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases,hash:/var/lib/mailman/data/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
disable_vrfy_command = yes
dovecot_destination_recipient_limit = 1
inet_interfaces = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mailman_destination_recipient_limit = 1
mydestination = (localservername), localhost.(localservername), www.$mydomain, localhost
mydomain = domain.org
myhostname = (localservername)
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 localhost
myorigin = /etc/mailname
owner_request_special = no
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_delay_reject = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/ssl/certs/postfix.pem
smtpd_tls_key_file = /etc/ssl/private/postfix.pem
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf,hash:/var/lib/mailman/data/virtual-mailman
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = dovecot
答案1
“connect from” 表示客户端连接到您的服务器。请参阅此链接 用于配置客户端限制。本质上,您已postfix
通过以下方式请求此行为:
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
mail-la0-f69.google.com[209.85.215.69] 不在:
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 localhost
也不是sasl authenticated
,导致它退回到最后的选择reject_unauth_destination
。
答案2
谷歌似乎正在尝试使用您的电子邮件服务器发送消息。您如何将消息转发给谷歌?这可能是问题的一部分。
答案3
日志似乎表明 Google 正在将发送给它的消息转发回给您。此消息被拒绝,因为作为从外部网络到外部域的未经身份验证的消息,它无法通过smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
。
您应该查看您的 Google Apps 设置和 domain.org.test-google-a.com 的 MX 记录。