| procmail |
procmail is the best system for setting up custom email processing rules on your unix server.
procmail outline
Your ~/.procmailrc usually has variable assignments and then sets of recipes, each one usually with three parts:
- :lock line specifies what if any type of file locking you need, in case the current recipe might need to write to any files.
- *condition line(s) do some type of match on the current email, and returns true if the action is to be taken. If there are more than one condition line in a recipe, they *all* must be true for the action to take place.
- !action line usually appends the current email to a specified mailbox folder file, or forwards it to a specified email address.
Unless the lock line ends with "c" (for continue), once a recipe condition is true and its action run, procmail terminates without evaluating later recipes.
procmail links
- procmail.org is the official home, but not novice friendly.
- man pages procmail procmailrc examples formail
- The Procmail Companion book is so-so, but the only procmail book I could find.
- Ian Soboroff has a great short introductory tutorial.
- Era Eriksson's Procmail Mini-FAQ (cache) and Quick Reference cf
- ii.com Procmail Quick Start by Nancy McGough
- procmail tips is wonderful (but has broken links) (cache)
- dmoz
other
- use "mailstat -km procmail.log" for report
- here is my first generation procmail spam filter; see my spam page for more info.
|