MailScanner v5 standardization

Jerry Benton jerry.benton at
Mon Apr 25 06:31:33 UTC 2016

So I am working v5 now. I am trying to standardize everything across all NIX platforms. Apparently, we all can’t get along.

-- FHS layout

That /opt bullshit will be gone. This is the directory structure for every NIX:


Symlinks will be provided in /etc/MailScanner for the following items:

Custom perl modules:
/etc/MailScanner/custom -> /usr/share/MailScanner/perl/custom

/etc/MailScanner/reports ->/usr/share/MailScanner/reports

Same place. Every OS. Celebrate. 

-- Basic config file

I have a dilemma regarding the /etc/defaults/mailscanner or /etc/sysconfig/mailscanner or on FreeBSD ... I have no idea. 

The point being they are in different places on each OS. So, I am more than likely going to do this unless someone has a VERY compelling reason not to do this:


Same place. Every OS. Celebrate. 

-- init scripts

I am also coming across standardization issues on init scripts. Like everything else, no one can agree on anything. Debian uses "start-stop-daemon” and RHEL uses “daemon”. FreeBSD? No idea. The check_mailscanner script that checks to see if MailScanner is running and then starts it if it is not running uses MailScanner’s internal method of starting a daemon that is portable across all platforms. This is already in use on all packages on every OS. Very basic and very effective:

/usr/sbin/MailScanner /etc/MailScanner/MailScanner.conf

This starts the daemon using all of the settings from MailScanner.conf like “Run As User” and “PID File”. Life is easy and, more importantly, consistent. 

So unless someone has a VERY compelling reason for me to continue to try and Frankenstein a single init script to work on all platforms using the native methods, I am going to use the native MailScanner methods which will be a hell of a lot more predictable and consistent across all platforms.

-- who’s on first?

Name every MailScanner executable. You probably can’t, because I can’t. So all of the executables (except the primary /usr/sbin/mailscanner) will now be like this:


and so on …

If you want to know all of the MailScanner commands, type “ms-“ and hit tab and they all magically appear. Imagine that. Note that I do not care how compelling a reason you have not to do this. I am doing it. Deal. 

-- cron jobs

There are a bunch of different cron jobs depending on what package you are using. Again, I am calling bullshit. One cron job in /etc/cron.hourly and one in /etc/cron.daily that each point to a single file in /usr/sbin. The file will read your cron options from /etc/MailScanner/defaults and will be called like this:

/usr/sbin/ms-cron hourly
/usr/sbin/ms-cron daily

“hourly” runs your hourly cron jobs and “daily” runs your daily cron jobs. NIXs that have /etc/cron.hourly/ and /etc/cron.daily/ will have the appropriate scripts to fire the cron jobs placed in those directories. NIXs that don’t simply add the ms-cron commands to your crontab. 

Feel free to comment, but keep in mind MailScanner needs to be standardized. This will make development, bug tracking, packaging, and just about everything else a hell of a lot more manageable and cross-platform friendly. 

Jerry Benton

More information about the MailScanner mailing list