]> git.donarmstrong.com Git - remote_mail.git/blob - .procmailrc
update joejob procmail rule
[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 * !^From:.+(ucr|debian|donarmstrong|sndservers|ccin|schedulesdirect|promtheuslabor.com)
127 * !^From:.+(schedulesdirect|paypal.com)
128 * !^To:.+ (don\+.+\@(donarmstrong\.com|debian\.org|rzlab\.ucr\.edu))
129 * !^List-.+
130 * !^X-Diagnostic:
131 $JOEJOB
132
133 # stuff for postmaster at my machines
134 :0:
135 * ^To: postmaster@
136 $POSTMASTER
137
138 # mail from people I don't want to see, because they annoy me
139 :0:
140 * ^From:.*rgm@gnu.org
141 $HOME/Mail/idiots
142
143 # Work around procmail bug: any output on stderr will cause the "F" in "From"
144 # to be dropped.  This will re-add it.
145 :0 H
146 * ! ^From[ ]
147 * ^rom[ ]
148 {
149   LOG="*** Dropped F off From_ header! Fixing up. "
150
151   :0 fhw
152   | sed -e 's/^rom /From /'
153 }
154
155 # Debian role accounts
156 :0:
157 * ^Delivered-To: (owner@bugs.debian.org)
158 bugs.debian.org/
159
160 :0:
161 * ^Delivered-To: (listmaster@lists.debian.org)
162 lists.debian.org/
163
164 # Buildds
165 :0:
166 * ^Return-Path:.*buildd@.*.donarmstrong.com
167 buildd.donarmstrong.com/
168
169 # OFTC stuff
170 :0:
171 * ^TO (oftc@spi-inc.org)
172 oftc/
173
174 # Chili ALRM
175 :0:
176 * ^Subject:\ (\[comment\])?\[ALRM\ \#
177 chili_alarm/
178
179 :0:
180 * ^From:\ nagios@nagios-global.lab.propel.com
181 chili_alarm/
182
183 #
184 :0:
185 * ^From:\ noreply@dragongoserver.net
186 lists/dragongo/
187
188 # discard all yahoogroups mail
189 # except for those to rsult (riverside ultimate)
190 :0:
191 * !^To:.*rsult@yahoogroups.com
192 * ^To:.*@yahoogroups.com
193 /dev/null
194
195
196 ###################
197 #  Mailing lists  #
198 ###################
199
200 :0:
201 * ^From:.*announcements@student.ucr.edu
202 lists/ucr-announcements
203
204 :0:
205 * ^List-Id: <stannounce2.lists.ucr.edu>
206 lists/ucr-announcements
207
208 :0:
209 * X-Mailing-List: <\/[^@]+
210 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
211
212 :0:
213 * ^Delivered-To: mailing list \/[^@]+
214 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
215
216 :0:
217 * ^Sender: owner-\/[^@]+
218 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
219
220 :0:
221 * ^Sender: +<?\/[^@]+-bounces?
222 lists/`echo $MATCH | sed -e 's/\-bounces*//g; s/.*<//g; s/[\/]/_/g; y/A-Z/a-z/'`/
223
224 :0:   
225 * ^X-BeenThere: \/[^@]+
226 lists/`echo $MATCH | sed -e 's/<//g; s/[\/]/_/g'`/
227
228
229 # Dumb apache mailing lists
230 :0:
231 * ^List-Post: <mailto:\/[^@]+
232 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
233
234
235 # Debian's bug system uses X-Loop
236 :0:
237 * ^X-PTS-Package: \/.+
238 bugs/`echo $MATCH |sed -e 's/[\/]/_/g'`/
239
240 :0:
241 * ^X-Debian-PR-Source: \/.+
242 bugs/`echo $MATCH |sed -e 's/[\/]/_/g'`/
243
244 :0:
245 * ^X-Debian-PR-Package: \/.+
246 bugs/`echo $MATCH |sed -e 's/[\/]/_/g'`/
247
248 :0:
249 * ^X-Loop: owner@bugs.debian.org
250 bugs/control_messages/
251
252 :0:
253 * X-Loop: \/[^@]+
254 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
255
256 :0:
257 * X-ML-Name: \/[^@]+
258 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
259
260 # damn kernel back-to-frontness
261 :0:
262 * ^Sender:[      ]linux-kernel-owner@vger.kernel.org
263 lists/linux-kernel/
264
265 # linux-scsi
266 :0:
267 * ^Sender:[      ]linux-scsi-owner@vger.kernel.org
268 lists/linux-scsi/
269
270 # emacs-pretesters
271 :0:
272 * ^Sender:[      ]emacs-pretesters@gnu.org
273 lists/emacs-pretesters/
274
275 :0:
276 * ^Sender:.*GENE-ARRAYS@ITSSRV1.UCSF.EDU
277 lists/gene-arrays/
278
279 :0:
280 * ^Sender:.*scd-bounce@blars.org
281 lists/scd/
282
283 # broken lists using win32 software and NO LIST HEADER. Dumb.
284 :0:
285 * ^Sender: (Bugtraq|Incidents Mailing|VULN-DEV) List
286 lists/bugtraq/
287
288 #####################################
289 # Last rule:  Put mail into mailbox #
290 #####################################
291
292 :0:
293 $DEFAULT
294
295 # End of file