Tuesday, August 23, 2016

Delete Files Older Than - Run from the command line

If you need to remove files on schedule you can run the application without the GUI interface.
The application support -f command line switch to run rules in the background, for example:

"<PATH>\MSHSoftware.DeleteFilesOlderThan.exe" -f c:\settings.xml

where settings.xml file is created from Options | Export rules menu.

If you would like to automatically generate CSV report you should use -o parameter, like below:

"<PATH>\MSHSoftware.DeleteFilesOlderThan.exe" -f c:\settings.xml -o c:\reports

Learn more how to run application on schedule.

Output from --help parameter:

MSH Delete Files Older Than 1.3.0
Copyright (C) 2017 MSH Software
Usage: MSHSoftware.DeleteFilesOlderThan.exe -f settings.xml -o c:\reports\
  -f        Settings file path.
  -o        CSV reports output directory path. Optional, should be used only
            with -f parameter.
  --help    Display this help screen.

Monday, May 16, 2016

Send auto replies only to external recipients with Exchange Server autoresponder

Auto reply will be send:
  • Only to external recipients. 
  • Only when message is sent to support@domain.com. 

NOTE1. You don't need Microsoft Outlook! Just Microsoft Exchange 2007, 2010, 2013 or 2016.
NOTE2. Replace @domain.com with your domain.

1. On the main application window, click Add button.

2. Enter name of the newly created rule. To confirm click OK button.

3. On the Auto Reply tab change Subject line.

4. Switch to the Template tab. Put the content of your auto reply.

5. Switch to the Conditions tab.

6. Click Add button and choose The recipient address includes menu.

7. On the Email address pattern line, enter support email address. Leave other options unchanged. Click OK button.

8. Switch to Exceptions tab. Click Add button and choose The sender address includes menu.

9. From the Match using option, choose Wildcards position. On the Email address line, enter your domain name with asterisk (*) at the front. Click OK button.

10. Switch to Rule Name tab. Make sure that Enable rule option is selected. Click OK button.

11. Your auto reply rule is ready.

Visit MSH Exchange Autoresponder website for more information and details.

Wednesday, May 11, 2016

MSH Exchange Autoresponder 2.0 released

We have just released MSH Exchange Autoresponder 2.0 version. It has several new features and couple of fixes.

Below is a short list of changes:

  • Global exclusions (blacklist)
  • Html source view in template designer
  • Insert hyperlink preview
  • Import template option
  • Import license key from the application
  • Import/export application settings
  • Whole new options window
  • Completely redesigned autoreply wizard page
  • And fixed several minor issues.

So if you are looking for server side auto replies (without Outlook) on Microsoft Exchange 2007, 2010, 2013 and 2016 visit our website and try the application for free for 30-days.

Friday, February 26, 2016

How To Forward Email to Several Recipients

In the previous post I described how to configure MSH Traffic Policy milter application to redirect messages to another recipient based on the message subject. Today I will show how adjust actions to forward an email message to several persons, not only one.

Please refer to the linked post how to create a rule and define conditions, in this post I will only modify actions.

Modify Forward Action 

Edit already created rule. Select rule and click Actions button and select Edit menu. Add second envelope recipient to the message, click Add button and Add Envelope Recipient menu. Put jane.smith@soft.com email address in the address field. Click OK button.

From the list select Add Message Header entry and click Edit button. In the Header Value field put ;jane.smith@soft.com email address. Don’t forget about semicolon, it’s needed because we add another email address to the MIME header. Click OK button.

Click OK button to close the rule wizard and click Save All button to preserve changes.

Now when a message will match conditions it will be forwarded to two recipients. They both will receive a message as carbon copy recipients.

Check what else could be done with MSH Traffic Policy for Zimbra, Postfix and Sendmail…

Monday, February 22, 2016

Redirect/forward emails based on message subject - check two headers at time with Postfix

Below you will find a description how to redirect a message based on sender and subject. We will use MSH Traffic Policy milter application which integrate with Postfix, Sendmail and Zimbra.

