Procmail
Jump to navigation
Jump to search
Procmail is a mail delivery agent (MDA). It is invoked by the MTA to deliver a mail into user mailboxes.
Procmail is no longer maintained (since 2001), and has known vulnerabilities. It is recommended to switch to more recent systems, such as Sieve [1].
Example installation with Postfix - User
With Postfix, users may configure mail forwarder by creating file ~/.forward [2]. For instance,
fossedu@example.com
would forward all user mail to that mail address.
We can use this file to configure procmail per user [3]. Create a file ~/.forward with content
"|exec /usr/local/bin/procmail || exit 75"
Then create the procmail configuration file ~/.procmailrc. For instance:
:0
* ^X-Spam-Flag: YES
$DEFAULT/.Spam/
More examples here.
Example installation with Postfix - System
We can install configure Postfix to use procmail system-wide. Edit /etc/postfix/main.cf [4]:
mailbox_command = /usr/bin/procmail -a "$EXTENSION" DEFAULT=$HOME/Maildir/ MAILDIR=$HOME/Maildir