Introduction

Few documents except the ones that come with Sendmail's Opensource source code try to introduce Milter and offer some detailed list of available Milter based solutions.
This document try to address this need (the sendmail team welcome help and contributions).

What's Milter ?

Sendmail is one of the most popular SMTP MTAs. It is very configurable through some defines, features and rulesets. However for quite a long time for content analysis/messages modifications of SMTP messages and complex needs (spam & attachment filtering, custom logging, disclaimer addition, virus scanning ....) you had to either :
Some better and easier solutions were really needed.
In order to make it easy to write some Sendmail filters, the Sendmail team has developed some API called Milter (Mail Filtering API) which was first implemented in versions on 8.10.x, then improved in 8.11.x as some FFR (For Future Release) code and officially supported since 8.12.x.
This content Management API can be used on on any OS that supports threads and was devised with the following goals :

How do Milter filters and Sendmail communicate ?

Basically, Milter filters communicate with sendmail using (local or remote) sockets and can read/alter the messages (body, headers) going through the sendmail MTA.
Using a Milter solution is really easy : just declare it in your sendmail.mc and rebuild a new sendmail.cf. As you can see on the sendmail.org pages you just have to add some instruction such as :
 INPUT_MAIL_FILTER(`filter1', `S=unix:/var/run/f1.sock, F=R')
to mention you want to use a Milter called filter1 through the Unix socket namely /var/run/f1.sock
You can run several Milters based on your needs run in some sequential order.
Of course, make sure you start your Milter filter(s) first and then Sendmail.
Using Milter that add/change headers or alter the body will generate in a lot of messages being logged in the sendmail's log. You can reduce the milter logging by using :
confMILTER_LEVEL
in your sendmail.mc (use 6 for instance instead of the default : 9) As you can see on Sendmail's tweaking there are other MILTER options you can use in your sendmail.mc :
confMILTER_MACROS_CONNECT
confMILTER_MACROS_HELO
confMILTER_MACROS_ENVFROM
confMILTER_MACROS_ENVRCPT
which can be used to communicate some sendmail's Macro to Milter programs. Using sendmail's macros in Milter can be usefull to bypass some filtering in some cases (authenticated users or networks). New features related to Milter will appear in sendmail 8.13 some of which are available for testers as FFR : FFR_MILTER_PERDAEMON for instance makes it possible to define some Milters through some DAEMON_OPTIONS hence making it possible to bypass running some Milters for some IPs/ports/MSA .

Milter : API details, Languages are supported ?

Sendmail is written in C so it's no wonder that the Milter API is some C API
However thanks to many open-source people/some commercial companies it is also possible to develop Milter filters in : You can find on www.sendmail.com some initial information about the API.
Updated information can be found in the latest sendmail tar in the libmilter/docs directory

Which Sendmail versions to use for Milter, OS considerations ?

Between the sendmail 8.11.x and 8.12 series, Milter has been vastly fixed and improved Check these links for reasons for using the latest sendmail version :
Getting the latest Sendmail running is easy on some Operating Systems (FreeBSD,some Linux distributions such as PLD, Debian keep their packages up to date). If you can't find some package for the latest sendmail version for your operating system, ask your Unix/Linux vendor so they release new packages. Of course You can also compile sendmail by hand (so it includes only the features you want).
Just make sure your site.config.m4 contains :
APPENDDEF(`conf_libmilter_ENVDEF', `-DMILTER')
APPENDDEF(`conf_sendmail_ENVDEF', `-DMILTER')

It is not recommended to run Milter filters as root. As written in libmilter/README (one of Milter's must read documents along with the libmilter/docs HTML pages), libmilter does not require this to communicate with sendmail. It is therefore wise to put :
APPENDDEF(`conf_libmilter_ENVDEF', `-D_FFR_MILTER_ROOT_UNSAFE ')
in your site.config.m4
To make sure your sendmail binary is compiled with Milter support just run :

Milter & other MTAs ?

Milter is some sendmail's enhancement published under BSD license. The Milter API is documented and this API can be implemented in another MTA. Theoricaly, using Milter with other MTA (Qmail, Postfix, exim) would imply : Some other people would rather re-implement the protocol between libmilter and sendmail. This underlying protocol is currently not documented (except comments in the sendmail source code). It is furthermore internal hence subject to changes. An attempt to reimplement Sendmail's Milter protocol in pure Perl however does exist : PMilter. Its author has documented the "Milter protocol".

Milter Products List : Opensource vs commercial 1/5

Opensource vs solutions Milter products listed in this document are classified as commercial or open-source solutions. For each solution the URL and the following information is specified : Few Milter solutions are multi-purpose ones : most of them try to address one given need (virus-scanning, antispam, ...). Remember you can use several Milters (several INPUT_MAIL_FILTER definitions in the .mc file) if a single one does not offer all the features you need
Most commercial Milter solutions are antivirus filters : virus vendors have adopted Milter quickly. Which solution is to be used ? It all depends on your needs, knowledge, time and money. Contact the author/company or use the proper mailing-list/newsgroup to check that the Milter solution you noticed will be appropriate.

Milter Products List : Opensource vs commercial 2/5

Opensource solutions

[MIMEdefang] [j-chkmail] [Python Milter] [Sendmail::Milter]
[libmilter++] miltrassassin [noattach] [spammer] [amavis] [amavisd-new] [avpmilter] [vbsfilter/cvgfilter] [vilter] [rblmilter] [milter-virus] [spammilt]

Milter Products List : Opensource vs commercial 3/5

[spasm] [SpamAss-Milter] [sentinel] [Ray's filter] [IVS Milter] [MilterQuota] [MailCorral] [milter-sender] [bogofilter-milter.pl] [clamav-milter] [synonym] [Sccmilter] [milter-spamc] [mailspy] [relaydelay] [milter-regex] [milter-date] [milter-size] [smtp-vilter] [Mediater] [Milter-DNSRBL]

Milter Products List : Opensource vs commercial 4/5

[milter-7bit] [milter-greylist] [milter-regexp] [milter-ahead] [sendmail-milter-spf.pl] [spamilter] [spamassassin_milter] [milter-gris]

Milter Products List : Opensource vs commercial 5/5

Commercial solutions

Sendmail Anti-virus Filter from McAfee [Sendmail Attachment Filter v2] [Sendmail Message Appender] [Sendmail Message Copier] [Trend Micro Interscan Sendmail edition] [Activestate PureMessage] [CanIt] [ScanMail] [GeCAD Ravantivirus Sendmail Milter edition] [Symantec CarrierScan] [Brightmail] [Central Command VEXIRA] [Dr Web] [H+BEDV AntiVir Milter] [f-prot Antivirus for Linux/BSD Mail Servers] [Mailshell SendmMail Plug-in] If anybody has additional links/product names or have comments , you can mail me.

Resources

Milter related: Pure sendmail links : Antivirus :

Feedback

is really welcome. Send new links, corrections, suggestions.
Changelog: Ideas : move to OpenOffice 1.1 or Docbook, classify Milter solutions in alphabetical order, detail each solutions, ....
This document is currently produced through Plies on some PC running FreeBSD and Cygwin.

Support Sendmail, FreeBSD and Milter of course.


Plies Vim