Change the subject line for specific recipient

There are many ways to modify the message subject in Postfix based on the message recipient, but the simplest way is to use a milter, like MSH Traffic Policy. This software can do a lot more than change and rewrite the subject; you can: take care of attachments, block spam, manage message headers and many more.

So let’s 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 $SUBJECT variable.

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 john.doe@host.local) 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 john.doe@sendmail.local and then click OK button.

When you create a new rule click Save All button and you are ready to test your configuration.

To learn more visit MSH Traffic Policy website.