After installing server and desktop module we can start to create a rule which will do what we need. 

Create a Rule 

Start the application and connect to the mail server. Select Rules node and click Add Group button. We need to add rules group which will contain our new rule. Name it like Redirect Rules. Select our new Redirect Rules node and on the right panel click Add Rule button. Rule wizard will open.

With wizard we will define actions, conditions, exceptions and rule name. With Actions we will redirect our message, conditions and exceptions will help us to match messages which should be redirected.

Define Conditions

We will begin with conditions. In our scenario we want to redirect messages which are sent from @xcomany.com domain and include INVOICE phrase in the message subject. The word "and" is important here, because messages which don't have INVOICE text in subject or are not from specified domain should go through without change.

Switch to Conditions tab, click Add button and choose Message Sender – Email Address menu. Select Wildcards from drop down menu option and put *@xcompany.com text in Email addresses text input. Click OK button.

Sender condition added, now is time for the message subject. Click Add button and this time choose Message Subject or Body contains menu. Select Subject option in Search from drop down menu. Choose Wildcards in Match text with option. Put *INVOICE* text in Word or Phrase text input. Click OK button.

At bottom of the rule wizard on Conditions tab select All condition met option.

Choose an Action

Go back to Actions page. Now we will define the action which should be taken on messages which will met our conditions.

To forward message we need to apply to actions on the message. Add Envelope Recipient and Add Message Header. It's because envelope recipient will only modify recipients address list without adding a MIME message header. Recipient will receive a message but he/she will not see own email address in TO/CC/BCC message fields.

Click Add button and choose Add Envelope Recipient menu. Provide an email address which should receive a copy of the message. For this scenario we will use john.doe@soft.com example address. Now click Add button and choose Add Message Header menu. Put CC text as Header Name and john.doe@soft.com in Header Value field. Click OK button.

We had defined condition criteria to match messages and actions which should be taken. Switch to Name tab, give a rule name, like Redirect Messages from @xcompany.com with INVOICE in subject. Click OK button to close rule wizard.

Save and Verify

To apply changes click Save All button.

Now when messages with specified phrase in subject and sent from @xcompany.com domain will go through mail server they will automatically be also send to john.doe@soft.com address. Original recipient of the message also will get the message.

Learn more about MSH Traffic Policy...

Thursday, February 4, 2016

MSH Disclaimer & Signatures 1.5.4 released

We've released a fix pack for our disclaimer and signatures software. Below you can find a list with changes added in version from 1.5.0 to current one:

  • More aggressive and customizable caching when querying directory services
  • Added several common reply separators
  • zimbraId replaced with uid in Zimbra ldap schema
  • Sometimes custom reply separators didn't worked
  • Convert message to template encoding option didn't work when encoding type was inside quotation marks
  • Additional conditions and exceptions in signature rules
  • Email address from header From is used to query directory services, when not exist envelope sender is taken
  • Pattern Exact Match was read as Wildcards from settings
  • Services didn't start at boot time when startup scripts were symbolic links

New update can download from our website.

Friday, January 29, 2016

Remove Old Files - Schedule It

In previous part one and part two I described how to create and export rules from MSH Delete Files Older Than application. 

In this part it’s time for auto scheduling. 

Application doesn’t have built-in scheduler so we need to use the standard one from Microsoft Windows. Open Start Menu | All Programs | Accessories | System Tools | Task Scheduler application. Click right mouse button on Task Scheduler Library and select Create Basic Task

Set task name, something like: Remove old files from C.

Create a Basic Task - Task Scheduler

Click Next button, I would like to remove files weekly, so select Weekly option and click Next button. 

Application should remove files on each Monday at 00:00 starting from 1st of February.
Weekly Trigger - Task Scheduler

Go to the next page and leave Start a program option, on the next page click Browse button and select MSH Delete Files Older Than.exe application. In arguments field put -f c:\data\settings.xml parameter. 

Last page will show you a summary information about your settings. Click Finish button. 

