MFHughes.com


Fat Santa

You are in: Home - Writing - Procmail

Procmail recipes for controlling email spam

Oh lovely spam, how I hate you. After some time, trial and error, I found a way of reducing the spam problem with the hosting I get on a rented Apache server. At first I couldn't understand why the rules below didn't work, but I discovered that Unix doesn't like a "Windows" textfile generated in Notepad. It needs to be a more "Unix" text file, so I used Crimson Editor which does the job just fine. Don't ask me what the difference is, I just know that one works and the other does not. The first rule, regarding discount this that and other, will clear out a lot of incoming junk, and it's the most useful of the lot below. Just make a textfile with the content below, and save into your mail home directory as .procmailrc A typical location would be usr/local/home/username/.procmailrc where username is the name of the email account you want to affect.

At least now I should get some peace from those bloody "replica" watch people.

LOGFILE=log.procmail_log

This fantastic rule needs to be all on one line, I have had to break it here to fit into a normal web page. Remove the carriage return before the second asterisk
:0:
* ^Subject: .*(discount|discounts|cheap|elegant|classy|magnificent|designer|luxury|branded|chanel|wholesale|popular|quality|perrelet|genuine).
*(watches|clocks|boots|shoes|bags|brands|pens|items|brands|footwear|goods|watch|pills|drugs|software|medicine)
/dev/null

