如何根據收件者位址在 Postifix 中路由郵件

如何根據收件者位址在 Postifix 中路由郵件

我基於此建立了一個垃圾郵件過濾器食譜

從那時起,我的要求發生了變化,想知道如何根據收件者電子郵件地址在 Postfix 中路由郵件。一些用戶現在屬於新網域並託管在另一個郵件伺服器上,但我不想丟失發送到其舊地址的郵件。

所以如果我收到:

當我嘗試簡單地將以下內容添加到 /etc/postfix/virtual 時,測試訊息似乎在某個地方丟失了。我不知道它去了哪裡,也不知道如何檢查它去了哪裡......

[email protected] [email protected]

非常感謝您的指點。

答案1

您可以使用transport_maps

relay_domains = olddomain.com, newdomain.com
transport_maps = /etc/postfix/relay_maps
recipient_canonical_maps = hash:/etc/postfix/recipient_canonical

/etc/postfix/relay_maps

[email protected] smtp:[ip.of.local.exchange]
[email protected] smtp:mx.newdomain.com
[email protected] no-reply

/etc/別名

no-reply: /dev/null

/etc/postfix/recipient_canonical

[email protected] [email protected]

注意:必須建立本機使用者no-reply

相關內容