Now everything is set up and your operating system will be responsible of running the application on defined time. So if you want to keep your files organized take a look and visit MSH Delete Files Older Than web site.

Wednesday, January 27, 2016

Export Auto Delete Rules

In the part one I described how to create a rule to remove files older than 7 and 30 days. Main goal is to schedule this action to delete files once a day.

Before Windows built-in scheduler could be used we need to export rules from the application.

When application start click Options button and select Export Rules menu.

Save file as window will open.

Using save as window choose where to store rules.

By default filename will be settings.xml, it could be changed to something more meaningful. I will leave it as is.

Choose directory where exported rules will be saved, for example c:\data\settings.xml, click Save button. Rules are exported now.

In the part three we will see how to use scheduler to make an automatic deletion.

Monday, January 18, 2016

Delete Old Files and Remove Empty Folders

If you ever wanted to automatically remove older files than (n) days in multiple directories you probably struggle with batch and PowerShell scripts or even with manual deletion using explorer.

Sample scenario

We have the ftp server with users’ directories and one public directory so everyone could write to it. Users’ files should remain 30 days and files from public directory only for 7 days.

Empty directories should be purged.


Download MSH Delete Files Older Than, unzip compressed file, run the EXE application. No installation is needed.

Delete Files Older Than software after first run.

Click Add button to open Rule wizard. First we need to specify which folders should be cleaned, start with public folder. Click Add button then Browse and choose public directory. Select Include sub folders and Delete empty folders option.

Switch to Time page. Leave modification time option in Match files by criteria. Our directory should be cleared from files older than 7 days. Select Match files which are OLDER than 7 DAYS.

Switch to Files page. We want to remove all types of files, but if there will be requirement to remove only specified files, we could define which file names should be deleted.

Switch to Action page. Now we need to define what to do with old files. By default files are deleted permanently. We could also move them to recycle bin, move or copy to other directory and even compress while copying. Leave Delete files permanently option.

Switch to Name page. Change rule to name to something meaningful, like Remove files from public directory. Click OK button.

Now it's time for users' directories. Once again click Add button to edit new rule. Go through each page like when we were defining rule for the public directory. Just change 7 to 30 days on Time page.

Actions which could be done on old files.


In this post I tried to describe how rules could be created to delete files in different directories and with different time frame.

Defined rules can be now start manually by clicking Run button or scheduled to run automatically on defined time.

Monday, January 11, 2016

Postfix: Rewrite Message Subject Based on Recipient


Some time ago user had a problem because his company switched to a new email-to-fax service. They had a security implementation that require to append to each email sent to them a fax number. Number must be added at the beginning of the message subject. He wanted to automate this step so users don't need to remember and manually add number to subject.

So the requirement is that messages which are sent to fax@super-service.com must have subject in format:

123-555-789: Message subject.

Where Message subject is an original message subject before modifications and 123-555-789 is a fax number.


We need to create a rule with Message Recipient condition and Modify Message action.

  1. Go to [Server] > Rules > Default Rules and click Add Rule button. 
  2. In new opened window, go to Actions tab and click Add button, choose Modify Message Subject menu. 
  3. Now define how subject will look like after rewrite. Based on our requirement is should be in 123-555-789: $SUBJECT format. Were $SUBJECT is a value which will be replaced with message subject. 
  4. Go to Conditions page and click Add button, select Message Recipient menu. 
  5. Enter a recipient email address: fax@super-service.com. Select in which fields address will be searched. 
  6. On the Name page set a rule name, it should be a name which briefly describe actions made by this rule, for example: Modify subject for fax service
  7. Click OK button, then Save All to save current settings. 
Rule wizard provide many variations of actions, ie. Modify Message Subject.


Now when someone will send a message to fax service email address to the message subject fax number will be added.

MSH Traffic Policy is a milter application for popular mail servers which extends theirs mail flow. To learn more about MSH Traffic Policy for Zimbra, Postfix and Sendmail visit official website.