On my companies mail server there is a mail address email@example.com which sends a mail to every user which is useful for internal communication etc. I want to restrict this recipient to only allow mails from our mail server and reject any mail from outside to this address. What is the best way to do this in postfix?
A workaround is to change the Mailadress of each mail to
noreply@ so that these fast replies going straight into the void. You could do this through a header-check:
/^(To|Cc):.*firstname.lastname@example.org/ REPLACE To:email@example.com
I found a pretty simple solution: Use postfwd (postfix firewall daemon).
Create a rule:
sender_domain!=example.org ; firstname.lastname@example.org ; action=REJECT email@example.com only allowed for example.org addresses