User Tools

Site Tools


procmail

This is an old revision of the document!


Mail filtering and forwarding using procmail

Procmail is the tool run by the mail server to deliver mail to your mailbox, or to several mailboxes of your choosing. It can be used to filter mail using all kinds of criteria (sender, subject, spam score, basically anything that is in the headers of the mail). It can also be used to forward mail to another mail address (eg when you move to another institute, or if you'd rather read your mail of gmail).

To get started, create a file called .procmailrc in your home directory, or install our procmailrc template using SfinxInstall .procmailrc. The template comes with the most common settings, documented in comments. Also included are some other useful settings that you may want, which are commented out and can be enabled by removing the # at the beginning of these lines.

The .procmailrc is a text file, so it can be edited in all the usual editors.

A simple mail forwarding rule (provided in a comment in the template file) will look like this:

:0
  ! your_address@example.com

If you decide to forward your mail to another mail account, please make sure the lines are in place that filter out known spam. Spam forwarded to elsewhere sometimes cause our mailserver to be blacklisted as suspected source of spam, and in such cases, we will be forced to remove your forwarding rules.

See also:

  • man pages for procmail, procmailrc and procmailex (examples)
  • Our procmailrc template (note: version in the wiki may be outdated compared by the actual version installed by SfinxInstall .procmailrc !)
procmail.1537873053.txt.gz · Last modified: 2018/09/25 10:57 by jansen