Milter (
portmanteau
A portmanteau word, or portmanteau (, ) is a blend of words[mail transfer agent
The mail or post is a system for physically transporting postcards, letters, and parcels. A postal service can be private or public, though many governments place restrictions on private systems. Since the mid-19th century, national postal syst ...](_blank)
s (MTA)
Sendmail
Sendmail is a general purpose internetwork email routing facility that supports many kinds of mail-transfer and delivery methods, including the Simple Mail Transfer Protocol (SMTP) used for email transport over the Internet.
A descendant of the ...
and
Postfix. It allows administrators to add mail filters for filtering
spam
Spam may refer to:
* Spam (food), a canned pork meat product
* Spamming, unsolicited or undesired electronic messages
** Email spam, unsolicited, undesired, or illegal email messages
** Messaging spam, spam targeting users of instant messaging ( ...
or
viruses
A virus is a submicroscopic infectious agent that replicates only inside the living cells of an organism. Viruses infect all life forms, from animals and plants to microorganisms, including bacteria and archaea.
Since Dmitri Ivanovsky's 1 ...
in the mail-processing chain. In the language of the art, "milter" refers to the protocol and API implementing the service, while "a milter" has come to refer to a filter application that uses milter to provide service.
History
Prior to the advent of milter, an email filter was generally implemented as a program to which an MTA would hand the message once it has completely arrived, with most of the message's envelope information removed. That program could then analyze the header and body of the message and make a decision to accept the message (i.e. return a "success" status to the MTA) or reject it (i.e. return a "failed" status to the MTA). The MTA would then log a successful delivery or return a failure message to the sender as appropriate, and the filter would be responsible for effecting delivery of the message (to the intended inbox(es) as-is, or modified to remove unwanted content, or to specific folder(s), etc.).
An MTA that is milter-capable instead notifies filters to which it is connected about each phase of the delivery of a message, from initial client connection through completion of transmission. At each phase of the
SMTP
The Simple Mail Transfer Protocol (SMTP) is an Internet standard communication protocol for electronic mail transmission. Mail servers and other message transfer agents use SMTP to send and receive mail messages. User-level email clients typical ...
session, the filter is given data about the arriving message and then has an opportunity to terminate acceptance of the message early when appropriate. For very large messages, this can have an enormous impact when a decision to reject can be made as early as possible. Moreover, unlike the former model, a milter-capable MTA can connect to multiple filters in parallel that serve specific purposes such as anti-virus, anti-spam, message authentication, flow regulation, etc. Finally, such filters can take special action on the message: add or remove recipients in the envelope; alter the body prior to delivery; add, change or remove header fields in the message, etc.
The Sendmail Consortium includes a special thread-based library in the sendmail distribution that provides the milter
API
An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how ...
.
MTAs
Sendmail
Milter was first officially introduced to
Sendmail
Sendmail is a general purpose internetwork email routing facility that supports many kinds of mail-transfer and delivery methods, including the Simple Mail Transfer Protocol (SMTP) used for email transport over the Internet.
A descendant of the ...
8.12.0 released on September 8, 2001. Milter was available in sendmail 8.11.x versions as an FFR (For Future Release/Beta code). Milter has undergone substantial improvements since its first official release.
Postfix
Milter support was added to
Postfix 2.3.0 released July 12, 2006.
Many, but not all, milters can be used with Postfix "out of the box".
Interface
The Sendmail Consortium provides a documented
Application Programming Interface
An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how t ...
that can be used to create milters for special needs. The library provided by The Sendmail Consortium is
pthread-based. However, documentation of the protocol used for communication between sendmail and milter processes is not provided. This internal protocol is subject to changes in new sendmail versions.
Sample Milters
*
MIMEDefang
MIMEDefang is a GNU General Public License, GPL software license, licensed framework for e-mail filtering, filtering e-mail. It uses sendmail's "Milter" API, some C (programming language), C glue code, and some Perl code to let the user write hig ...
*
Amavis
Amavis is an open-source content filter for electronic mail, implementing mail message transfer, decoding, some processing and checking, and interfacing with external content filters to provide protection against spam and viruses and other ma ...
References
{{Authority control
Message transfer agents