Monday, October 28, 2013

Filter all recipients with Postfix and Sendmail

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 recipients then don't save, otherwise save.

to  :

to  :
cc  :

to  :,

to  :
cc  :

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
Now it's time do make some conditions and exceptions for our case. First we need to define condition which will match all messages, we can use Message Sender condition with asterisk as a value.

Exceptions should skip messages which are addressed only to recipients. If at least one recipient is not then attachments should be saved. Select Message Recipient exception, it will search for * 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:

Thursday, October 10, 2013

Exchange Autoresponder - server side auto replies

MSH Exchange Autoresponder is transport agent extension that allows you to create server side auto responses on the basis of configurable criteria.

With administrative desktop application you will create and manage auto response rules, like common auto reply messages, vacation e-mails, marketing or support auto replies.

Administrative desktop application which helps with creating auto reply rules.

Compose Auto Reply Messages

You have control over auto reply subject, body content and additional custom message headers. Subject and body content support Active Directory variables so each auto reply message can be personalized based on an auto reply sender.

Advanced Time Scheduling

Use multiple options in which an auto reply rule will be active. With this functionality you can create rules which will send auto replies all the time, only on holidays, Christmas or specified hours.

Forward Message to Another Mailbox

Autoresponder rule can send forward to your assistant when you are out of office. Changing the subject of forward is very useful when you want to distinguish it from original message.

Protect Against Loops Between Servers

When other auto reply software not follow the standards there is a possibility to create a loop between servers. This is very dangerous situation when two servers non stop sends auto replies to each other. With this protection you will define how many times application will send auto replies in specific period of time (ie. in an hour, day) to the same recipient.

Change Autoreply Sender Address

When email is sent to specific user, auto reply can be sent from group.

Integrate with Active Directory

Application can integrate with Active Directory, so auto replies can be personalized with data from directory service.

To learn more visit MSH Exchange Autoresponder website.

Tuesday, September 24, 2013

Zimbra email disclaimer and signatures

Email disclaimers aren't a problem when they're simple, but when we want them to be more sophisticated it's a pain in the ass. Appending simple text to message is not enough for our bosses, marketing department, company compliance and our customers - they need something more.

Many "solutions" for adding signatures don't work out of the box, they're complicated and have weird configuration. They're only workarounds for a real problem. Solution is simple - use software designed for adding disclaimers and signatures to any type of messages.
  • What you cannot do with common tools on the market: 
  • skip adding another disclaimer if already present in the message 
  • add different disclaimer per domain or group 
  • set time range to use different disclaimer on the vacation and Christmas 
  • and so on... 
This milter extension for mail servers, like Postfix, Sendmail and Zimbra it's a sophisticated application which works in the background and does heavy duty email processing.

Message in Thunderbird with appended disclaimer

To learn more read full article about disclaimers with your mail server.

Wednesday, September 4, 2013

Out of Office Assistant 1.2 released

We're happy to announce that we've released a new version of MSH Out of Office Assistant for Postfix and Sendmail.

Assistant is a solution which extends your MTA with client side auto replies. It's integrate with Thunderbird and gives a possibility for end user to set an auto reply when he is going on vacation.

Administrator application can manage all settings regarding OOF users state, it can be useful for admins, receptionists, managers etc.
Application seamlessly integrate with Thunderbird. It gives possibility for users to change OOF state from own mail client.
In this version we've added access control functionality to prevent from unauthorized access to server. Administrator now can define which users could connect to server and change settings.

Learn more about MSH Out of Office Assistant.

Thursday, July 11, 2013

Delete recipient when message is sent from specific domain

Imagine that you want to block message to one of your employee, but only if email is from specific domain. You cannot use Block Message action because it would block message also to other recipients. Better solution is to use Remove Envelope Recipient action which silently remove email addresses.

After quickly defining new rule, we go straight to the actions, choosing Remove Envelope Recipient action from menu.
Remove Envelope Recipient menu

Envelope recipient(s) can be deleted by wildcards, regular expression or plain email address. I'll call my unlucky guy jeff at
Remove Envelope Recipient action

Now Message Sender condition is needed, because we want to take down recipient only from messages which were sent from i.e.
Message Sender condition

So, after those two simple steps from now Jeff will never receive any email from

Maybe you have some other ideas how to make life more "happier" for your employees? Try MSH Traffic Policy, it's powerful tool for Sendmail and Postfix.

Friday, May 31, 2013

Limit the number of emails sent by users

The MSH Traffic Policy have ability to to track how many emails are sent by particular user.

To enable this feature use Message Count Based on Sender action.

This condition will be true when user john.doe@server.local will send more than 200 emails per day.

