2 # User configuration file for procmail
10 SHELL=/bin/sh #Shell used to run procmail. Be sure this points to
11 #your system's copy of sh. DO NOT substitute a
12 #different shell unless you really know Unix
14 LINEBUF=4096 #Needed to keep Procmail from choking on long
15 #"recipes", or instructions on what to do with
16 #particular kinds of email.
18 PATH=$HOME/bin:$HOME/mail/bin:/bin:/usr/bin:/usr/local/bin
19 #Path for your programs -- this is probably best
22 VERBOSE=off #Change this to "on" when you try a new recipe
23 #so that Procmail will log literally every step
24 #it takes. DO NOT LEAVE IT ON, though, because
25 #it creates huge logfiles.
27 # Default Program & file locations
29 MAILDIR=${HOME}/Mail #you'd better make sure this directory exists
31 #ORGMAIL=/var/spool/mail/phd
34 LOGFILE=${MAILDIR}/procmail.log #Logs message disposition. Recommended -- otherwise
35 #errors are emailed to you. :/
37 SENDMAIL=/usr/sbin/sendmail #useful for autoreply recipes.
38 FORMAIL=/usr/bin/formail #useful for autoreply recipes.
41 MYEMAIL=${HOME}/mail/misc/.myemail #Tells Procmail where your MYEMAIL
42 #file is located, a text file containing all the
43 #email addresses you use.
45 ADMINFOLDER=${MAILDIR}/admin #for bounced mail, mail from root,
46 #postmaster, abuse, etc.
48 BLOCKFOLDER=${MAILDIR}/block #for suspicious mail, but possibly not spam
50 BULKFOLDER=${MAILDIR}/bulk #for bulk mail which appears legitimate, such
51 #as mail from mailing lists or mail sent using
54 SPAMFOLDER=${MAILDIR}/spam #change this to SPAMFOLDER=/dev/null
55 #to delete spam entirely.
57 VIRUSFOLDER=/dev/null #Set this variable to /dev/null to delete
58 #all viruses. You don't want to take chances with a virus,
59 #and the false positive rate on the virus filters is near zero.
64 # Create a backup cache of 2000 most recent messages in case of mistakes
69 | cd backup && rm -f dummy `ls -t msg.* | sed -e 1,2000d`
71 # Regenerate "From" lines to make sure they are valid
73 | ${FORMAIL} -I "From " -a "From "
76 # *CLOSED (only subscribers can write)* MAILING LISTS
77 # No need to filter them for spam
80 * ^(From|To|Cc|Reply-To): .*((mlug@unixcenter\.ru)|@altlinux\.ru)
84 * ^List-Id: Moscow Linux User Group <mlug\.UnixCenter\.RU>
88 * ^(To|Cc|Reply-To|Resent-To|X-BeenThere): .*(-list@(python\.org|cwi\.nl))
92 * ^Sender: .*@python\.org
96 * ^List-Id: .*<python-.*\.python\.org>
100 * ^Newsgroups: .*comp\.lang\.python
104 * ^From: sitelist-bounces@lists\.sourceforge\.net
105 * ^To: .*-owner@lists\.sourceforge\.net
106 * ^Subject: Uncaught bounce notification
110 * ^From: .*-bounces@lists\.sourceforge\.net
111 * ^To: .*-owner@lists\.sourceforge\.net
112 * ^Subject: Auto-discard notification
116 * ^List-Id: .+<sqlobject-(discuss|cvs)\.lists\.sourceforge\.net>
120 * ^To: "(\[sqlobject:(bugs|patches)\] )|(Ticket [0-9]+)" <[0-9]+@(bugs|patches)\.sqlobject\.p\.re\.sf\.net>
121 * ^Reply-To: "?(\\?\[sqlobject:(bugs|patches)\\?\] )|(Ticket [0-9]+)"? <[0-9]+@(bugs|patches)\.sqlobject\.p\.re\.sf\.net>
122 * ^Subject: (\[SQL-CVS\] )?\[sqlobject:(bugs|patches)\] (Re: )?\#[0-9]+
126 * ^From: "SQLObject Git repository" <noreply@(fullhistory|sqlobject|scripts)\.sqlobject\.p\.re\.sf\.net>
127 * ^To: "SQLObject Git repository" <noreply@(fullhistory|sqlobject|scripts)\.sqlobject\.p\.re\.sf\.net>
128 * ^Reply-To: "SQLObject Git repository" <noreply@(fullhistory|sqlobject|scripts)\.sqlobject\.p\.re\.sf\.net>
129 * ^Subject: \[sqlobject:(fullhistory|sqlobject|scripts)\]
133 * ^From: .+<notifications@github\.com>
134 * ^To: sqlobject/sqlobject <sqlobject@noreply\.github\.com>
135 * ^List-ID: sqlobject/sqlobject <sqlobject\.sqlobject\.github\.com>
139 * ^Sender: ppa-qps-devel-admin@lists\.sourceforge\.net
147 * ^Content-Transfer-Encoding: base64
148 * name( ?)=.*\.(com|exe|bat|scr|pif)
149 | ${FORMAIL} -A"X-Note: Klez" -A"X-Folder: Virus" >${VIRUSFOLDER}
153 * ^Subject: Re: (Movie|Application)$
154 * ^Content-Transfer-Encoding: base64
155 * ^Content-Disposition: attachment;
156 * filename=.your_details\.zip
157 | ${FORMAIL} -A"X-Note: Sobig.E" -A"X-Folder: Virus" >${VIRUSFOLDER}
161 * ^Subject: .*(Thank you!|Your application|That movie|Approved|Details|My details|Your details|Wicked screensaver)$
162 * ^X-MailScanner: Found to be clean$
163 | ${FORMAIL} -A"X-Note: Sobig.F" -A"X-Folder: Virus" >${VIRUSFOLDER}
168 * ^Subject: (test|hi|hello|Mail Delivery System|Mail Transaction Failed|Server Report|Status|Error|)$
169 * ^Content-type: application/octet-stream;
170 * (file)?name="(document|readme|doc|text|file|data|test|message|body)\.(pif|scr|exe|cmd|bat|zip)
171 | ${FORMAIL} -A"X-Note: MyDoom" -A"X-Folder: Virus" >${VIRUSFOLDER}
177 * ^Subject:[ ]*(hi|hello|read it immediately|\
178 something for you|warning|information|stolen|fake|unknown)
179 * B ?? ^(anything ok\?|what does it mean?|ok|\
180 i'm waiting|read the details\.|here is the document\.|\
181 read it immediately\!|my hero|\
182 here|is that true?|is that your name?|is that your account?|\
183 i wait for a reply\!|is that from you?|you are a bad writer|\
184 I have your password\!|something about you\!|\
185 kill the writer of this document\!|i hope it is not true\!|\
186 your name is wrong|i found this document about you|\
187 yes, really\?|that is bad|here it is|see you|\
188 greetings|stuff about you\?|something is going wrong!|\
189 information about you|about me|from the chatter|\
190 here, the serials|here, the introduction|here, the cheats|\
191 that's funny|do you\?|reply|take it easy|why\?|\
192 thats wrong|misc|you earn money|you feel the same|\
193 you try to steal|you are bad|something is going wrong|\
195 * B ?? ^(Content-Disposition:[ ]*attachment;)?[ ]*(file)?name="?(document|msg|doc|talk|message|creditcard|\
196 details|attachment|me|stuff|posting|textfile|concert|\
197 information|note|bill|swimmingpool|product|\
198 topseller|ps|shower|aboutyou|nomoney| found|\
199 story|mails|website|friend|jokes|location|\
200 final|release|dinner|ranking|object|mail2|part2|\
201 disco|party|misc)\..*(zip|exe|scr|com|pif)"?$
202 | ${FORMAIL} -A"X-Note: Netsky" -A"X-Folder: Virus" >${VIRUSFOLDER}
206 * ^Subject:(.*E-mail account disabling warning)|\
207 (.*E-mail account security warning)|\
208 (.*Email account utilization warning)|\
209 (.*Important notify about your e-mail account)|\
210 (.*Notify about using the e-mail account)|\
211 (.*Notify about your e-mail account utilization)|\
212 (.*Warning about your e-mail account)
213 * B ?? ^Content-Type: application/octet-stream;
214 * B ?? ^Content-Transfer-Encoding: base64
215 * B ?? ^Content-Disposition: attachment;
216 | ${FORMAIL} -A"X-Note: Bagle.J" -A"X-Folder: Virus" >${VIRUSFOLDER}
219 # From http://www.internetguru.com.au/igblog-102.html
221 # Redirect common virus attachments inc. zipped versions
223 * name=.*(document|readme|doc|text|file|data|test|message|body)\.(vbs\"|wsf\"|vbe\"|wsh\"|hta\"|scr\"|pif\"|exe\"|shs\"|bat\"|bas\"|cmd\"|zip\")
226 | ${FORMAIL} -A"X-Note: executable attachment virus" -A"X-Folder: Virus" >>${VIRUSFOLDER}
229 # Some more common virus attachments inc. zipped versions
231 * name=.*(Attach|Information|Readme|Document|Info|TextDocument|Textfile|MoreInfo|Message)\.(pif\"|zip\")
234 | ${FORMAIL} -A"X-Note: executable attachment virus" -A"X-Folder: Virus" >>${VIRUSFOLDER}
237 # Redirect windows executables (note - haven't included exe and com
239 * name=.*\.(vbs\"|wsf\"|vbe\"|wsh\"|hta\"|scr\"|pif\"|shs\"|bat\"|bas\"|scr\"|dll\")
242 | ${FORMAIL} -A"X-Note: executable attachment virus" -A"X-Folder: Virus" >>${VIRUSFOLDER}
245 # This one finds them annoying Custom Logo spams that seem to get past most filters
247 * .*out\.php\?email\=(sales|info)\@
250 | ${FORMAIL} -A"X-Note: Custom Logo spam" -A"X-Folder: Spam" >>${SPAMFOLDER}
253 # This catches about 99% of deliberate viagra mispellings ie v1@GRa, v1agr@ etc
255 * ^Subject.*[Vv][1jl\|][aA\@][Gg][Rr][Aa\@]
258 | ${FORMAIL} -A"X-Note: viagra spam" -A"X-Folder: Spam" >/dev/null
262 # Chineese/japaneese/korean spam
265 * ^Content-Type: text/(plain|html); *charset=("?)(big5|gb2312|iso-2022-jp|ks_c_5601-1987|shift_jis)("?)
266 | ${FORMAIL} -A"X-Note: chineese/japaneese/korean charset" -A"X-Folder: Spam" >/dev/null
269 * ^X-RBL-Warning: .*(china|korea) does not seem to care about spam
270 | ${FORMAIL} -A"X-Note: chineese/korean source" -A"X-Folder: Spam" >>${SPAMFOLDER}
273 # SpamAssassin (spamassassin.org)
276 | spamc -U /tmp/spamassassin.sock -s 10240000
279 # Mail with a score of 14 or higher is certainly spam
281 * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*
282 | ${FORMAIL} -A"X-Note: certainly spam" -A"X-Folder: Spam" >/dev/null
285 * ^X-Spam-Status: Yes
287 | ${FORMAIL} -A"X-Note: oversized spam" -A"X-Folder: Spam" >/dev/null
290 * ^X-Spam-Status: Yes
291 * http://www\.gstinc\.com/
292 | ${FORMAIL} -A"X-Note: gstinc spam" -A"X-Folder: Spam" >/dev/null
295 * ^X-Spam-Status: Yes
296 * (www\.)?sonidom\.ru
297 | ${FORMAIL} -A"X-Note: sonidom spam" -A"X-Folder: Spam" >/dev/null
300 * ^X-Spam-Status: Yes
301 * (www\.)?pos-tel\.ru
302 | ${FORMAIL} -A"X-Note: pos-tel spam" -A"X-Folder: Spam" >/dev/null
305 * ^X-Spam-Status: Yes
307 | ${FORMAIL} -A"X-Note: besttraining spam" -A"X-Folder: Spam" >/dev/null
310 * ^X-Spam-Status: Yes
316 # Filter out mail from all mailing lists you are on. Just duplicate the recipe
317 # for each mailing list you are on, and put the correct address for the list in
318 # the condition statement. (The "* ^TO" part.) If you read mail on shell, you
319 # may find it easier to deliver this mail to separate folders, especially for
320 # busy lists. I do. :)
323 # Block all messages that are too big
326 | ${FORMAIL} -A"X-Note: the message is too big" -A"X-Folder: Block" >>${BLOCKFOLDER}
329 # unfiltered mail marked by exim (using RBL/ORBS/etc)
341 # Sort out mail that really is to you from mail Bcc'd to you, or mail
342 # which doesn't have any of your email addresses on the To: or Cc: line.
343 # For this to work properly, you must create a text file named .myemail
344 # in your home directory and enter all email addresses that belong to
345 # you in it, one per line, just as you do with your .nobounce file.
347 # This does =wonders= in keeping spam from appearing in your personal
350 # Substitute your shell account email address, custom domain, and any other email
351 # address you may have for the entries below.
353 * ? test -f ${MYEMAIL} && \
354 (${FORMAIL} -zxTo: -zxCc: |\
355 fgrep -i -f ${MYEMAIL})
356 | ${FORMAIL} -A"X-Folder: Default" >>${DEFAULT}
358 # Deliver email which passed spam filtering, but which wasn't sent to
359 # a recognizable personal email address of yours, to your "bulk mail"
360 # folder, for reading on a less-urgent basis.
362 | ${FORMAIL} -A"X-Folder: Bulk" >>${BULKFOLDER}
365 # Vacation - modified version of procmail example from "man procmailex"
369 #| ${FORMAIL} -D 65536 msgid.cache
371 #:0 Whc: vacation.lock
375 #* !^X-Loop: phd@phdru.name
376 #* !^X-Loop: phd@iskra.aviel.ru
377 #* !^From: "AviTicket" <support@aviel\.ru>
378 #* !^From: .* <lj_notify@livejournal\.com>
379 #* !^From: .*report_card@sbrf.ru
380 #| ${FORMAIL} -rD 65536 vacation.cache
382 #:0 ehc # if the name was not in the cache - reply
383 #| (egrep -v '^From phd|^Return-Path: phd' | \
384 # ${FORMAIL} -r -A"Precedence: junk" \
385 # -A"X-Loop: phd@phdru.name" -A"X-Loop: phd@iskra.aviel.ru" \
386 # -A"Content-Type: text/plain; charset=koi8-r"; \
387 # echo "Hello!"; echo "";\
388 # echo " I am on vacation. This is an auto-generated reply. Your message has been"; \
389 # echo "delivered to my mailbox. Thanks a lot. I will read it after 0th of ."; \
391 # echo "Здравствуйте."; echo ""; \
392 # echo " Я уехал в отпуск. Это автоматический ответ. Ваше сообщение было доставлено."; \
393 # echo "в мой почтовый ящик. Большое спасибо. Я прочту его, когда вернусь 0 ."; \
394 # echo ""; cat $HOME/.signature) | $SENDMAIL -oi -t