This article needs additional citations for verification. (April 2023)
|Original author(s)||Stephen R. van den Berg|
|Developer(s)||Philip A. Guenther|
|Initial release||December 7, 1990|
3.24 / March 2, 2022
|Operating system||Any Unix-like|
|License||GPL or Artistic License|
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. Philip Guenther took over maintainership for a number of years, but relinquished the role in 2014. The software remained unmaintained for several years, and was believed to be defunct. In 2020 May, Stephen van den Berg resumed maintenance again. The program has since seen multiple releases and bug-fixes.
The procmail developers have built a mailing list manager called SmartList on top of procmail.
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, .procmailrc 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).
A simple .procmailrc config file might look like this:
MAILDIR=$HOME/mail DEFAULT=$MAILDIR/inbox :0: * ^List-Id: .*<email@example.com> foo-announce
The above routes mail from a hypothetical mailing list to a separate mailbox called foo-announce, while delivering all other mail to the inbox mailbox, both located under the $HOME/mail/ directory.
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.
- Message transfer agent
- Message delivery agent
- Mail retrieval agent
- Simple Mail Transfer Protocol
Similar programs and technologies
- "README". 2022-03-02. Retrieved 2022-04-26.
Copyright (c) 1990-2022, S.R. van den Berg, The Netherlands. Copyright (c) 1997-2005, Philip Guenther, The United States of America.
- Gunther, Philip (2014-11-18). "please remove the procmail port". ports@ (Mailing list). OpenBSD. Retrieved 2019-02-25.
- Willis, Nathan (24 November 2010). "Reports of procmail's death are not terribly exaggerated". Linux Weekly News. Retrieved 27 October 2013.
- Stephen R. van den Berg (2022-03-02). "#1006633: procmail is unmaintained upstream". Retrieved 2022-04-26.
As of May 2020, the dormant state of procmail upstream maintenance has been changed back to active. As Santiago Vila can attest to, I have taken up active maintenance of procmail again since the past two years ...
- Wells, Nicholas; Jang, Michael (3 October 2018). Guide to Linux Installation and Administration. Cengage Learning EMEA. ISBN 9780619000974 – via Google Books.
- Levine, John (24 March 2004). qmail: Managing Unix-Based Mail Systems. O'Reilly Media, Inc. ISBN 9780596552121 – via Google Books.
- "CVEdetails: Procmail Vulnerabilities". CVEdetails.com. 2018-02-03. Retrieved 2020-05-02.
- "GitHub - BuGlessRB/procmail: The mail sorting program". — Current source code repository and distribution point
- "Procmail Homepage". Archived from the original on 2015-10-13. — Procmail homepage, as it appeared when it was working
- "Procmail Home - MarkMail - Community libraries". — Searchable archives of the procmail mailing list