將每個中繼訊息的 .local 網域重新命名為 .com

將每個中繼訊息的 .local 網域重新命名為 .com

情況:大約 10 個運行 postfix 的虛擬機器(linux)會為多個使用者發送電子郵件。這些電子郵件都透過中央伺服器轉發,然後將它們發送到網路。

虛擬機器的名稱如下:redmine.vanheusden.local 或 scm.vanheusden.local 等。

我希望中央 postfix 伺服器將其轉發的所有電子郵件重新命名為 *@vanheusden.local 至 @vanheusden.com,然後再將其發送到互聯網上。

我以為我可以使用 masquerade_domains 但顯然這(不再)有效?

masquerade_domains = vanheusden.com
local_header_rewrite_clients = static:all
masquerade_classes = envelope_sender, envelope_recipient, header_sender, header_recipient

答案1

不幸的是,在此用例中無法使用 masquerade_domains。

使用 masquerade_domains 可以移除電子郵件地址的網域名稱。

例子:

 /etc/postfix/main.cf:

   masquerade_domains = foo.example.com example.com

strips "any.thing.foo.example.com" to "foo.example.com", but strips "any.thing.else.example.com" to "example.com".

來源:http://www.postfix.org/ADDRESS_REWRITING_README.html#masquerade

相反,您應該使用通用映射。這將允許您根據需要完全重寫地址。

例子:

  /etc/postfix/main.cf:
    smtp_generic_maps = hash:/etc/postfix/generic

  /etc/postfix/generic:
      @vanheusden.local                  @vanheusden.com

來源:http://www.postfix.org/ADDRESS_REWRITING_README.html#generic

相關內容