the itjerk

my adventures with technology

good bye spam

I hate spam. Okay, everyone hates spam. Anyway I’d been getting a shit-ton of it lately, in the mail from one of my domains. I wanted to take ACTION, because, yeah, you guessed it, I hate spam, and as a good itjerk, I wanted to beat those spammers.

Step one is to figure out why is it spam and what makes it different than good email. So the first thing to check was the message header, where I found this interesting bit:

Return-Path: WalkinTub-webmaster=MYDOMAIN.com@marylouvan.com

They put my MYDOMAIN in the Return-Path! Fortunately, it’s an easy fix, all I have to do is create a rule in spamassassin to filter it our. Off to edit /etc/mail/spamassassin/local.cf, I added the following, and gave it a BIG score:

# checking for local domain in return path
header LOCAL_RETURN Return-Path =~ /MYDOMAIN\.com/i
score LOCAL_RETURN 50.00
describe LOCAL_RETURN mark with score 50 all mails with Return-Path "bogus@mydomain.com"

Now, all that spam has this in it’s header, and goes directly to my Junk folder! I win!!!

X-Spam-Flag: YES
X-Spam-Score: 47.003
X-Spam-Level: ***********************************************
X-Spam-Status: Yes, score=47.003 tagged_above=2 required=6.31
tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, HTML_FONT_LOW_CONTRAST=0.001, HTML_MESSAGE=0.001,
LOCAL_RETURN=50, RP_MATCHES_RCVD=-1, SPF_FAIL=0.001,
SPF_HELO_PASS=-0.001, URIBL_BLOCKED=0.001]
autolearn=no autolearn_force=no
Advertisements

Comments are closed.

%d bloggers like this: