我在用着:
# 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 地址。
所以我已经为我的域设置了 MX 记录:
# 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
所以我可能遗漏了一些小东西?
顺便说一句,每天从两个服务器收到的 logwatch 邮件在我的 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
本地收件人表中的用户未知在拒绝日志消息中意味着什么?
如果邮件日志中没有任何内容,则没有邮件发送到您的服务器。
您显示的 MX 记录意味着只要 preferans.de 正在回复邮件,就永远不会使用第二个 MX。
请在
postconf -n
您的帖子中包含输出,以便我们知道您在说什么。如文档所述,postfix 默认拒绝未知本地收件人的邮件。您应该事先定义任何有效的收件人。
由于您的 main.cf 缺少
virtual_alias_maps
条目,因此未使用您的虚拟文件;将以下内容添加到 main.cf 并重新加载: