Forward certain emails to another mailbox

If you have scenario where you need to forward some messages based on something else than bare Postfix configuration, you need to use MSH Traffic Policy. It provide many conditions which can be used to match certain emails and skip those which not matters. Just a few what can be used:

  • Message sender, recipients and headers
  • Message recipients counts
  • Attachments name, type, size or count
  • Envelope sender and recipients
  • Based on message count

and many more.

Simple step by step configuration

Create new rule clicking Add Rule button.

On Action tab click button Add and select Forward Message from many listed actions.

When new window will open provide subject and recipient of forwarded message. In Subject field you can use advanced variables to distinguish message.

Now when action is defined go to Conditions tab and add Message Recipient condition.

You can choose Wildcard or Regular expression pattern when matching message recipient. Search in option will let to match specified message headers: TO, CC, BCC.

Switch to Name tab and provide descriptive name for rule. Click OK button.

Now make sure you have enabled your new rule and click Save All button to persist settings. Now all emails which was originally sent to jake@server.local will be forwarded to dave@server.local.

Summary

This was simple configuration where messages could be forwarded based on specified domains, mailboxes, message header or event time range.

To learn more visit MSH Traffic Policy website.

Lukasz is a software developer and owner of MSH Software company which builds email processing tools for Microsoft Exchange, Zimbra Collaboration Suite and Postfix. He specializes in server, desktop and web applications written in Java, .NET and C++.