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