There is many ways to modify the message subject in Postfix and Sendmail based on the message recipient, but the simplest way is to use milter, like MSH Traffic Policy. This software can do a lot of more than change and rewrite subject, you can: take care of attachments, block spam, manage message headers and many more.
So lets see how to create a simple rule to modify the message subject.
Add new rule by clicking Add Rule button.
When rule wizard will open, on Actions tab click Add button and choose from menu Modify Message Subject position.
Define a new subject for the message, if you would like to add the original message subject use
If you would like to rewrite subject only for one user then on Conditions tab click Add button and choose Message Recipient position.
Enter recipient email address (like firstname.lastname@example.org) and choose in which field to search for this recipient. We would like to change the message subject when our defined recipient is in TO or CC field. So select in Search address field in TO and CC field option.
On the Name tab define name for new rule, ie. Rewrite subject for user email@example.com and then click OK button.
When you create new rule click Save All button and you are ready to test your configuration.
To learn more visit MSH Traffic Policy website.