1 This page has a sample {{{.procmail.d/procmailrc}}} file with comments. You
2 can use either a {{{.procmail.d/procmailrc}}} file or a {{{.forward}}} file,
5 = Which should I use? =
7 If you simply want to send mail to another email address, using a
8 {{{.forward}}} file is your best bet.
10 If you want to exercise control over your email by splitting it into
11 various mailboxes or (in our case) IMAP folders based on custom
12 criteria using the power of regexps, perhaps a {{{.procmail.d/procmailrc}}} file
13 would be best for you.
15 = What does this file do? =
17 * Separates mail into different folders based on who it is from or who it is addressed to.
18 * If an email message did not get checked by the central spamassassin daemon, make sure it gets checked. It calls the client program instead of starting another spamassassin process. Most messages have already been checked -- these we don't touch. Occasionally spamassassin misses checking a message or two, somehow.
20 = What does this file not do? =
22 * Force spam checking with a custom set of rules. The admins '''do not''' recommend checking spam with custom rules, since it causes spamassassin to be invoked twice for each message.
23 * This file can be split into smaller task-based files, but this is not done in the example.
25 = Notes for Beta Testers on Peer 1 Infrastructure =
27 If you are beta testing an account on the new Peer 1 infrastructure (you should know who you are), the default procmail file location has changed. You should have a directory under your home AFS directory called .procmail.d. In this directory, procmail will look for a file called procmailrc. Create this and you should be all set. Note the new AFS file locations in the example files below, and look at mwolson's and leitgebj's procmail configuration in their home directories for more examples.
33 # Example procmailrc filters
35 # We use a maildir here at hcoop.net
39 # If you want to keep track of where mail has been delivered,
40 # uncomment this. If enabled, be sure to trim this file once
41 # in a while (using cron is one way), because otherwise it can
42 # grow quite large. It is strongly recommended to use the
43 # path given here, so that the logs gets placed in a writable
45 #LOGFILE=$HOME/.logs/mail/procmail.log
47 # See the manpages `procmailrc' and `procmailex' for explanations
48 # of the syntax involved.
50 # The following 2 rules come before the spam rules because we
51 # want to make sure that email from these people get through.
52 # It's a form of whitelisting.
54 # Stuff from the family
56 * ^From.*(familymember1@msn|familymember2@yahoo)
61 * ^From.*person@somecollege
64 # If mail hasn't been put through spamassassin, do so now
69 # All mail tagged as spam (eg. with a score higher than the set
70 # threshold) is definitely spam.
75 # If it scores 3 or better, it's probably spam.
77 * ^X-Spam-Level: \*\*\*
80 # The Debian Bug-Tracking System forwards me a copy of each bug report
81 # I send in. Since I don't already have a copy of this report, put it
84 * ^From:.*me@hcoop\.net
85 * ^To:.*submit@bugs\.debian\.org
88 # Local mail (error messages and the like)
90 * ^(To:|From).*local\.domain\.org
95 * ^To:.*me(\+|_)vending@domain\.org
100 * ^To:.*me\+school@domain\.org
103 # Crap sent to all students
105 * ^(To|Cc):.*[Rr]-[Uu]sers_
110 * ^(From|To|C[c]):.*(bugs\.debian\.org|bugzilla\.)
113 # LifeReader mailing list
115 * ^(From|To|C[c]):.*liferea-devel@lists
118 # Neki_Fujiyama (Samurai Pizza Cats) list
120 * ^(From|To|C[c]):.*[Nn]eko_[Ff]ujiyama@yahoogroups
121 .Lists.Neko_Fujiyama/
128 # InfoWorld newsletters
130 * ^From.*@newsletter\.infoworld
135 * ^(From|To|C[c]):.*(@lists\.|@yahoogroups)
138 # Anything I've sent should go to Test
140 * ^From:.*(mwolson@|@mwolson\.org)
146 I based my .procmailrc on the file above. However, I don't trust my procmail coding skills, so I had procmail create a log file of the messages that it receives, as well as a backup copy of each message for testing purposes. I also decided that the "Sender:" field is the best one to use for the lists that I receive, so I filter on this field. I took code in my .procmailrc from the "procmailex" man page, which I highly recommend.
148 I created the directory "log" in my home directory for the log file before putting the .procmailrc in place. I also created the folders to which mail would be filtered in thunderbird, although I'm not absolutely sure if this step is necessary.
150 Note that you should probably comment out the "backup" section once you're sure that your code works in order to save space. You will also have to rotate or truncate the procmail log file manually, or write a script for cron to use.
152 {{{## JustinLeitgeb .procmailrc
153 ## Modified Sun Apr 15 01:41:34 EDT 2007
155 # We use a maildir here at hcoop.net
156 MAILDIR=$HOME/Maildir
160 LOGFILE=$HOME/.logs/mail/procmail.log
162 # Make a backup of all mail that we'll wipe out when we're sure that
163 # filtering is working correctly.
167 ## Filter all of the mailing lists that we get into different
170 # CFP (call for papers) list
172 * ^Sender.*owner-cfp@lists.sas.upenn.edu
177 * ^Sender.*plone-users-bounces@lists.sourceforge.net
182 * ^Sender.*nflug-bounces@nflug.org