User Tools

Site Tools


procmail

It is possible, and allowed, to forward (most of) your mail to an external mail server. However, the university has put in plkace a mail forwarding policy about mail marked as confidential, see here for the STRW & LION implementation of that policy.

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_ulcn_address@umail.leidenuniv.nl

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.

Automated setup

To make life easier, a basic mail forwarding setup can be made through our “Self service” pages:

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 !)
  • Implementation of the university mail forwarding policy STRW & LION
procmail.txt · Last modified: 2023/07/28 13:24 by jansen