]> git.donarmstrong.com Git - remote_mail.git/blob - .procmailrc
d36e31f3b3545366396ab237dd557a0a8dabac36
[remote_mail.git] / .procmailrc
1 PATH=/bin:/usr/bin:/usr/X11R6/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin
2
3 SHELL=/bin/bash
4
5 # "VERBOSE=on" is only used for debugging.
6 VERBOSE=off
7
8 SENDMAIL=sendmail
9 MAILDIR=$HOME/Maildir
10 DEFAULT=$MAILDIR/Inbox/
11 LOGFILE=$HOME/.procmail_log
12 # LOGABSTRACT = "all"
13
14 # TODO
15
16 #:0 c:
17 #$HOME/Mail/temp/
18
19 # Add filter for "your message to foo awaits moderator approval"
20 # filter out owner mails
21
22
23 # where to send spam
24 HIGHSPAM=spam/HIGHSPAM/
25 SPAM=spam/SPAM/
26 JOEJOB=spam/JOEJOB/
27 POSTMASTER=spam/POSTMASTER/
28
29 # A list (one per line) of people I KNOW are spammers :-)
30 # can match any part of name so you can use fred, fred@aol.com or aol.com to
31 # match a user, mail address or domain.
32 # Note that this file is case-insensitive.
33 SPAMMERS=$HOME/.procmail/spammers
34
35 # name of the file containing a list of people we
36 # always want to get mail from, one per line.  If
37 # any substring of the From: or Sender: line matches
38 # a line of this file, it will go through, so this
39 # can be used to denote entire sites that we always
40 # wish to get mail from as well as individuals.
41 # E.g. "user", "user@aol.com" or "aol.com".
42 # Note that this file is case-insensitive.
43 # Putting all of the people or lists you get lots
44 # of mail from here will not only insure you get
45 # it, but will speed up procmail.
46 FRIENDS=$HOME/.procmail/friends
47
48 # ======================================
49 # Preventing duplicates using 16Kb cache
50 # They get shoved in duplicates folder
51 #:0 Whc: .msgid.lock
52 #| formail -D 16384 msgid.cache.new
53 #:0 a:
54 #/dev/null
55
56 :0 HB
57 * ^From:.*mailer-daemon@beta.sndservers.com
58 * ^Sender:.*Carpenters (Apprenticeship|Training)
59 /dev/null
60
61 :0 H
62 * ^Subject:.*Rnm-devel moderator request
63 /dev/null
64
65 :0 H
66 * ^Subject:.*Cron.*debbugs@master
67 /dev/null
68
69 :0
70 * !^Content-Type: multipart/
71 * !^Content-Type: application/pgp
72 {
73     :0 fBw
74     * ^-----BEGIN PGP MESSAGE-----
75     * ^-----END PGP MESSAGE-----
76     | formail \
77         -i "Content-Type: application/pgp; format=text; x-action=encrypt"
78
79     :0 fBw
80     * ^-----BEGIN PGP SIGNED MESSAGE-----
81     * ^-----BEGIN PGP SIGNATURE-----
82     * ^-----END PGP SIGNATURE-----
83     | formail \
84         -i "Content-Type: application/pgp; format=text; x-action=sign"
85 }
86
87 :0:
88 * ! ? (formail -x From: -x Sender: | fgrep -iqf $FRIENDS)
89 {
90
91 # Mails with a score of 15 or higher are almost certainly spam
92 :0:
93 * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
94 #definetly_spam
95 /dev/null
96
97 # Mails that are clearly spam, but we don't want to toss immediately
98 :0:
99 * ^X-Spam-Level: \*\*\*\*\*\*\*\*
100 $HIGHSPAM
101
102 # All mail tagged as spam (eg. with a score higher than the set threshold)
103 # is moved to "probably-spam".
104 :0:
105 * ^X-Spam-Status: Yes
106 $SPAM
107
108
109 # I get joe-jobbed a lot; if a message is from a mailer, but not from
110 # one of mine, discard it.
111 :0:
112 * (^(((Resent-)?(From|Sender)|X-Envelope-From):|>?From )([^>]*[^(.%@a-z0-9])?(Post(ma(st(er)?|n)|office)|(send)?Mailer|daemon|mmdf|n?uucp|ops|r(esponse|oot)|(bbs\.)?smtp(error)?|(s(erver)|ystem)|A(dmin(istrator)?|MMGR))(([^).!:a-z0-9][-_a-z0-9]*)?[%@>\t ][^<)]*(\(.*\).*)?)?$([^>]|$)
113 * ^Subject:.*(Mail delivery failed|Returned mail|Undelivered Mail)
114 * !^From:.+(ucr|debian|donarmstrong|sndservers|ccin|schedulesdirect|prometheuslabor.com)
115 * !^From:.+(schedulesdirect|paypal.com)
116 * !^To:.+ (don\+.+\@(donarmstrong\.com|debian\.org|rzlab\.ucr\.edu))
117 * !^List-.+
118 * !^X-Diagnostic:
119 $JOEJOB
120
121 }
122
123 # discard bounces from dumb mailing lists on prometheuslabor
124 :0:
125 * ^From: MAILER-DAEMON@
126 * ^To: root@mail.prometheuslabor.com
127 * ^Subject:.*Undelivered
128 /dev/null
129
130 # discard AQMD mail
131 :0:
132 * ^From: usc.aqmd@usc.edu
133 * ^Subject:.*USC AQMD Survey
134 /dev/null
135
136 # discard no spam digest
137 :0:
138 * ^From: .*spam-control@illinois.edu
139 * ^Subject:.*End User Digest: 0 New Messages
140 /dev/null
141
142 # stuff for postmaster at my machines
143 :0:
144 * ^To: postmaster@
145 $POSTMASTER
146
147 # mail from people I don't want to see, because they annoy me
148 :0:
149 * ^From:.*rgm@gnu.org
150 $HOME/Mail/idiots
151
152 # Work around procmail bug: any output on stderr will cause the "F" in "From"
153 # to be dropped.  This will re-add it.
154 :0 H
155 * ! ^From[ ]
156 * ^rom[ ]
157 {
158   LOG="*** Dropped F off From_ header! Fixing up. "
159
160   :0 fhw
161   | sed -e 's/^rom /From /'
162 }
163
164 # Debian role accounts
165 :0:
166 * ^Delivered-To: (owner@bugs.debian.org)
167 bugs.debian.org/
168
169 :0:
170 * ^Delivered-To: .*listmaster@lists.debian.org
171 lists.debian.org/
172
173 :0:
174 * ^Delivered-To: .*lists-listmaster@bendel.debian.org
175 lists.debian.org/
176
177 # Buildds
178 :0:
179 * ^Return-Path:.*buildd@.*.donarmstrong.com
180 buildd.donarmstrong.com/
181
182 # OFTC stuff
183 :0:
184 * ^TO (oftc@spi-inc.org)
185 oftc/
186
187 # Chili ALRM
188 :0:
189 * ^Subject:\ (\[comment\])?\[ALRM\ \#
190 chili_alarm/
191
192 :0:
193 * ^From:\ nagios@nagios-global.lab.propel.com
194 chili_alarm/
195
196 #
197 :0:
198 * ^From:\ noreply@dragongoserver.net
199 lists/dragongo/
200
201 # discard all yahoogroups mail
202 # except for those to rsult (riverside ultimate)
203 :0:
204 * !^To:.*rsult@yahoogroups.com
205 * ^To:.*@yahoogroups.com
206 /dev/null
207
208
209 ###################
210 #  Mailing lists  #
211 ###################
212
213 :0:
214 * ^From:.*announcements@student.ucr.edu
215 lists/ucr-announcements
216
217 :0:
218 * ^List-Id: <stannounce2.lists.ucr.edu>
219 lists/ucr-announcements
220
221 :0:
222 * X-Mailing-List: <\/[^@]+
223 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
224
225 :0:
226 * ^Delivered-To: mailing list \/[^@]+
227 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
228
229 :0:
230 * ^Sender: owner-\/[^@]+
231 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
232
233 :0:
234 * ^Sender: +<?\/[^@]+-bounces?
235 lists/`echo $MATCH | sed -e 's/\-bounces*//g; s/\"//g; s/.*<//g; s/[\/]/_/g; y/A-Z/a-z/'`/
236
237 :0:   
238 * ^X-BeenThere: \/[^@]+
239 lists/`echo $MATCH | sed -e 's/<//g; s/[\/]/_/g'`/
240
241
242 # Dumb apache mailing lists
243 :0:
244 * ^List-Post: <mailto:\/[^@]+
245 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
246
247
248 # Debian's bug system uses X-Loop
249 :0:
250 * ^X-PTS-Package: \/.+
251 bugs/bug_reports
252
253 :0:
254 * ^X-Debian-PR-Source: \/.+
255 bugs/bug_reports
256
257 :0:
258 * ^X-Debian-PR-Package: \/.+
259 bugs/bug_reports
260
261 :0:
262 * ^X-Loop: owner@bugs.debian.org
263 bugs/bug_reports
264
265 :0:
266 * X-Loop: \/[^@]+
267 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
268
269 :0:
270 * X-ML-Name: \/[^@]+
271 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
272
273 # damn kernel back-to-frontness
274 :0:
275 * ^Sender:[      ]linux-kernel-owner@vger.kernel.org
276 lists/linux-kernel/
277
278 # linux-scsi
279 :0:
280 * ^Sender:[      ]linux-scsi-owner@vger.kernel.org
281 lists/linux-scsi/
282
283 # emacs-pretesters
284 :0:
285 * ^Sender:[      ]emacs-pretesters@gnu.org
286 lists/emacs-pretesters/
287
288 :0:
289 * ^Sender:.*GENE-ARRAYS@ITSSRV1.UCSF.EDU
290 lists/gene-arrays/
291
292 :0:
293 * ^Sender:.*scd-bounce@blars.org
294 lists/scd/
295
296 # broken lists using win32 software and NO LIST HEADER. Dumb.
297 :0:
298 * ^Sender: (Bugtraq|Incidents Mailing|VULN-DEV) List
299 lists/bugtraq/
300
301 #####################################
302 # Last rule:  Put mail into mailbox #
303 #####################################
304
305 :0:
306 $DEFAULT
307
308 # End of file