0

i have a postfix MX and i need to make the following logic:

if a message arrives with aaa@example.com in the rcpt to header, then i need to change the from header to bbb@example.com.

any suggestions?

i read on canonical maps and to my under standing the maps allow you to change the recipient address if it matches or change the sender address if it matches. but not change the sender address if the recipent address matches.

thanks in advance

Oferzi
  • 11
  • Please *try* the canonical maps *first!* then report back if you have a problem with that solution – masegaloeh Feb 05 '15 at 10:21
  • i already tried canonical maps as i said it does not allow to change a senders address based on a recipients address. that was the reason i came here. – Oferzi Feb 05 '15 at 12:10
  • Okay, I'm sorry for misunderstanding. In the question, you state that you have *only read* about it, but haven't tried it. – masegaloeh Feb 05 '15 at 12:32

1 Answers1

0

Postfix doesn't have a specific feature to rewrite the sender based on the recipient.

Anyway, you can try a workaround here and here to accomplish your goal. You can use a transport_maps and smtp_generic_maps. Unfortunately, due the nature this will replace all recipient and sender address.

masegaloeh
  • 18,236
  • 10
  • 57
  • 106