]> git.donarmstrong.com Git - remote_mail.git/blob - .procmailrc
9aa6270bce240a77903f4eeb63c44a42d917b209
[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
70 # Handle delay messages
71 :0 Hc
72 * !Message-Id: .*delay[0-9]+@
73 * ^TO \/don\+delay\+[^@]+
74 $HOME/Mail/delay
75
76 :0 Hhbw
77 * !Message-Id: .*delay[0-9]+@
78 * ^TO \/don\+delay\+[^@]+
79 |/home/don/bin/delay_mail --mailto don@donarmstrong.com --enqueue --email --delay $MATCH
80
81 # Convert old-style PGP messages to MIME
82 :0
83 * !^Content-Type: multipart/
84 * !^Content-Type: application/pgp
85 {
86     :0 fBw
87     * ^-----BEGIN PGP MESSAGE-----
88     * ^-----END PGP MESSAGE-----
89     | formail \
90         -i "Content-Type: application/pgp; format=text; x-action=encrypt"
91
92     :0 fBw
93     * ^-----BEGIN PGP SIGNED MESSAGE-----
94     * ^-----BEGIN PGP SIGNATURE-----
95     * ^-----END PGP SIGNATURE-----
96     | formail \
97         -i "Content-Type: application/pgp; format=text; x-action=sign"
98 }
99
100 :0:
101 * ! ? (formail -x From: -x Sender: | fgrep -iqf $FRIENDS)
102 {
103
104 # Mails with a score of 15 or higher are almost certainly spam
105 :0:
106 * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
107 #definetly_spam
108 /dev/null
109
110 # Mails that are clearly spam, but we don't want to toss immediately
111 :0:
112 * ^X-Spam-Level: \*\*\*\*\*\*\*\*
113 $HIGHSPAM
114
115 # All mail tagged as spam (eg. with a score higher than the set threshold)
116 # is moved to "probably-spam".
117 :0:
118 * ^X-Spam-Status: Yes
119 $SPAM
120
121
122 # I get joe-jobbed a lot; if a message is from a mailer, but not from
123 # one of mine, discard it.
124 :0:
125 * (^(((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 ][^<)]*(\(.*\).*)?)?$([^>]|$)
126 * ^Subject:.*(Mail delivery failed|Returned mail|Undelivered Mail)
127 * !^From:.+(ucr|debian|donarmstrong|sndservers|ccin|schedulesdirect|prometheuslabor.com)
128 * !^From:.+(schedulesdirect|paypal.com)
129 * !^To:.+ (don\+.+\@(donarmstrong\.com|debian\.org|rzlab\.ucr\.edu))
130 * !^List-.+
131 * !^X-Diagnostic:
132 $JOEJOB
133
134 }
135
136 # discard bounces from dumb mailing lists on prometheuslabor
137 :0:
138 * ^From: MAILER-DAEMON@
139 * ^To: root@mail.prometheuslabor.com
140 * ^Subject:.*Undelivered
141 /dev/null
142
143 # discard AQMD mail
144 :0:
145 * ^From: usc.aqmd@usc.edu
146 * ^Subject:.*USC AQMD Survey
147 /dev/null
148
149 # stuff for postmaster at my machines
150 :0:
151 * ^To: postmaster@
152 $POSTMASTER
153
154 # mail from people I don't want to see, because they annoy me
155 :0:
156 * ^From:.*rgm@gnu.org
157 $HOME/Mail/idiots
158
159 # Work around procmail bug: any output on stderr will cause the "F" in "From"
160 # to be dropped.  This will re-add it.
161 :0 H
162 * ! ^From[ ]
163 * ^rom[ ]
164 {
165   LOG="*** Dropped F off From_ header! Fixing up. "
166
167   :0 fhw
168   | sed -e 's/^rom /From /'
169 }
170
171 # Debian role accounts
172 :0:
173 * ^Delivered-To: (owner@bugs.debian.org)
174 bugs.debian.org/
175
176 :0:
177 * ^Delivered-To: (lists-listmaster@lists.debian.org)
178 lists.debian.org/
179
180 # Buildds
181 :0:
182 * ^Return-Path:.*buildd@.*.donarmstrong.com
183 buildd.donarmstrong.com/
184
185 # OFTC stuff
186 :0:
187 * ^TO (oftc@spi-inc.org)
188 oftc/
189
190 # Chili ALRM
191 :0:
192 * ^Subject:\ (\[comment\])?\[ALRM\ \#
193 chili_alarm/
194
195 :0:
196 * ^From:\ nagios@nagios-global.lab.propel.com
197 chili_alarm/
198
199 #
200 :0:
201 * ^From:\ noreply@dragongoserver.net
202 lists/dragongo/
203
204 # discard all yahoogroups mail
205 # except for those to rsult (riverside ultimate)
206 :0:
207 * !^To:.*rsult@yahoogroups.com
208 * ^To:.*@yahoogroups.com
209 /dev/null
210
211
212 ###################
213 #  Mailing lists  #
214 ###################
215
216 :0:
217 * ^From:.*announcements@student.ucr.edu
218 lists/ucr-announcements
219
220 :0:
221 * ^List-Id: <stannounce2.lists.ucr.edu>
222 lists/ucr-announcements
223
224 :0:
225 * X-Mailing-List: <\/[^@]+
226 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
227
228 :0:
229 * ^Delivered-To: mailing list \/[^@]+
230 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
231
232 :0:
233 * ^Sender: owner-\/[^@]+
234 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
235
236 :0:
237 * ^Sender: +<?\/[^@]+-bounces?
238 lists/`echo $MATCH | sed -e 's/\-bounces*//g; s/\"//g; s/.*<//g; s/[\/]/_/g; y/A-Z/a-z/'`/
239
240 :0:   
241 * ^X-BeenThere: \/[^@]+
242 lists/`echo $MATCH | sed -e 's/<//g; s/[\/]/_/g'`/
243
244
245 # Dumb apache mailing lists
246 :0:
247 * ^List-Post: <mailto:\/[^@]+
248 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
249
250
251 # Debian's bug system uses X-Loop
252 :0:
253 * ^X-PTS-Package: \/.+
254 bugs/`echo $MATCH |sed -e 's/[\/]/_/g'`/
255
256 :0:
257 * ^X-Debian-PR-Source: \/.+
258 bugs/`echo $MATCH |sed -e 's/[\/]/_/g'`/
259
260 :0:
261 * ^X-Debian-PR-Package: \/.+
262 bugs/`echo $MATCH |sed -e 's/[\/]/_/g'`/
263
264 :0:
265 * ^X-Loop: owner@bugs.debian.org
266 bugs/control_messages/
267
268 :0:
269 * X-Loop: \/[^@]+
270 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
271
272 :0:
273 * X-ML-Name: \/[^@]+
274 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
275
276 # damn kernel back-to-frontness
277 :0:
278 * ^Sender:[      ]linux-kernel-owner@vger.kernel.org
279 lists/linux-kernel/
280
281 # linux-scsi
282 :0:
283 * ^Sender:[      ]linux-scsi-owner@vger.kernel.org
284 lists/linux-scsi/
285
286 # emacs-pretesters
287 :0:
288 * ^Sender:[      ]emacs-pretesters@gnu.org
289 lists/emacs-pretesters/
290
291 :0:
292 * ^Sender:.*GENE-ARRAYS@ITSSRV1.UCSF.EDU
293 lists/gene-arrays/
294
295 :0:
296 * ^Sender:.*scd-bounce@blars.org
297 lists/scd/
298
299 # broken lists using win32 software and NO LIST HEADER. Dumb.
300 :0:
301 * ^Sender: (Bugtraq|Incidents Mailing|VULN-DEV) List
302 lists/bugtraq/
303
304 #####################################
305 # Last rule:  Put mail into mailbox #
306 #####################################
307
308 :0:
309 $DEFAULT
310
311 # End of file