我有一个(可能不寻常的)使用Postfix将邮件转发到另一个Postfix邮件服务器,然后需要发送电子邮件的情况。 我已经阅读了大量的教程,并看到使用Postfix作为电子邮件中继发送给像Google这样的外部提供者的说明。这是不同的,因为我需要发送到另一个Postfix服务器,并使其作为发件人。 发件人总是相同的(对于两个服务器),但最终的收件人可以是任何人。
问题是我错过了一些重要的信息:
这里是基本的configuration参数:
Postfix服务器1:
main.cf: myhostname = postfix1.com relayhost = mail.postfix2.com mydestination = postfix1.com, localhost.postfix1.com, localhost, mail.postfix2.com inet_interfaces = all
Postfix服务器2:
main.cf: myhostname = mail.postfix2.com mydomain = postfix2.com mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain relay_domains = $mydestination inet_interfaces = all
当我尝试中继到mail.postfix2.com我得到:
Oct 21 11:04:28 ns3312015 postfix / error [2538]:C016F47E75B5:to =
<[email protected]>,relay = none,delay = 25,delay = 1.4 / 24/0 / 0.1,dsn = 4.4.1 ,status = deferred(交付暂时挂起:连接到mail.postfix2.com [123.123.123.123]:25:连接超时)
虽然我已经打开了端口25,但是我怀疑主机是以某种方式阻塞它的,所以我试着在postfix1.com main.cf中使用这个参数:
relayhost = mail.postfix2.com:587
并在postfix2.com我uncom评论这在master.cf中:
submission inet n - n - - smtpd
回应的是:
Oct 21 09:56:03 ns3312015 postfix / smtp [16154]:B8BB347E71F0:to =
<[email protected]>,relay = mail.postfix2.com [123.123.123.123]:587,延迟= 1.4,延迟= 0.68 / 0.02 / 0.25 / 0.5,dsn = 4.7.1,status = deferred(主机mail.postfix2.com [123.123.123.123]表示:454 4.7.1<[email protected]>:中继访问被拒绝(回复RCPT TO命令))
我需要做些什么来为mail.postfix2.com接受postfix1.com邮件并发送它?
只需将postfix1.com放在mynetworks上的mynetwork中即可。