I want to redirect messages with postfix if they are sent from a specific sender. The redirect should be visible in the To:
field. For the redirect I tried to use this header_checks
rule:
/^From:.*[email protected].*$/ REDIRECT [email protected]
This works and the message is redirected to [email protected]
. But the To:
header still points to [email protected]
. How can I change the To:
header as well?
To be more specific:
The system is sending mails from different senders to different targets and I only want to redirect one of them.
Here are some typical combinations of from/to pairs that happen on this server:
From: [email protected] -> To: [email protected]
From: [email protected] -> To: [email protected]
From: [email protected] -> To: [email protected]
I only want to redirect [email protected] -> To: [email protected]
to another target and change the To:
field as well. The others should remain the same. How can I do this?
If I add another header_checks
rule to match To: [email protected]
then it will also change the To: field for sender2.
Related Questions
Postfix: how to redirect a single email address depending on the sender
This deals with how to do a check based on the recipient. I don't care about the recipient, I want to always change the To: field.
conditional rewrite of mail from matching recipient domain in postfix only deals with the From: field
postfix rewriting sender with generic & header_check again, only deals with the sender