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 :
- call some external programs (through pipes in aliases or special mailers : perl script, procmail, maildrop, ....). Such solution could handle only local delivery or messages to local addresses..
- or use sendmail in queuing mode and parse the qf and df files with some program triggered on a regular basis (MailScanner approach)
- or use some special forwarding scheme : sandwitch architecture with several sendmail's instances : amavisd-new dual-sendmail set-up & first commercial antivirus approach)
- or alter sendmail's source code (use of the check_compat function) to add some extensions requiring recompiling sendmail. It was not dynamic and smooth.
Furthermore adjustments for each new sendmail releases could be needed (sendmail's internal code change)..
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 :
- safety/security
- reliabilty
- simplicity
- performance
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 :
- C++ (beta)
- Perl (with or without perl usethreads compile option depending on the products)
- Python
- PHP 5 (experimental configure option)
- JAVA through JUMFi (Java Based Unified Mail Filter using JNI)
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
- avoid 8.11.x and early 8.12 versions
- the latest version is always the better choice (bug-fixes, more antispan/LDAP support and Milter improvements)
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 :
- sendmail -d0.13 -bv root | grep MILTER (works for sendmail 8.10.x, 8.11.x,8.12.x).
- or sendmail -d0.1 -bv root | grep MILTER (works for sendmail 8.12.x)
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 :
- writing some libmilter library implementing the functions in milter.h
- linking/recompiling against this counterpart library
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 :
- description:
- category : SPAM, ATTACHMENT (attachment-blocking), VIRUS, SCRIPTABLE, DISCLAIMER, ARCHIVING
- status : maintained if software still being developed (latest version)
- mailing list URL
- comments
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]
- description: Perl program for inspecting and modifying e-mail messages as they pass through your mail relay
- category: SPAM, ATTACHMENT, VIRUS, SCRIPTABLE,DISCLAIMER, ARCHIVING
- status: maintained (latest version : 2.42 Mar 31, 2004)
- mailing list URL
- Requirements : perl and perl Modules, sendmail 8.12.x
- Comments : perl interface to Milter : configuration done through a Perl filter. Basis of commercial products CanIt & CanIt Pro.
[j-chkmail]
description: mail filtering software to fight against virus and spam
- category: SPAM, ATTACHMENT, VIRUS
- status: maintained (latest version : 1.3.1d Nov 03, 2003)
- mailing list URL
- Comments: early antivirus support and scripting support. Distribution
changed for recent releases : available only to registered users
[Python Milter]
description: robust toolkit for Python milters
- category: ATTACHMENT, SPAM, SCRIPTABLE
- status: maintained (latest version : 0.6.5 Mar 01, 2004)
- Requirements : python and Python modules
- Comments : python interface to libmilter.
[Sendmail::Milter]
- description: Perl module for writing mail filters in Perl
- category: SPAM, ATTACHMENT
- status: still maintained ? (latest version : 0.18 October 9, 2001)
- mailing list URL
- Requirements : perl with THREAD support (not standard) and perl Modules
- Comments : perl interface to Milter : configuration done through some Perl filter
[libmilter++]
- description: C++ wrapper library for the Sendmail Milter API
- category: SCRIPTABLE
- status: maintained
- mailing list URL
miltrassassin
- description: a lightweight sendmail<->SpamAssassin milddleware
- category: SPAM
- status: maintained (latest version : check_local 5.6 June 11, 2003)
- Comments: this Milter speaks the SPAMD protocol. Get the latest beta
[noattach]
- description : mail filter that checks client IP address and all IP addresses found in "Received:" headers agains DNSBL database
- category: ATTACHMENT
- status: maintained (latest version : 1.1p1 August 22, 2003)
[spammer]
- description: simple mail filter that checks client IP address and all IP addresses found in "Received:" headers agains DNSBL database
- Category: SPAM
- Status: maintained (latest version : 0.3.2 July 12, 2003)
[amavis]
- description: A MAil VIrus Scanner
- category: VIRUS
- mailing-list URL
- comments: use amavisd-0.1 instead of the amavisd-snapshots or old non-daemonized versions
- status: maintained (latest version : 0.1 March 11, 2003)
[amavisd-new]
- description: performance-enhanced version of amavisd with antispam features
- category: VIRUS, SPAM, ATTACHMENT
- status : maintained (latest version : amavisd-new-20030616-p9.tar.gz Apr 02, 2004)
[avpmilter]
- description: milter interface to the Kaspersky antivirus daemo
- category: VIRUS
- status: maintained ? (latest version 0.2-2, March 6, 2002)
[vbsfilter/cvgfilter]
- description: Milter to defang attachments or insert a disclaimer
- category: ATTACHMENT, DISCLAIMER
- status: maintained (latest version vbsfilter 1.14 June 26, 2003, cvgfilter 1.11 Mar 20 2003)
[vilter]
- description: nterface for sendmail to a command line virus scanner
- category: VIRUS
- status: no longer maintained ?
[rblmilter]
- description: simple sendmail milter which adds an X-RBL-Warning header
- category: SPAM
- status: still maintained ? (latest version 0.30 june 13, 2003)
[milter-virus]
- description: wrapper to use virus scanners like F-Prot
- category: VIRUS
- status: maintained (latest version 1.9 14 March 2003)
- comments: requires ripMime , double attachments blocking possible too
[spammilt]
- description: milter which scans the header of emails for blacklistes-relaying servers and locally predefined blacklisted domains/words
- category: SPAM
- status: maintained (latest version : 0.4.1)
Milter Products List : Opensource vs commercial 3/5
[spasm]
- description: customisable and configurable spam filter
- category: SPAM
- status: maintained (latest stable version : 0.30, latest devel version : 1.00-pre8 Apr 12, 2004)
[SpamAss-Milter]
- descripion: plug-in that pipes all incoming mail through SpamAssassin
- category: SPAM
- status: maintained (latest version : 0.2.0 June 26, 2003)
- mailing-list URL
[sentinel]
- description: Milter antispam and attachment filtering solution
- category: SPAM, ATTACHMENT
- status: maintained (latest version : 1.6.5b)
[Ray's filter]
- description: attachment blocking/ header blocking filter
- category: ATTACHMENT
- status: no longer maintained
- comments : to avoid (does not handle forwarded messages, bad patterns, bugs)
[IVS Milter]
- description: virus (through ClamAV) and spam scanning milter
(through SpamAssassin)
- category: SPAM, VIRUS
- status: new (latest version : 0.0.2 July 11 2003)
[MilterQuota]
- description: quotas for inboxes without any influence of the amount of disk space the user can fill
- category: MISC
- status: new (latest version : 0.23 July 15 2003)
[MailCorral]
- description: quotas for inboxes without any influence of the amount of disk space the user can fill
- category: VIRUS, SPAM
- status: new (latest version : 1.1.3 May 1, 2003)
[milter-sender]
- description: real-time sender address verification for sendmail
- category: SPAM
- status: maintained (latest version : 0.55 Apr 4, 2004)
- comment: requires libsnert (libresolv replacement)
[bogofilter-milter.pl]
- description: bogofilter Milter
- category: SPAM
- status: new (latest version : 1.18 June 16 2003)
- comment: require Sendmail::Milter (perl compiled with threads support), Mail::Alias, Proc::Daemon
[clamav-milter]
- description: Clamantivirus Milter provided with ClamAntivirus
- category: VIRUS
- status: maintained (provided with clamav-0.6x)
- comment: connects to clamd
[synonym]
- description: Milter for archiving all email messages going in and out
offering beta disclaimer/signature support
- category: ARCHIVING
- forum URL
- status: maintained (latest version: 0.4 Jan 30 2004)
- comment: Apache style license. XML config file. Next version will also propose disclaimer addition.
[Sccmilter]
- description: Spam control and canceling mail filter
- category: SPAM, ATTACHMENT
- status: new
- comment: Charset controlling, HTML isolation, attachment controlling
features
[milter-spamc]
- description: Sendmail-SpamAssassin Interface Milter
- category: SPAM
- status: new (latest version : 0.17 Apr 6, 2004)
- comment: Includes features for copying all mail or only spam mail to some given address. Requires libsnert (like milter-sender written by the same author).
[mailspy]
- description: solution that records the sender, recipient, the subject line and the names of the attachments. Can n be deployed to archive copies of selected mails (both incoming and outgoing). Access to these mails is provided with IMAP
- category: ATTACHMENT
- status: new (version 0.3.2)
[relaydelay]
- description: Greylisting Milter
- category: SPAM
- status: new (still EXPERIMENTAL apparently)
- comment: CVS code browsable.
[milter-regex]
- description: sendmail milter plugin for regular expression filtering
- category: SPAM, ATTACHMENT
- status: new (version 1.5 Mar 19 2004)
- comment: Milter offering Postfix header_checks + body_checks features
[milter-date]
- description: Milter verifying the conformance of the date-time strings found in the Received:, Resent-Date:, and Date: headers
- category: SPAM
- status: new (version 0.8 Feb 21 2004)
- comment: AMFAH (Another Milter From Anthony Howe :-))
[milter-size]
- description: Milter allowing rejection of messages of a specified size range
- category: MISC
- status: new
- comment:
[smtp-vilter]
- description: content filter for sendmail with backend to various virus scanning engines
and SpamAssassin (spamd)
- category: VIRUS, SPAM
- status: maintained (version 1.1.4 Feb 15 2004)
- comment:
[Mediater]
- description: Mediater is a milter to limit the volume of incoming mail from unrecognized senders.
- category: SPAM
- status: maintained (version 0.3 Feb 07 2004)
r
- comment:
[Milter-DNSRBL]
- description: milter rejecting messages which originate from, or are relayed via, an MTA which is listed in a DNS Real-time Black List (DNSRBL)
- category: SPAM
- status: new
- comment:
Milter Products List : Opensource vs commercial 4/5
[milter-7bit]
- description: milter tagging or rejecting email with invalid message transfer encodings as given by RFC 2045
- category: SPAM
- status: new
[milter-greylist]
- description: milter implementing grey listing
- category: SPAM
- status: maintained (stable version 1.0.2, unstable version 1.1.9)
[milter-regexp]
- description: milter offering reject/accept/discard/redirect/stall email based on regular expression
- category: SPAM
- status: new (version 0.12 Mar 08 2004)
[milter-ahead]
- description: milter allowing a gateway mail server to call ahead
to a relay or internal mail store before accepting mail for recipients of a message
- category: SPAM
- status: maintained (version 0.3 Mar 10 2004)
[sendmail-milter-spf.pl]
- description: milter implementing SPF checks
- category: SPAM
- status: maintained
- comment: requires perl compiled with thread support and the Sendmail::Milters and
Mail::SPF::Query module
[spamilter]
- description: Blocks spam using a configurable combination of DNS
RBL, Sender address verification, B/W lists, hostname verification,
attachment filename rejection, ... Also implements SPF via libspf
- category: SPAM, ATTACHMENT, VIRUS
- status: maintained (latest : 0.59 as of Apr 10, 2004 )
[spamassassin_milter]
- description: Blocks spam using SpamAssassin
- category: SPAM
- status: maintained (latest : 0.6.6 as of Mar 24, 2004 )
[milter-gris]
- description: Anthony greylisting milter
- category: SPAM
- status: new (version 0.1)
Milter Products List : Opensource vs commercial 5/5
Commercial solutions
Sendmail Anti-virus Filter from McAfee
- description: Sendmail.com antivirus solution
- category: VIRUS
- comments: uses the McAfee virus scanning engine. Sendmail Attachment Filter required.
[Sendmail Attachment Filter v2]
- description: Sendmail.com attachment blocking solution
- category: ATTACHMENT
- comments:
[Sendmail Message Appender]
- description: Sendmail.com disclaimer solution
- category: DISCLAIMER
- comments:
[Sendmail Message Copier]
- description: Sendmail.com archiving email solution
- category: ARCHIVING
- comments:
[Trend Micro Interscan Sendmail edition]
- description: Milter antivirus
- category: VIRUS
- comments: available only for Solaris (latest version : isvwsolsendmail36_100201.tar)
[Activestate PureMessage]
- description: Perl-based mail management solution
- category: SPAM, VIRUS, ATTACHMENT, SCRIPTABLE, DISCLAIMER, ARCHIVING
- mailing list URL
- comments: this product was in the past called PerlMx and now belongs to Sophos
[CanIt]
- description: commercial Mimedefang based solution
- category: SPAM, VIRUS, ATTACHMENT, SCRIPTABLE
[ScanMail]
- description: Email scanner
- category: SPAM
- homepage URL
- comments : archiving and disclaimer features. Latest version : 4.3
[GeCAD Ravantivirus Sendmail Milter edition]
- description: milter antivirus
- category: VIRUS
- comments: licence per-domain. Product no longer sold (technology transfered to Microsoft).
[Symantec CarrierScan]
- description: milter antivirus
- category: VIRUS
[Brightmail]
- description: antispam product
- category: SPAM
- comment: the website is not very clear. No mention is made to Milter.
[Central Command VEXIRA]
- description: milter antivirus
- category: VIRUS
- comments: the product is named Vexira Antivirus for Mail servers
(available for Linux, FreeBSD, OpenBSD)
[Dr Web]
- description: milter antivirus
- category: VIRUS
- comments : the tarballs are named drweb-sendmail-* (available for Linux, Solaris, OpenBSD, FreeBSD)
[H+BEDV AntiVir Milter]
- description: milter antivirus
- category: VIRUS
- comments : look for AntiVir Milter on the download page. Latest version is 1.0.4 (available for Linux, OpenBSD, FreeBSD).
[f-prot Antivirus for Linux/BSD Mail Servers]
- description: Milter antivirus
- category: VIRUS
- comments: Only version 4.3.0 - available for Linux only - includes Milter support. f-prot-milter was added at the end of August.
[Mailshell SendmMail Plug-in]
- description: Milter antispam software offering attachment blocking features
- category: SPAM, ATTACHMENT
- comments: faq available
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:
- 2002/09/18 : initial version
- 2002/09/24 : introduction changed, Sendmail.comp products quoted
- 2003/07/17 : updated Milter list, Milter and other MTAs
- 2003/07/19 : commercial Milter H+BEDV AntiVir AntiVir for Mail Milter added, additional information for some commercial Milters
- 2003/08/12 : synonym added, milter-sender version updated
- 2003/08/28 : Sccmilter added, clarifications for PHP (PHP5 only).
- 2003/08/31 : milter-spamc added
- 2003/09/09 : mailspy, relaydelay added
- 2003/09/28 : milter-regex, milter-date, milter-size, f-prot added. Various Milter products versions updated.
- 2003/10/06 : some versions bumped and typos fixed
- 2003/10/17 : smtp-vilter added, various versions updated
- 2003/10/31 : mediater and Milter-DNSRBL added, various versions updated
- 2004/03/07 : new Milters addded, various versions updated
- 2004/03/10 : sendmail-milter-spf.pl added
- 2004/03/30 : spamilter and spamassassin_milter added, several versions bumped (milter-regex, mimedefang, milter-greylist, ....)
- 2004/04/05 : milter-gris added, some versions updated.
- 2004/04/11 : jumfi added and spmilter + milter-spamc + amavisd-new versions updated
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.