I've heard several times that someone wants to block message, save attachments or add disclaimer only to one type of emails. To messages which are from/to specific group of people.
Example: save attachments from all messages but skip messages from one particular domain, so if email is sent only to @gmail.com recipients then don't save, otherwise save.
to : email@example.com
to : firstname.lastname@example.org
cc : email@example.com
to : firstname.lastname@example.org, email@example.com
to : firstname.lastname@example.org
cc : email@example.com
HOW TO DO IT? Use MSH Traffic Policy!
First we need to define new Save Attachments action. It needs absolute path to directory where files will be saved. Path supports advanced variables, so it's possible to build hierarchy of directories based on message properties. Attachments have variety of file names, for example "...dont wait.jpeg", if file will be directly saved to disk, on some system may not be available or will be hidden (first dot). Select "Replace first dot with underscore in attachment filename" option to prevent this, now attachment will be saved as "_..dont wait.jpeg".
|Save Attachments action|
Exceptions should skip messages which are addressed only to @gmail.com recipients. If at least one recipient is not @gmail.com then attachments should be saved. Select Message Recipient exception, it will search for *@gmail.com addresses using wildcards. Also regular expressions (regex) can be used to match more sophisticated pattern. Recipients must be searched in all fields TO, CC, BCC. Our exception must be true only if all recipients are matched, otherwise it should fail.
|Recipient email address pattern and searching options|
This is only one example of condition/exception matching message recipients. MSH Traffic Policy application offers many variety options to check/parse/match any message value (like size, type or attachments count) and with much more actions so that your work with email servers will be more fun.
Maybe you're looking for something different:
- Add company disclaimers to outgoing messages
- Advanced server side autoresponder
- Client side Out of Office autoreplies with Postfix