在CentOS 6中使用postfix将邮件转发给[email protected]

我在用着:

# cat /etc/*release CentOS release 6.3 (Final) # rpm -qa | grep post postfix-2.6.6-2.2.el6_1.x86_64 

在2个服务器上: preferans.de和(是的,有趣的名字) static.103.78.9.176.clients.your-server.de

我拥有多个域名,并希望所有传入邮件的邮件都被转发到我的Gmail地址。

所以我已经为我的域名设置了MXlogging:

 # host videoskat.de videoskat.de has address 176.9.40.169 videoskat.de mail is handled by 100 static.103.78.9.176.clients.your-server.de. videoskat.de mail is handled by 10 preferans.de. # host balkan-preferans.de balkan-preferans.de has address 176.9.40.169 balkan-preferans.de mail is handled by 100 static.103.78.9.176.clients.your-server.de. balkan-preferans.de mail is handled by 10 preferans.de. 

在我添加的两台服务器上:

 # head /etc/postfix/virtual @balkan-preferans.de [email protected] @videoskat.de [email protected] # postmap /etc/postfix/virtual # postmap -q "@videoskat.de" /etc/postfix/virtual [email protected] 

并在防火墙中打开了端口25

 # grep -w 25 /etc/sysconfig/iptables -A INPUT -p tcp -m state --state NEW -m tcp -m multiport --dports 25,22 -j ACCEPT 

但现在当我发送邮件到[email protected] ,在postfix日志中没有任何东西可以看到:

 # sudo tail /var/log/maillog Jan 15 10:50:42 postfix/postfix-script[1401]: starting the Postfix mail system Jan 15 10:50:42 postfix/master[1402]: daemon started -- version 2.6.6, configuration /etc/postfix 

所以我可能会错过一些小事?

顺便说一句,每天的日志邮件从两个服务器到达我的Gmail收件箱[email protected]罚款

更新2:

我已经将这两行添加到/etc/postfix/main.cf

 inet_interfaces = all mydestination = $myhostname, localhost.$mydomain, localhost, videoskat.de, balkan-preferans.de 

现在我在/var/log/maillog看到传入的连接,但是它们被拒绝了:

 postfix/smtpd[3209]: NOQUEUE: reject: RCPT from static.114.69.9.176.clients.your-server.de[176.9.69.114]: 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in local recipient table; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<www> postfix/smtpd[3209]: disconnect from static.114.69.9.176.clients.your-server.de[176.9.69.114] 

postconf -n输出如下

 alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 2 html_directory = no inet_interfaces = all inet_protocols = all mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = $myhostname, localhost.$mydomain, localhost, videoskat.de, balkan-preferans.de newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES sample_directory = /usr/share/doc/postfix-2.6.6/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop unknown_local_recipient_reject_code = 550 

本地收件人表中的用户未知在拒绝日志消息意味着什么?

如果邮件日志中没有任何内容,则不会将邮件发送到您的服务器。

您显示的MXlogging意味着只要preferans.de正在回复邮件,第二个MX将永远不会被使用。

请包括postconf -n的输出,所以我们知道你在说什么。

本地收件人表中的用户未知在拒绝日志消息中意味着什么?

据记载 ,postfix默认拒绝未知本地收件人的邮件。 您应该事先定义任何有效的收件人。

由于您的main.cf缺lessvirtual_alias_maps条目,您的虚拟文件不被使用; 将以下内容添加到main.cf并重新加载:

 virtual_alias_maps = /etc/postfix/virtual