问题原文
原帖链接 · George Adjei · CC BY-SA 4.0
Here is what I want to accomplish with postfix: we do frequent copies of our production system that sends mail vendors, users, etc. Occasionally after the copy, our technician forgets to turn off email sending so the test system starts sending out email to vendors etc causing confusion. To prevent this I have asked our exchange team not to relay any mail from non production server. However, we still need to be able to test from our development and QA systems so I setup postfix as a relay server for all the other system but I want to make sure postfix only delivers to a small list of developers and testers. This way no rogue or unintended mail gets to an unintended recipient. So in effect, reject ll mail except to people on a list. I have tried various restrictions but have not seen any that achieve what I am trying to do. I am hoping some one can help. Thanks.
已采纳解答
原帖链接 · Esa Jokinen · CC BY-SA 4.0
It's possible to do this with Postfix transport(5) (using transport_maps).
[email omitted] :
[email omitted] :
[email omitted] :
* error:You should not send mail from non-production servers.
Also, you could consider forwarding all mail from this test network into a shared mailbox for the developers and testers. This way your technicians won't have to remember changing the addresses at all, reducing their workload. I assume this Postfix server is just an SMTP gateway for your test network and has no other purposes. In this example, you can forget the transport_maps and use virtual_alias_maps, instead:
virtual_alias_maps = regexp:/etc/postfix/virtual-regexp
Then, add a wildcard regular expression for every address in /etc/postfix/virtual-regexp:
/.+@.+/ [email omitted]
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