When condition is defined it's time to create action which will be invoked when emails count reach limit. Block Message action with custom message for sender.

After these simple steps, user will be able to send only 200 messages per day.

Learn more about MSH Traffic Policy.

Tuesday, May 21, 2013

How to forward certain emails to another mailbox

If you have scenario where you need to forward some messages based on something else than bare Postfix and Sendmail 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

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, see full list of 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.


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

Learn more about MSH Traffic Policy server side rules.

Wednesday, May 15, 2013

MSH Disclaimer & Signatures 1.0 released!

MSH Disclaimer & Signatures is a Postfix and Sendmail milter which add disclaimers to all types of messages: html, plain text, incoming, outgoing, per domain.

With administrative application you will create rich text disclaimers and signatures. Templates can be added based on sender, recipient, header, keyword or time range.

Compose templates editor

Add Disclaimers

Create server side, centralized disclaimers for all or only specified messages. Add signatures to outgoing emails and prevent from adding another one. Use built-in HTML and Plain Text compose editor to create rich text disclaimers.

Prevent duplicates

Skip adding another disclaimer if already present in message.

Disclaimer Compose Editor

Use simple WYSIWYG html and plain text editor to create rich text disclaimers.

Visit official website and improve your company emails.

Wednesday, May 8, 2013

Zimbra, Postfix, Sendmail: Add disclaimer per user, per domain, per anything

With this application you'll improve your email experience a lot. Are you using Sendmail, Postfix or Zimbra? If yes then this software is for you.

Append HTML and Plain Text template disclaimers to all users or only per domain, the server side disclaimers are now here. With this release simple html compose editor is included to make better experience with application.

At first I will show result from automatically added signature to the email. Below is a screenshot from Thunderbird mail client. I did sent message in html format, so mail server plug-in could add html template. The grey "warning" part is my earlier created disclaimer.

Mail disclaimer added to HTML message

So, the most important thing is to create template which will be used as disclaimer. Editor can create HTML and Plain Text templates, they are used in messages in all formats. Compose editor support basic function to create html template, like: font family, font size, bold, italic, underline, text color and hyperlinks.

Signature Disclaimer template html and plain text compose editor
After that, we need to define conditions. I'll use simple Message Sender requirement for this, but application provide a lot of different conditions and exceptions which can be used to determine if disclaimer should be appended or not.

If needed footer will be added to all emails 

The best way is to define requirement which will prevent from adding another disclaimer to the message - Message Keyword Searching exception.

Those simple three steps will take into action centralized disclaimers for your mail server. With different requirement many - even complex conditions can be achieved:

  • add disclaimer only to specified users, 
  • only to outgoing messages, 
  • per domain,
  • with special header,
  • almost anything.

MSH Disclaimer & Signatures support Zimbra, Postfix and Sendmail, it's easy to install and configure, and creating a new disclaimer template is a lot of fun. Try it for free.

Tuesday, April 30, 2013

Limiting the maximum number of recipients per message

In real life there are situations when we need to block message or move all recipients to BCC field if it have too many recipients in TO and CC field. When unaware or simply by mistake user sends a newsletter e-mail to all customers and puts them in TO field, it will be a scratch on company reputation. Or, if you send a job announcement to multiple people, you may want to use BCC to keep the identities of the potential job seekers private.

With Message Recipients Count requirement and Block Message action or Move All Recipients to BCC field action those situations will never happen. This requirement will count recipients per message, user, domain or any other condition based on message properties. See all conditions and exceptions.

Limit the number of TO, CC and BCC recipients
To set restrictions for all, incoming or outgoing messages in Postfix and Sendmail the best way is to choose search in TO and CC field. It will count recipients skipping the BCC field. When number of email addresses are reached the actions will be taken.

Good policy is to block the message and inform sender about the reason why it was blocked. Block Message action have option to customize the message which is delivered to sender.
Define custom reject message while connection.
Better and more elegant way than blocking message is to Move All Recipients to BCC field. It will prevent sharing the e-mail addresses with persons which should not see them.

This action is simple. No options or configurations need to be done.
Prevent recipient names from showing by using Bcc
Keep the recipient list private. Bcc can help you to be respectful of others' privacy by keeping them in the loop without disclosing their identities.

Learn more about policies which can be applied with MSH Traffic Policy to your mail server.

Tuesday, April 23, 2013

MSH Out of Office Assistant 1.1 released!

What's new:

  • support for aliases
  • wildcard and regular expression matching exceptions pattern
  • extended loop protection interval values
  • added milter_default_action=accept entry in Postfix configuration file
  • more configuration parameters in install script
  • fix: in loop protection some messages was wrongly counted

