问题原文
原帖链接 · riskop · CC BY-SA 3.0
I'd like to configure Postfix (on Ubuntu) to catch all email for all domain and store them locally.
I'd use it for testing. The application under test sends emails to random addresses ([email omitted], [email omitted], and so on), and I'd like to check these emails locally (thunderbird).
I already now that the following in main.cf forwards anyuser@mydestination to localuser:
local_recipient_maps=
luser_relay = localuser
But I'd like to forward anyuser@anydomain to localuser too.
What is the simplest Postfix configuration for this?
Thank you!
已采纳解答
原帖链接 · riskop · CC BY-SA 3.0
I've found another configuration which works: specifying "mydestination" as a regexp table which accepts any domain.
Main.cf:
local_recipient_maps=
luser_relay = riskop
mydestination = regexp:/etc/postfix/match_all_destination_re
match_all_destination_re (// matches everything, result is irrelevant):
// this_can_be_anything
I consider this solution more straightforward than Esa's "Overriding Postfix's built-in default transport:nexthop" solution.
Note that instead of the "regexp" table format you can use perl-compatible "pcre" format table also. That may result better performance (which is absolutely no concern in my use case). In that case, however you need pcre support in Postfix. The config in this case:
Main.cf:
local_recipient_maps=
luser_relay = riskop
mydestination = pcre:/etc/postfix/match_all_destination_re
match_all_destination_pcre (// matches everything, result is irrelevant):
// this_can_be_anything
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
