Postfix - 邮件转发不正常 - 被子域名 mail.example.com 拒绝转发给域名 example.com 的服务器

Postfix - 邮件转发不正常 - 被子域名 mail.example.com 拒绝转发给域名 example.com 的服务器

一些信息:

example.com has a MX-record with priority 10,20 and 30 to mail.example.com
mail.example.com has an A-record to 192.0.2.0 (fictional ip)

这是我的 postfix 的 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 (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_un$
myhostname = example.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = localhost, WP-NewBase-052814, localhost.localdomain, localhost
relayhost =
mynetworks = 192.0.2.0/24,127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_alias_domains = mail.example.com
virtual_alias_maps = hash:/etc/postfix/virtual
inet_protocols = ipv4

这是我收到的错误:

    Technical details of temporary failure:
Google tried to deliver your message, but it was rejected by the server for the recipient     
domain example.be by mail.example.com. [192.0.2.0].

关于我应该进行哪些更改才能使邮件转发正常工作,您有什么想法吗?(我已经在 Postfix 目录中的“virtual”文件中配置了带有转发邮件的传入邮件(例如 hotmail.com)

以下是虚拟中使用的线条

[email protected] [email protected]
[email protected] [email protected]

答案1

更新 1:抱歉,我刚看到您定义了virtual_alias_domains。这个文件的内容是什么?

哪里$mydomain

您需要告诉 postfix 您接受哪个域的邮件。

  mydestination = $myhostname localhost.$mydomain localhost $mydomain

请注意,您的配置未显示$mydomainmydestination参数中。

在您的 main.cf 中,包括以下内容:

mydomain = example.com
mydestination = $myhostname localhost.$mydomain localhost $mydomain

另外,请不要使用 Google 的 DNS 作为示例 IP。这确实会造成混淆,尤其是当您通过从 Gmail.com 发送邮件进行测试时

更好的测试方法是简单地打开到邮件服务器端口 25 的 telnet 会话,然后在那里手动输入 SMTP 命令。(您可以在网上找到大量有关 telnet 和 SMTP 故障排除的指南)。

更新2- 使用保留地址作为示例 - 6.6.6.6 也是一个真实地址。

根据RFC 5737

提供块 192.0.2.0/24 (TEST-NET-1)、198.51.100.0/24 (TEST-NET-2) 和 203.0.113.0/24 (TEST-NET-3) 供文档使用。

相关内容