With MSH Out of Office Assistant you will extend Postfix and Sendmail with client side out of office replies.

Tuesday, April 16, 2013

MSH Traffic Policy 1.2 released!

MSH Traffic Policy Administrator image What's new:
  • move all recipients to BCC field action
  • count of recipients requirement
  • advanced variables in conditions, exceptions and actions
  • message body keywords searching requirement
  • message size requirement
  • wildcard and regular expression searching/matching pattern
  • message counting based on sender or recipient requirement
  • more configuration parameters in install script
  • added milter_default_action=accept entry in Postfix configuration file
Small fixes:
  • when email was sent with only html mime part, plain template was added instead of html in attach strip action 
  • xml parser was reading wrong attach strip action node

MSH Traffic Policy is a heavy duty machinery for message processing, its works as a milter with Postfix and Sendmail.

Tuesday, April 9, 2013

Check more than one message header at time

With built-in option to check all or any conditions you can check more than one header at time. Multiple headers can be checked with logical AND or OR parameter.

I'll add two headers with value checking. In the first one I will use Wildcards when matching Content-Type value. In the second one I will use Regular expression to match User-Agent header value.

Now when both conditions are added, one from two option must be selected:

  • All conditions must met
  • Any condition must met

When defining mail server rules use various message conditions.

When All conditions must met option is selected then both header conditions must be met. So when message will not have those headers rule will be not executed.

When Any conditions must met option is selected then any header may be present in message.

Learn more about content control and flow shaping with Postfix and Sendmail.

Wednesday, April 3, 2013

Stripping/detaching attachments from messages

In MSH Traffic Policy, you can use attachment filtering to apply filters at the server level to control the attachments that users receive. Attachment filtering is increasingly important in today's environment, where many attachments contain harmful viruses or inappropriate material that may cause significant damage to the user's computer or to the organization.

This milter will remove attachments from the email messages and replace them with links to the attachments on ftp or network drive, allowing easy access to files while keeping mailboxes smaller. Bare Postfix and Sendmail not provide this functionality out of the box, third party tool is needed.

Application provide Strip Attachments action which allows extracting any attachments from the incoming messages and save them to shared location. Filtering can be based on file name, file extension, mime type, file size or attachments count. You can delete attachments from all messages or only from emails specified by  scope of senders or recipients.

Built in attachments processor will skip digitally signed, encrypted and rights protected e-mail messages. If exporting attached files is not necessary then other actions can be used: 
  • block whole message and attachments
  • delete attachments but allow message through
  • silently delete message and attachments
  • reject email message

Using Strip Attachments action

Before we create our rule, template notification is needed. We can create the template in HTML or Plain Text format.

Select Templates tree node and click Add button. In template definition window provide name and body template, in HTML format provide html source code. In template body $MSGID variable can be used, it will be replaced with message identifier, it is used when creating separate directories for attachments.

After adding two template formats you will have result like this (Attachments Stripped html and plain text entries).

Now we can create our rule for archiving messages on network disk. Create rule group and add new rule. On Actions tab click button Add and select Strip Attachments action.

In Directory path field provide absolute path on server where to automatically save attachments. I.e /var/attachments. From Plain Text and HTML template choose our previously created templates. Click button OK.

On Conditions tab click button Add and choose Attachments count requirement. Provide your values. I have used grater or equal to 1 condition.

With this condition from all messages outgoing or incoming attachments will be stripped. So for real life scenario it is good idea to define other conditions, like detach attach only from incoming messages. See full list of available conditions and exceptions.

Define rule name and click button OK. Save all settings and you are ready to test rule.

Testing rule

Send from one user to another test message with couple of attachments. Below you will find result from our example. When recipient will click on provided link he will be redirected to our provided location (of course it should be configured as ftp or network share).

So if you need to remove, strip, detach, delete, dump attachments and insert advisory notice into message for recipient then MSH Traffic Policy will do it for you.

MSH Traffic Policy is a sophisticated heavy duty machinery for email processing, try it.

Wednesday, March 27, 2013

Conditional always_bcc only for outgoing messages

Sometimes there is a need to clone all outgoing or incoming message traffic and forward it to specific mailbox. When using Postfix always_bcc configuration parameter can be used, with Sendmail external milter is needed.

Solution for Postfix have pros and cons, as it name says it will add BCC sender to ALL emails without exception, you cannot specify certain mailboxes or monitor only outgoing messages. It will even match bounce messages.

If you need add blind carbon copy per domain or skip specific e-mail address you need to use third party milter. With MSH Traffic Policy automatic bcc based on rules is easier than you think.

