后缀 – 邮件转发不正常 – 服务器通过子域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]. 

任何想法,我应该改变,以使mailforwarding工作? (我已经在Postfix目录中的“虚拟”文件中configuration了转发邮件(例如hotmail.com)

这里是在虚拟中使用的线

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

更新1:对不起,我刚刚看到你已经定义了virtual_alias_domains 。 这个文件的内容是什么?

$mydomain在哪里?

你需要告诉postfix你接受邮件的域名。

  mydestination = $myhostname localhost.$mydomain localhost $mydomain 

请注意,您的configuration在mydestination参数中不显示$mydomain

在你的main.cf中,包含以下内容:

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

另外,请不要使用Google的DNS作为您的示例IP。 这真的很让人困惑,特别是如果您通过从Gmail.com发送邮件进行testing

一个更好的testing是简单地打开一个telnet会话到邮件服务器的25端口,然后在那里手动inputSMTP命令。 (您可以在网上find大量的指南来远程login和排除SMTP故障)。

Update2 – 为你的例子使用保留的地址 – 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)块。