Score:0

Postfix - redirect AND change the To: header

br flag

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

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.