For our example I will assume than our internal domain is This will let us to create rule which will behave like conditional always_bcc functionality.

Create new rule and begin with Add Envelope Recipient action. This will work as "add bcc recipient" because we will not add BCC header to message, so it will only have envelope recipient, which is not visible to the end recipient.

Provide email address for mailbox to which you want to forward all messages.

Next you need conditions which will match messages. On Conditions tab select from Add button Message Sender condition. 

For our scenario we assume that we want to add BCC recipient to all outgoing messages. 

Use name of your domain, so to each message which will have sender from BCC will be added (with email address with our example).

Good idea is to exclude email address which receive all messages, so on Exceptions tab add Message Sender exception and provide address.

On Name page provide name for you rule, i.e always_bcc, click OK button.

Save All settings on main application window.

See all conditions which have MSH Traffic Policy, because with them you can create sophisticated rules which match any messages you want: with certain attachments, specific subject or message size.

Sunday, March 24, 2013

Send an auto reply and forward original message to another mailbox

It is a common situation when you are using an autoresponder you want to forward received messages to another account.

I.e. some company could have support mailbox with an auto reply and need to redirect original message to attendant who is responsible for manage supports cases.

MSH Autoresponder can accomplish this task with forwarding build it functionality.
Autoresponder Rule Wizard - Forward page
Configuration is simply, when you want to forward all incoming emails you need to select Enable forward option. Provide in field To email address of user which will receive all mails. In Subject field you can change original message subject to something which will distinguish our forward from original message. In this field variable $SUBJECT can be used which will be replaced with original message subject.

If redirection to multiple mailboxes is needed then email addresses can be separated by comma.

Saturday, March 16, 2013

How to send auto replies only on weekends?

New advanced time scheduling options in MSH Autoresponder 1.3 will give you a better experience with time settings.

Take a look.
Advanced Time Schedule - auto replies for Postfix and Sendmail
Advanced Time Schedule - auto replies for Postfix and Sendmail
Old time range settings now are split and we have global time range and hours range. With this change you can set auto reply to be sent all day long or with a simple From-To hours range.

The new feature is Daily pattern option which give you a possibility to set active rules only at particular days in week.

If you want to sent auto replies all week then option No pattern must be selected but when you're out of office at weekends then Daily pattern comes for the help with Sunday and Saturday option.

Check this new feature and your autoresponses will be like never before.

With those features which MSH Autoresponder have you can throw away vacation and forward scripts to bin and never look back.

Tuesday, March 12, 2013

Automatic add attachment to message

If you need to simply add some attachment to every or only to specified message (like from specified sender, recipient or by message subject) try this. MSH Traffic Policy with Add Attachment action will be best solution for this scenario.

When you have defined your condition (see all available options), choose Add Attachment action from menu.

New window will be open. Provide an absolute path to file which is located on server. In our example I'll use /usr/attachments/brochure.pdf file.
Add Attachment with Postfix and Sendmail

After saving changes, to all messages which are matching conditions brochure.pdf attachment will be added.

Saturday, March 2, 2013

MSH Out of Office Assistant for Postfix and Sendmail

MSH Out of Office Assistant is solution which extends Postfix and Sendmail functionality with client side auto replies.

Mail Client Extension

Mail client extension seamlessly integrate with Mozilla Thunderbird.
MSH Out of Office Assistant in Mozilla Thunderbird photo

Central OOF Administration

Administration application provide central management of server settings and users out-of-office assistant settings. Loop protection and prevention of sending auto respond to mailing lists or spam settings can be easily configured with it.
Server administration over out of office user settings.

Application can be used for FREE up to 15 end users.

Tuesday, February 26, 2013

How to add custom header to outgoing messages

I'll demonstrate how to add headers to an email in Postfix. If you want to ONLY add custom header to all messages you might use ACCESS and PREPEND, see Postfix documentation for details.

But what if we assume that our custom header must be added only to outgoing messages and only if there is no one already? Unfortunately you cannot do this with bare metal MTA.

The best and easiest solution is to use MSH Traffic Policy milter.

Our first condition is to check if there is already a header in the message. Message Header condition will scan message for our X-Header. It have four options for matching headers - we need not have Header condition type.

Second conditions is to match only outgoing messages. If your domain is then insert * value into Message Sender condition. This will filter only messages with internal sender.
The last element is to check if All conditions must met option is selected.

We have defined conditions, now it is time for actions. Add message header is what we looking for.
After these steps we have configured rule which will: Add custom header to all outgoing messages, but only when header does not exists.

Learn more about MSH Traffic Policy.