]> git.donarmstrong.com Git - remote_mail.git/blob - .procmailrc
* filter out ucr-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
28 # A list (one per line) of people I KNOW are spammers :-)
29 # can match any part of name so you can use fred, fred@aol.com or aol.com to
30 # match a user, mail address or domain.
31 # Note that this file is case-insensitive.
32 SPAMMERS=$HOME/.procmail/spammers
33
34 # name of the file containing a list of people we
35 # always want to get mail from, one per line.  If
36 # any substring of the From: or Sender: line matches
37 # a line of this file, it will go through, so this
38 # can be used to denote entire sites that we always
39 # wish to get mail from as well as individuals.
40 # E.g. "user", "user@aol.com" or "aol.com".
41 # Note that this file is case-insensitive.
42 # Putting all of the people or lists you get lots
43 # of mail from here will not only insure you get
44 # it, but will speed up procmail.
45 FRIENDS=$HOME/.procmail/friends
46
47 # ======================================
48 # Preventing duplicates using 16Kb cache
49 # They get shoved in duplicates folder
50 #:0 Whc: .msgid.lock
51 #| formail -D 16384 msgid.cache.new
52 #:0 a:
53 #/dev/null
54
55 :0 H
56 * ^Subject:.*Rnm-devel moderator request
57 /dev/null
58
59 :0 H
60 * ^Subject:.*Cron.*debbugs@master
61 /dev/null
62
63
64 # Handle delay messages
65 :0 Hc
66 * !Message-Id: .*delay[0-9]+@
67 * ^TO \/don\+de[^@]+
68 $HOME/Mail/delay
69
70 :0 Hhbw
71 * !Message-Id: .*delay[0-9]+@
72 * ^TO \/don\+delay\+[^@]+
73 |/home/don/bin/delay_mail --mailto don@donarmstrong.com --enqueue --email --delay $MATCH
74
75 # Convert old-style PGP messages to MIME
76 :0
77 * !^Content-Type: multipart/
78 * !^Content-Type: application/pgp
79 {
80     :0 fBw
81     * ^-----BEGIN PGP MESSAGE-----
82     * ^-----END PGP MESSAGE-----
83     | formail \
84         -i "Content-Type: application/pgp; format=text; x-action=encrypt"
85
86     :0 fBw
87     * ^-----BEGIN PGP SIGNED MESSAGE-----
88     * ^-----BEGIN PGP SIGNATURE-----
89     * ^-----END PGP SIGNATURE-----
90     | formail \
91         -i "Content-Type: application/pgp; format=text; x-action=sign"
92 }
93
94 :0:
95 * ! ? (formail -x From: -x Sender: | fgrep -iqf $FRIENDS)
96 {
97
98 # Mails with a score of 15 or higher are almost certainly spam
99 :0:
100 * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
101 #definetly_spam
102 /dev/null
103
104 # Mails that are clearly spam, but we don't want to toss immediately
105 :0:
106 * ^X-Spam-Level: \*\*\*\*\*\*\*\*
107 $HIGHSPAM
108
109 # All mail tagged as spam (eg. with a score higher than the set threshold)
110 # is moved to "probably-spam".
111 :0:
112 * ^X-Spam-Status: Yes
113 $SPAM
114
115
116 # I get joe-jobbed a lot; if a message is from a mailer, but not from
117 # one of mine, discard it.
118 :0:
119 * (^(((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 ][^<)]*(\(.*\).*)?)?$([^>]|$))
120 * !^From:.+(ucr|debian|donarmstrong|sndservers|ccin|schedulesdirect)
121 * !^From:.+(schedulesdirect|paypal.com)
122 * !^To:.+ (don\+.+\@donarmstrong\.com)
123 * !^List-.+
124 $JOEJOB
125
126 # Work around procmail bug: any output on stderr will cause the "F" in "From"
127 # to be dropped.  This will re-add it.
128 :0 H
129 * ! ^From[ ]
130 * ^rom[ ]
131 {
132   LOG="*** Dropped F off From_ header! Fixing up. "
133
134   :0 fhw
135   | sed -e 's/^rom /From /'
136 }
137
138
139
140
141 # Debian role accounts
142
143 :0:
144 * ^Delivered-To: (owner@bugs.debian.org)
145 bugs.debian.org/
146
147 :0:
148 * ^Delivered-To: (listmaster@lists.debian.org)
149 lists.debian.org/
150
151
152 # OFTC stuff
153 :0:
154 * ^TO (oftc@spi-inc.org)
155 oftc/
156
157 # Chili ALRM
158 :0:
159 * ^Subject:\ (\[comment\])?\[ALRM\ \#
160 chili_alarm/
161
162 :0:
163 * ^From:\ nagios@nagios-global.lab.propel.com
164 chili_alarm/
165
166 #
167 :0:
168 * ^From:\ noreply@dragongoserver.net
169 lists/dragongo/
170
171 ###################
172 #  Mailing lists  #
173 ###################
174
175 :0:
176 * ^To: \+announce@student.ucr.edu
177 * ^List-Id: <stannounce2.lists.ucr.edu>
178 lists/ucr-announcements
179
180 :0:
181 * X-Mailing-List: <\/[^@]+
182 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
183
184 :0:
185 * ^Delivered-To: mailing list \/[^@]+
186 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
187
188 :0:
189 * ^Sender: owner-\/[^@]+
190 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
191
192 :0:
193 * ^Sender: \/[^@]+-bounces?
194 lists/`echo $MATCH | sed -e 's/\-bounces*//g; s/[\/]/_/g'`/
195
196 :0:   
197 * ^X-BeenThere: \/[^@]+
198 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
199
200
201 # Dumb apache mailing lists
202 :0:
203 * ^List-Post: <mailto:\/[^@]+
204 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
205
206
207 # Debian's bug system uses X-Loop
208 8
209 :0:
210 * ^X-PTS-Package: \/.+
211 bugs/`echo $MATCH |sed -e 's/[\/]/_/g'`/
212
213 :0:
214 * ^X-Debian-PR-Package: \/.+
215 bugs/`echo $MATCH |sed -e 's/[\/]/_/g'`/
216
217 :0:
218 * ^X-Loop: owner@bugs.debian.org
219 bugs/control_messages/
220
221 :0:
222 * X-Loop: \/[^@]+
223 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
224
225 :0:
226 * X-ML-Name: \/[^@]+
227 lists/`echo $MATCH | sed -e 's/[\/]/_/g'`/
228
229 # damn kernel back-to-frontness
230 :0:
231 * ^Sender:[      ]linux-kernel-owner@vger.kernel.org
232 lists/linux-kernel/
233
234 # linux-scsi
235 :0:
236 * ^Sender:[      ]linux-scsi-owner@vger.kernel.org
237 lists/linux-scsi/
238
239 # emacs-pretesters
240 :0:
241 * ^Sender:[      ]emacs-pretesters@gnu.org
242 lists/emacs-pretesters/
243
244 :0:
245 * ^Sender:.*GENE-ARRAYS@ITSSRV1.UCSF.EDU
246 lists/gene-arrays/
247
248 :0:
249 * ^Sender:.*scd-bounce@blars.org
250 lists/scd/
251
252 # broken lists using win32 software and NO LIST HEADER. Dumb.
253 :0:
254 * ^Sender: (Bugtraq|Incidents Mailing|VULN-DEV) List
255 lists/bugtraq/
256
257 #####################################
258 # Last rule:  Put mail into mailbox #
259 #####################################
260
261 :0:
262 $DEFAULT
263
264 # End of file