:0:
* ^(Subject).*penis
/dev/null
:0:
* !^Message-Id
/dev/null
:0:
* ^(Subject).*rolex
/dev/null
:0:
* ^(Subject).*bulgari
/dev/null
:0:
* ^(Subject).*breitling
/dev/null
:0:
* ^(Subject).*replica
/dev/null
:0:
* ^(Subject).*viagra
/dev/null
:0:
* ^(Subject).*heuer
/dev/null
:0:
* ^(Subject).*sexual
/dev/null
:0:
* ^(Subject).*pharmacy
/dev/null
:0:
* ^(Subject).*consolidation
/dev/null
:0:
* ^(Subject).*timepiece
/dev/null
:0:
* ^(Subject).*drugstore
/dev/null
:0:
* ^(Subject).*autocad
/dev/null
:0:
* ^(Subject).*medication
/dev/null
:0:
* ^(Subject).*herbals
/dev/null
:0:
* ^(Subject).*To: michael
/dev/null
:0:
* ^(Subject).*Excel 2007
/dev/null
:0:
* ^(Subject).*100mg
/dev/null
:0:
* ^(Subject).*50mg
/dev/null
:0:
* ^(Subject).*time pieces
/dev/null
:0:
* ^(Subject).*vyagra
/dev/null
:0:
* ^(Subject).*bargain prices
/dev/null
:0:
* ^(Subject).*Office 2007
/dev/null
:0:
* ^(Subject).*manhood
/dev/null
:0:
* ^(Subject).*pharmaceuticals
/dev/null
:0:
* ^(Subject).*enlargement
/dev/null
:0:
* ^(Subject).*cialis
/dev/null
:0:
* ^(Subject).*ciallis
/dev/null
:0:
* ^(Subject).*c1alis
/dev/null
:0:
* ^(Subject).*luxury designer
/dev/null
:0:
* ^(Subject).*Lloyds Bank
/dev/null
:0:
* ^(Subject).*time-pieces
/dev/null
:0:
* ^(Subject).*(ejaculation|cyalis)
/dev/null
:0:
* ^(Subject).*blackjack
/dev/null
:0:
* ^(Subject).*80%
/dev/null
:0:
* ^(Subject).*95%
/dev/null
:0:
* ^(Subject).*85%
/dev/null
:0:
* ^(Subject).*87%
/dev/null
:0:
* ^(Subject).*100%
/dev/null
:0:
* ^(Subject).*cartier
/dev/null
:0:
* ^(Subject).*hermes
/dev/null
:0:
* ^(Subject).*73%
/dev/null
:0:
* ^(Subject).*debt free
/dev/null
:0:
* ^(Subject).*visa line
/dev/null
:0:
* ^(Subject).*meds discount
/dev/null
:0:
* ^(Subject).*office enterprize
/dev/null
:0:
* ^Subject: .*(debt).*(relief|analysis|management)
/dev/null
:0:
* ^Subject: .*(blue).*(pill)
/dev/null
:0:
* ^(Subject).*franck muller
/dev/null
:0:
* ^(Subject).*downloadable porno
/dev/null
:0:
* ^(Subject).*gucci
/dev/null
:0:
* ^(Subject).*herbal pills
/dev/null
:0:
* ^(Subject).*orgasm
/dev/null
:0:
* ^(Subject).*oyster perpetual
/dev/null
:0:
* ^(Subject).*versace
/dev/null
:0:
* ^(Subject).*erectile
/dev/null
:0:
* ^Subject: .*(genuine).*(artifacts)
/dev/null
:0:
* ^Subject: .*(%).*(deposit|bonus|discount)
/dev/null
:0:
* ^Subject: .*(gain).*(inches)
/dev/null
:0:
* ^Subject: .*Your Health
/dev/null
:0:
* ^Subject: .*win millions
/dev/null
:0:
* ^(Subject).*omega watches
/dev/null
:0:
* ^(Subject).*prada
/dev/null
:0:
* ^(Subject).*vuitton
/dev/null
:0:
* ^(Subject).*armani
/dev/null
:0:
* ^(Subject).*vlgari
/dev/null
:0:
* ^Subject: .*(adobe).*(cs3|photoshop)
/dev/null
:0:
* ^(Subject).*male enhancement
/dev/null
:0:
* ^Subject: .*(indiana).*(energy)
/dev/null
:0:
* ^Subject: .*natwest
/dev/null
:0:
* ^Subject: .*(update).*(billing)
/dev/null
:0:
* ^Subject: .*(street|win).*(casino)
/dev/null
:0:
* ^Subject: .*(free).*(porno)
/dev/null
:0:
* ^Subject: .*(stupid).*(face)
/dev/null
:0:
* ^Subject: .*(erection).*(problems)
/dev/null
:0:
* ^Subject: .*hard erections
/dev/null
:0:
* ^Subject: .*(MSG).*(:|ID)
/dev/null
:0:
* ^Subject: .*you look really stupid
/dev/null
:0:
* ^Subject: .*burburry
/dev/null
:0:
* ^Subject: .*(Abbey).*(National)
/dev/null
:0:
* ^Subject: .*(Canadian).*(Pharmacy)
/dev/null
:0:
* ^Subject: .*(discrete).*(shipping)
/dev/null
:0:
* ^Subject: .*(greeting).*(ecard)
/dev/null
:0:
* ^Subject: .*clalis
/dev/null
:0:
* ^Subject: .*(Swiss).*(branded)
/dev/null
:0:
* ^Subject: .*(Miley).*(loves)
/dev/null
:0:
* ^Subject: .*(9|10|11|12|13|14).*(inches)
/dev/null
:0:
* ^Subject: .*windows-1251
/dev/null
:0:
* ^Subject: .*(Berry|Acai|Aca1|Accai|Acaai).*(Berry|Diet|Burn|Acai|Slim|Power)
/dev/null
:0:
* ^Subject: .*(Beautiful).*(Russian)
/dev/null
:0:
* ^Subject: .*(Discount|free|OEM).*(Adobe|software|30-day|download)
/dev/null
:0:
* ^Subject: .*Rep1ica
/dev/null
:0:
* ^Subject: .*PFIZER
/dev/null
:0:
* ^Subject: .*MBA Degree
/dev/null
:0:
* ^Subject: .*Weight loss
/dev/null
:0:
* ^Subject: .*WESTERN UNION TRANSFER
/dev/null
:0:
* ^Subject: .*(doctorate|required|masters|online|need|get|degree|Masters).*(masters|degree|diploma|doctorate|bachelors)
/dev/null
:0:
* ^Subject: .*(Royal|Fiesta|Club).*(Club|Casino)
/dev/null
:0:
* ^Subject: .*(Russian).*(wife)
/dev/null
:0:
* ^Subject: .*(Sex).*(Pharm)
/dev/null
:0:
* ^Subject: .*(Alliance).*(Leicester)
/dev/null
:0:
* ^Sender.*Casino
/dev/null
* ^Sender.*(Alliance).*(Leicester)
/dev/null

Like this article? Hate it? Then let me know.

Copyright © M.F.Hughes 2007-2009

-- Sitemap --
All content, text & graphics Copyright © M.F.Hughes 1995 - 2013