procmail

The Swiss Army Knife for server-side e-mail rules in the UNIX world.

Useful snippets

Duplicate removal - this rule uses formail to remove emails that have a message-id that has already passed through the system. It keeps an 8K log. “W” waits until it gets the exit code from formail and filters if appropriate. The ‘h’ means pipe the headers only. It uses a user-defined lockfile for this task:

:0 Wh: msgid.lock
| $FORMAIL -D 8192 $HOME/.msgid.cache

Resources

This page is referenced in: