]> git.donarmstrong.com Git - remote_mail.git/blob - .procmailrc
* sort out mail from the student announcements
[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\+de[^@]+
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 # Work around procmail bug: any output on stderr will cause the "F" in "From"
133 # to be dropped.  This will re-add it.
134 :0 H
135 * ! ^From[ ]
136 * ^rom[ ]
137 {
138   LOG="*** Dropped F off From_ header! Fixing up. "
139
140   :0 fhw
141   | sed -e 's/^rom /From /'
142 }
143
144
145
146
147 # Debian role accounts
148
149 :0:
150 * ^Delivered-To: (owner@bugs.debian.org)
151 bugs.debian.org/
152
153 :0:
154 * ^Delivered-To: (listmaster@lists.debian.org)
155 lists.debian.org/
156
157
158 # OFTC stuff
159 :0:
160 * ^TO (oftc@spi-inc.org)
161 oftc/
162
163 # Chili ALRM
164 :0:
165 * ^Subject:\ (\[comment\])?\[ALRM\ \#
166 chili_alarm/
167
168 :0:
169 * ^From:\ nagios@nagios-global.lab.propel.com
170 chili_alarm/
171
172 #
173 :0:
174 * ^From:\ noreply@dragongoserver.net
175 lists/dragongo/
176
177 ###################
178 #  Mailing lists  #
179 ###################
180
181 :0:
182 * ^From:.*announcements@student.ucr.edu
183 lists/ucr-announcements
184
185 :0:
186 * ^List-Id: <stannounce2.lists.ucr.edu>
187 lists/ucr-announcements
188
189 :0:
190 * X-Mailing-List: <\/[^@]+
191 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
192
193 :0:
194 * ^Delivered-To: mailing list \/[^@]+
195 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
196
197 :0:
198 * ^Sender: owner-\/[^@]+
199 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
200
201 :0:
202 * ^Sender: \/[^@]+-bounces?
203 lists/`echo $MATCH | sed -e 's/\-bounces*//g; s/[\/]/_/g'`/
204
205 :0:   
206 * ^X-BeenThere: \/[^@]+
207 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
208
209
210 # Dumb apache mailing lists
211 :0:
212 * ^List-Post: <mailto:\/[^@]+
213 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
214
215
216 # Debian's bug system uses X-Loop
217 8
218 :0:
219 * ^X-PTS-Package: \/.+
220 bugs/`echo $MATCH |sed -e 's/[\/]/_/g'`/
221
222 :0:
223 * ^X-Debian-PR-Package: \/.+
224 bugs/`echo $MATCH |sed -e 's/[\/]/_/g'`/
225
226 :0:
227 * ^X-Loop: owner@bugs.debian.org
228 bugs/control_messages/
229
230 :0:
231 * X-Loop: \/[^@]+
232 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
233
234 :0:
235 * X-ML-Name: \/[^@]+
236 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
237
238 # damn kernel back-to-frontness
239 :0:
240 * ^Sender:[      ]linux-kernel-owner@vger.kernel.org
241 lists/linux-kernel/
242
243 # linux-scsi
244 :0:
245 * ^Sender:[      ]linux-scsi-owner@vger.kernel.org
246 lists/linux-scsi/
247
248 # emacs-pretesters
249 :0:
250 * ^Sender:[      ]emacs-pretesters@gnu.org
251 lists/emacs-pretesters/
252
253 :0:
254 * ^Sender:.*GENE-ARRAYS@ITSSRV1.UCSF.EDU
255 lists/gene-arrays/
256
257 :0:
258 * ^Sender:.*scd-bounce@blars.org
259 lists/scd/
260
261 # broken lists using win32 software and NO LIST HEADER. Dumb.
262 :0:
263 * ^Sender: (Bugtraq|Incidents Mailing|VULN-DEV) List
264 lists/bugtraq/
265
266 #####################################
267 # Last rule:  Put mail into mailbox #
268 #####################################
269
270 :0:
271 $DEFAULT
272
273 # End of file