1 PATH=/bin:/usr/bin:/usr/X11R6/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin
5 # "VERBOSE=on" is only used for debugging.
10 DEFAULT=$MAILDIR/Inbox/
11 LOGFILE=$HOME/.procmail_log
19 # Add filter for "your message to foo awaits moderator approval"
20 # filter out owner mails
24 HIGHSPAM=spam/HIGHSPAM/
27 # A list (one per line) of people I KNOW are spammers :-)
28 # can match any part of name so you can use fred, fred@aol.com or aol.com to
29 # match a user, mail address or domain.
30 # Note that this file is case-insensitive.
31 SPAMMERS=$HOME/.procmail/spammers
33 # name of the file containing a list of people we
34 # always want to get mail from, one per line. If
35 # any substring of the From: or Sender: line matches
36 # a line of this file, it will go through, so this
37 # can be used to denote entire sites that we always
38 # wish to get mail from as well as individuals.
39 # E.g. "user", "user@aol.com" or "aol.com".
40 # Note that this file is case-insensitive.
41 # Putting all of the people or lists you get lots
42 # of mail from here will not only insure you get
43 # it, but will speed up procmail.
44 FRIENDS=$HOME/.procmail/friends
46 # ======================================
47 # Preventing duplicates using 16Kb cache
48 # They get shoved in duplicates folder
50 #| formail -D 16384 msgid.cache.new
55 * ^Subject:.*Rnm-devel moderator request
59 * ^Subject:.*Cron.*debbugs@master
64 * !Message-Id: .*delay[0-9]+@
69 * !Message-Id: .*delay[0-9]+@
70 * ^TO \/don\+delay\+[^@]+
71 |/home/don/bin/delay_mail --mailto don@donarmstrong.com --enqueue --email --delay $MATCH
74 # ==========================================================================
75 # Correct crap or broken mails using sed
76 # ==========================================================================
77 # Correct wrong sig-dashes, ie add a space for lines with only "--" in them:
82 #| sed -e 's/^--$/-- /'
84 # preconverts all plain-text mail arriving in certain encoded
85 # MIME formats into a more compact 8-bit format which can be
86 # used and displayed more easily by most programs.
88 #* ^Content-Type: *text/plain
91 #* ^Content-Transfer-Encoding: *quoted-printable
95 #| formail -I "Content-Transfer-Encoding: 8bit"
98 #* ^Content-Transfer-Encoding: *base64
102 #| formail -I "Content-Transfer-Encoding: 8bit"
105 # Convert old-style PGP messages to MIME
107 * !^Content-Type: multipart/
108 * !^Content-Type: application/pgp
111 * ^-----BEGIN PGP MESSAGE-----
112 * ^-----END PGP MESSAGE-----
114 -i "Content-Type: application/pgp; format=text; x-action=encrypt"
117 * ^-----BEGIN PGP SIGNED MESSAGE-----
118 * ^-----BEGIN PGP SIGNATURE-----
119 * ^-----END PGP SIGNATURE-----
121 -i "Content-Type: application/pgp; format=text; x-action=sign"
124 ######################################################################
125 # Here we search the list of people we always want to get mail from, #
126 # and deliver the mail if it's from one of them, no matter what. #
127 # The FRIENDS file is set and described above. #
128 ######################################################################
130 * ! ? (formail -x From: -x Sender: | fgrep -iqf $FRIENDS)
134 # deliver to default mailbox
136 #spamassasin is being run sitewide.
138 # Mails with a score of 15 or higher are almost certainly spam (with 0.05%
139 # false positives according to rules/STATISTICS.txt). Let's put them in a
140 # different mbox. (This one is optional.)
142 * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
146 # Mails that are clearly spam, but we don't want to toss immediately
148 * ^X-Spam-Level: \*\*\*\*\*\*\*\*
151 # All mail tagged as spam (eg. with a score higher than the set threshold)
152 # is moved to "probably-spam".
154 * ^X-Spam-Status: Yes
159 # Work around procmail bug: any output on stderr will cause the "F" in "From"
160 # to be dropped. This will re-add it.
165 LOG="*** Dropped F off From_ header! Fixing up. "
168 | sed -e 's/^rom /From /'
174 ##################################################################
175 # SPAM filter. I don't like spam. I just don't #
176 ##################################################################
178 # Here we search a file with a list of people we _never_ want to
179 # get anything from, tossing the mail if it's from one of them.
180 # SPAMMERS is set and described above.
181 # Note, you can use the following line instead to be even more
182 # strict, they can't have even relayed it via an adress in the
184 # * ? (formail -x From: -x Sender: -x Reply-To: -x Received: | fgrep -iqf $SPAMMERS)
186 * ? (formail -x From: -x Sender: -x Reply-To: | fgrep -iqf $SPAMMERS)
187 | formail -A "X-SPAM-RULE: address found in spammers file" >> $SPAM
189 # look for X-Advertisement header or 'advertisement' in the subject,
190 # accounting for possible sp. error. "Nice" spammers use this header.
192 * ^X-Adverti[sz]ement:
193 | formail -A "X-SPAM-RULE: X-Advertisement header" >> $SPAM
196 * ^Subject:.*adverti[sz]ement
197 | formail -A "X-SPAM-RULE: Advertisement in subject" >> $SPAM
199 # snag the To: and From: headers
202 FROM=`formail -zX From: | formail -zrx To:`
204 # no To: line AND no Cc: line. You could filter out anything with no To:,
205 # but there are lots of mailinglist idiots who Cc the list and don't To:
210 | formail -A "X-SPAM-RULE: no To: or Cc: header" >> $SPAM
212 # bogus pegasus header, very common with spammers, and I've never
213 # seen it used by anyone else.
215 * ^Comment: Authenticated sender is
216 * ! ^X-Mailer: Pegasus
217 | formail -A "X-SPAM-RULE: bogus pegasus header" >> $SPAM
219 #large number of spaces then number in subject
221 * ^Subject:.*\ \ \ \ \ \ \ \ \ [0-9][0-9]+
222 | formail -A "X-SPAM-RULE: too many spaces followed by number in subject" >> $SPAM
224 #laser toner cartridges. (I mean, come, on!)
226 * ^Subject: laser cartridges
227 | formail -A "X-SPAM-RULE: laser cartridges suck" >> $SPAM
231 # Debian role accounts
234 * ^Delivered-To: (owner@bugs.debian.org)
238 * ^Delivered-To: (listmaster@lists.debian.org)
244 * ^TO (oftc@spi-inc.org)
249 * ^Subject:\ (\[comment\])?\[ALRM\ \#
253 * ^From:\ nagios@nagios-global.lab.propel.com
258 * ^From:\ noreply@dragongoserver.net
263 5B5B###################
266 * X-Mailing-List: <\/[^@]+
267 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
270 * ^Delivered-To: mailing list \/[^@]+
271 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
274 * ^Sender: owner-\/[^@]+
275 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
278 * ^Sender: \/[^@]+-bounces?
279 lists/`echo $MATCH | sed -e 's/\-bounces*//g; s/[\/]/_/g'`/
282 * ^X-BeenThere: \/[^@]+
283 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
286 # Dumb apache mailing lists
288 * ^List-Post: <mailto:\/[^@]+
289 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
292 # Debian's bug system uses X-Loop
295 * ^X-PTS-Package: \/.+
296 bugs/`echo $MATCH |sed -e 's/[\/]/_/g'`/
299 * ^X-Debian-PR-Package: \/.+
300 bugs/`echo $MATCH |sed -e 's/[\/]/_/g'`/
303 * ^X-Loop: owner@bugs.debian.org
304 bugs/control_messages/
308 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
312 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
314 # damn kernel back-to-frontness
316 * ^Sender:[ ]linux-kernel-owner@vger.kernel.org
321 * ^Sender:[ ]linux-scsi-owner@vger.kernel.org
326 * ^Sender:[ ]emacs-pretesters@gnu.org
327 lists/emacs-pretesters/
330 * ^Sender:.*GENE-ARRAYS@ITSSRV1.UCSF.EDU
334 * ^Sender:.*scd-bounce@blars.org
337 # broken lists using win32 software and NO LIST HEADER. Dumb.
339 * ^Sender: (Bugtraq|Incidents Mailing|VULN-DEV) List
342 #########################################
343 # Final SPAM filter, post mailing lists #
344 #########################################
346 # NOTE: This catches like 80% of my SPAM, it really works but make the match
349 # Not mailing list, but not to me. SPAM.
351 #* !^TO(anylevel.com|donarmstrong.com|donarmstrong.org|oneinfinity.com|donarmstrong.net|pellam.ucr.edu|rzlab.ucr.edu|student.ucr.edu|localhost|Blind\.Copy\.Receiver)
352 #| formail -A "X-SPAM-RULE: Not to one of my addresses or a mailing list" >> $SPAM
355 #####################################
356 # Last rule: Put mail into mailbox #
357 #####################################