the itjerk

my adventures with technology

Tag Archives: spamassassin

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:


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/, 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 ""

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,
autolearn=no autolearn_force=no