Milter

Last updated
Milter
Type MTA extension
Website milter.org at the Wayback Machine (archived 2015-05-10)

Milter (portmanteau for mail filter) is an extension to the widely used open source mail transfer agents (MTA) Sendmail and Postfix. It allows administrators to add mail filters for filtering spam or viruses 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.

Contents

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 affecting the 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 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.

MTAs

Sendmail

Milter was first officially introduced to Sendmail 8.12.0 released on September 8, 2001. [1] 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. [2] [3] Many, but not all, milters can be used with Postfix "out of the box".

Interface

The Sendmail Consortium provides a documented Application Programming Interface 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

Related Research Articles

<span class="mw-page-title-main">Email</span> Mail sent using electronic means

Electronic mail is a method of transmitting and receiving messages using electronic devices. It was conceived in the late–20th century as the digital version of, or counterpart to, mail. Email is a ubiquitous and very widely used communication medium; in current use, an email address is often treated as a basic and necessary part of many processes in business, commerce, government, education, entertainment, and other spheres of daily life in most countries.

Within the Internet email system, a message transfer agent (MTA), or mail transfer agent, or mail relay is software that transfers electronic mail messages from one computer to another using the Simple Mail Transfer Protocol. In some contexts the alternative names mail server, mail exchanger, and MX host can be used to describe an MTA.

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 typically use SMTP only for sending messages to a mail server for relaying, and typically submit outgoing email to the mail server on port 587 or 465 per RFC 8314. For retrieving messages, IMAP is standard, but proprietary servers also often implement proprietary protocols, e.g., Exchange ActiveSync.

<span class="mw-page-title-main">Sendmail</span> Open-source mail transfer agent

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.

procmail is an email server software component — specifically, a message delivery agent (MDA). It was one of the earliest mail filter programs. It is typically used in Unix-like mail systems, using the mbox and Maildir storage formats.

Sender Policy Framework (SPF) is an email authentication method which ensures the sending mail server is authorized to originate mail from the email sender's domain. This authentication only applies to the email sender listed in the "envelope from" field during the initial SMTP connection. If the email is bounced, a message is sent to this address, and for downstream transmission it typically appears in the "Return-Path" header. To authenticate the email address which is actually visible to recipients on the "To:" line, other technologies such as DMARC must be used. Forgery of this address is known as email spoofing, and is often used in phishing and email spam.

Greylisting is a method of defending e-mail users against spam. A mail transfer agent (MTA) using greylisting will "temporarily reject" any email from a sender it does not recognize. If the mail is legitimate, the originating server will try again after a delay, and if sufficient time has elapsed, the email will be accepted.

A bounce message or just "bounce" is an automated message from an email system, informing the sender of a previous message that the message has not been delivered. The original message is said to have "bounced".

<span class="mw-page-title-main">Postfix (software)</span> Mail transfer agent

Postfix is a free and open-source mail transfer agent (MTA) that routes and delivers electronic mail.

Email authentication, or validation, is a collection of techniques aimed at providing verifiable information about the origin of email messages by validating the domain ownership of any message transfer agents (MTA) who participated in transferring and possibly modifying a message.

<span class="mw-page-title-main">Message submission agent</span>

A message submission agent (MSA), or mail submission agent, is a computer program or software agent that receives electronic mail messages from a mail user agent (MUA) and cooperates with a mail transfer agent (MTA) for delivery of the mail. It uses ESMTP, a variant of the Simple Mail Transfer Protocol (SMTP), as specified in RFC 6409.

The Sender Rewriting Scheme (SRS) is a scheme for bypassing the Sender Policy Framework's (SPF) methods of preventing forged sender addresses. Forging a sender address is also known as email spoofing.

policyd-weight is a mail filter for the Postfix mail transfer agent (MTA) written in Perl. It allows postfix to evaluate mail envelope information and to score mail against several DNS-based Blackhole Lists (DNSBL) before the mail is queued. The final score will determine whether a mail is rejected or accepted, in which case it is usually then subject to more resource intensive checks by a virus scanner and spam filter.

<span class="mw-page-title-main">MIMEDefang</span> Software framework for filtering e-mail

MIMEDefang is a GPL licensed framework for filtering e-mail. It uses sendmail's "Milter" API, some C glue code, and some Perl code to let the user write high-performance mail filters in Perl.

Email forwarding generically refers to the operation of re-sending a previously delivered email to an email address to one or more different email addresses.

An Internet messaging platform is any system on the Internet that exchanges messages for the purpose of human communications.

Backscatter is incorrectly automated bounce messages sent by mail servers, typically as a side effect of incoming spam.

A bounce address is an email address to which bounce messages are delivered. There are many variants of the name, none of them used universally, including return path, reverse path, envelope from, envelope sender, MAIL FROM, 5321-FROM, return address, From_, Errors-to, etc. It is not uncommon for a single document to use several of these names.

<span class="mw-page-title-main">Email agent (infrastructure)</span>

An e-mail agent is a program that is part of the e-mail infrastructure, from composition by sender, to transfer across the network, to viewing by recipient. The best-known are message user agents and message transfer agents, but finer divisions exist.

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 malware. It can be considered an interface between a mailer and one or more content filters.

References

  1. "SENDMAIL RELEASE NOTES: 8.12.0/8.12.0". Sendmail. 2001-09-08. Retrieved 2020-08-03.
  2. "Postfix before-queue Milter support: Limitations". Postfix . Retrieved 2020-08-03.
  3. Wietse Venema. "Postfix 2.3 Change log: 20060301-20060515" . Retrieved 2020-08-03.