Procmail setup at Nyx

Introduction

In order to use Procmail, "all" you need is a text file named .procmailrc in your home directory (Note the leading dot in the filename), containing any number of "recipes" that sequentially defines how you want procmail to handle your email. Processing stops after the first matching recipe. If there is no matching recipe, the message goes into your default mailbox.

A recipe consists of a line of flags, followed by any number of lines of matching criteria, followed by one action line, which is normally a file name, where you want the matching message stored, (or, the special file named /dev/null used to discard a message), and a blank line to seperate one recipe from the next.

The flags start with :0 -the matching criteria start with a star, * and is followed by a "regular expression", which is the most tricky part. If the action line doesn't start with a slash, /, it is interpreted as the name of a file in your home directory.

Getting started

To make life easier for users who are unfamiliar with the cryptic notations of procmail recipes, Vance Kochenderfer has made a program that will assist you in setting up a basic .procmailrc to filter out spam, based on special headers inserted into each message, by the SpamAssassin program.
To run this program, enter /nyx/projects/bin/spamfilter on a command line (or top,c,m,sspf in the menus).

Including recipes

Another option is, to incorporate ready-made recipes from /nyx/lib/procmail into your own .procmailrc, using the INCLUDERC variable, e.g.,

INCLUDERC=/nyx/lib/procmail/virus.rc

which is supposed to filter out most messages with executable attachments (whether they are viral or not).

Manual pages

If you feel like learning more about procmail, it would be a good idea to start by browsing through the online man-page for procmailrc and procmailex. For your convenience, these are available via Lynx, if you run the program /nyx/projects/cmaarbj/bin/htman
Once you have understood the basics, the quickreference, available from procmail -h is very handy.

Where to go from here

There is a lot of Nyx-specific tips in the local newsgroups nyx.help and nyx.misc and many online tutorials available on the Internet, but the tutorials tend to be even longer than the man-pages, and two warnings seem to be appropriate:
Do not pay attention to the explanations about setting up a .forward file, as it isn't necessary, and
do not try to use any tips about bouncing spam.

References


Casper Maarbjerg, 2006-04-06