Procmail
Template:More citations needed Template:Lowercase {{#invoke:Infobox|infobox}}Template:Template other{{#invoke:Check for unknown parameters | check | showblankpositional=1 | unknown = Template:Main other | preview = Page using Template:Infobox software with unknown parameter "_VALUE_"|ignoreblank=y | AsOf | author | background | bodystyle | caption | collapsetext | collapsible | developer | discontinued | engine | engines | genre | included with | language | language count | language footnote | latest preview date | latest preview version | latest release date | latest release version | latest_preview_date | latest_preview_version | latest_release_date | latest_release_version | licence | license | logo | logo alt | logo caption | logo upright | logo size | logo title | logo_alt | logo_caption | logo_upright | logo_size | logo_title | middleware | module | name | operating system | operating_system | other_names | platform | programming language | programming_language | released | replaced_by | replaces | repo | screenshot | screenshot alt | screenshot upright | screenshot size | screenshot title | screenshot_alt | screenshot_upright | screenshot_size | screenshot_title | service_name | size | standard | title | ver layout | website | qid }}Template:Main other
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.
procmail was first developed in 1990, by Stephen R. van den Berg.<ref name="README"/> Philip Guenther took over maintainership for a number of years, but relinquished the role in 2014.<ref name="openbsd-ports-marc"/> The software remained unmaintained for several years, and was believed to be defunct.<ref name="death"/> In 2020 May, Stephen van den Berg resumed maintenance again.<ref name="debbug"/> The program has since seen multiple releases and bug-fixes.
UsesEdit
The most common use case for procmail is to filter mail into different mailboxes, based on criteria such as sender address, subject keywords, and/or mailing list address.<ref name="GtLIaA"/><ref name="qmailbook"/>
Another use is to let procmail call an external spam filter program, such as SpamAssassin. This method can allow for spam to be filtered or deleted.
The procmail developers have built a mailing list manager called SmartList on top of procmail.
Procmail is an early example of a mail filtering tool and language. It is a data-driven programming language, similar to earlier line-oriented languages such as sed and AWK.
OperationEdit
procmail reads mail messages given to it on standard input, delivering or otherwise dispositioning each one. procmail is typically not invoked directly by the user. Rather, some other mail program will call upon procmail to deliver a message according to the user's wishes. Message transfer agents (MTAs), such as Sendmail or Postfix), can be configured to use procmail to deliver all mail. A mail retrieval agent such as fetchmail can invoke procmail as needed. The companion tool formail allows procmail to be applied to mail already in a mailbox.
procmail's behavior is controlled by a config file (by default, Template:Mono in the user's home directory) containing one or more recipes, read in order. Each recipe consists of a mode, zero or more conditions, and an action.
Conditions are usually extended regular expressions, although there are other forms. A recipe's action is taken only if all the conditions match (logical AND). If no conditions is given, the recipe is unconditional and the action always runs.
The action specifies what is to be done with the message, such as deliver it to a particular mailbox, or discard it. A recipe and its action can be delivering or non-delivering. Processing of a given message stops with the first delivering recipe (unless the recipe's mode flag specifies otherwise).
ExampleEdit
A simple Template:Mono config file might look like this:
MAILDIR=$HOME/mail DEFAULT=$MAILDIR/inbox :0: * ^List-Id: .*<[email protected]> foo-announce
The above routes mail from a hypothetical mailing list to a separate mailbox called Template:Mono, while delivering all other mail to the Template:Mono mailbox, both located under the Template:Mono directory.
CriticismEdit
By default, procmail will "bounce" undeliverable mail back to the sender, or discard it entirely. A mistake in the config file can result in all mail being rejected or discarded.
The configuration file format is sometimes regarded as cryptic.
procmail is not well-suited for processing mail involving Multipurpose Internet Mail Extensions (MIME). It cannot decode or recognize MIME-specific headers or international characters.
For approximately ten years, procmail was not maintained, and multiple serious security vulnerabilities<ref name="cvedetails-procmail"/> were discovered in the intervening time span<ref name="death"/> (since fixed).
See alsoEdit
Mail architectureEdit
- Message transfer agent
- Message delivery agent
- Mail retrieval agent
- Simple Mail Transfer Protocol
Similar programs and technologiesEdit
ReferencesEdit
<references>
<ref name="GtLIaA">Template:Cite book</ref>
<ref name="qmailbook">Template:Cite book</ref>
<ref name="death">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>
<ref name="openbsd-ports-marc">Template:Cite mailing list</ref>
<ref name="cvedetails-procmail">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>
<ref name="README">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>
<ref name="debbug">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>
</references>
Further readingEdit
External linksEdit
- {{#invoke:citation/CS1|citation
|CitationClass=web }} — Current source code repository and distribution point
- {{#invoke:citation/CS1|citation
|CitationClass=web }} — Procmail homepage, as it appeared when it was working
- {{#invoke:citation/CS1|citation
|CitationClass=web }} — Searchable archives of the procmail mailing list