Postfix - If To: address is $x. Change From: adress to $y

Hello, hopefully somebody can give me a clue on how to do this.

Right now I have emails coming from company1-alert@company1.com to distribution@ourcompany.com.

I want to set up something in Postfix so that if the email is going to distribution@ourcompany.com, the From: address is automatically re-written to support@ourcompany.com.

That way the people on distribution@ourcompany.com will see the email coming from support@ourcompany.com instead of company1-alert@company1.com.

Any clue on this or where to start would be helpful! Thanks!!!!

it would be much easier and more convenient to everybody involved if you just reset the sender field when you run your mail command ... see man postfix and man mailx -- look for discussion on -r option ...

echo "your message here" | mailx -s "your warning" -r sender@some.com  $admingroup@some.com

Thank you but the problem is I don't have control over sending the alerts. They are alerts from another company.

I ended up using sender_canonical_maps to re-write the field.