我在example.net工作:-),我的团队的服务器名为tardis.example.net 。 发送给我们的邮件必须先通过我们公司的内部中继主机。 尽pipe邮件正确传递到我们的服务器,但收件人地址将从以下位置重写:
[email protected]
至:
[email protected]
因此,我们的默认Postfix(2.6.6)configuration拒绝传递消息:
Nov 27 15:49:23 tardis postfix/qmgr[10564]: B6CC73FA22: from=<[email protected]>, size=3953, nrcpt=1 (queue active) Nov 27 15:49:24 tardis postfix/smtp[10580]: B6CC73FA22: to=<[email protected]>, orig_to=<[email protected]>, relay=outbound.example.net[172.30.113.194]:25, delay=0.71, delays=0.47/0.01/0.14/0.1, dsn=5.1.1, status=bounced (host outbound.example.net[172.30.113.194] said: 550 5.1.1 <[email protected]>... User unknown (in reply to RCPT TO command))
我的解决scheme是从这改变main.cf:
myhostname = tardis.example.net mydomain = example.net mydestination = $myhostname, localhost.$mydomain, localhost
对此:
myhostname = tardis.example.net mydomain = example.net mydestination = $myhostname, $mydomain, localhost.$mydomain, localhost
这工作正常; 通过接收$ mydomain的邮件,tardis.example.net现在可以接收收到的邮件,即使收件人已更改为[email protected]
但是,问题是,从我们的服务器到@ example.net的所有外发邮件现在都被视为本地邮件。 Postfix不是被转发到$ relayhost(outbound.example.net),而是尝试将其交付给tardis.example.net上的本地用户。
我怎样才能configuration我们的服务器接受传入的@ example.net邮件,但发送所有传出的邮件到$ relayhost(可能的例外是发送到@ tardis.example.net的传出邮件,这是唯一应该在本地)?
我浏览了邮件转发的FAQ以及文档中的各种与relay相关的选项,但找不到任何有助于我的东西。
如果您需要进一步的configuration信息,我将很乐意提供。 感谢任何能提供帮助的人。
尔加! 是的,你是对的,Ismooth – 我还没有意识到, to和orig_to线来自Postfix,而不是上游邮件主机之间的区别。 在这种情况下,由公司加载到我们服务器上的Postfix的标准分发包含以下行:
masquerade_domains = example.net
这当然会剥离“tardis”位,并将[email protected]转换为[email protected] 。
解决scheme是删除该行,然后从mydestination指令中删除$ mydomain。 问题解决了。 谢谢您的帮助!