Home > sysadmin > spam control

spam control

Addressing spam is a complex problem. I recommend postfix with spamassassin for starters. Vigorous use of client, sender, and helo access are recommended. There are many examples of this on how-to websites including postfix and spamassans own websites.

Once you create a spam mailbox (I usually do this with procmail example below), you can examine spam email headers and see where the spam is coming from.

You will find most is coming from 1) countries you have no need to receive mail from, or 2) an IP subnet from hosts that do not monitor their users for spam (a key is an unusual domain-name that resolves but seems meaningless). You can block specific countries with postfix sender_access files or helo_access file. I recommend disallowing spam IP host by brute force blocking the IP or IP range with IPTABLES. If you observer multilple IP’s from a subnet, block the whole subnet.

It is a tedious process however, you can eliminate almost all spam with careful analysis.

MAILDIR= /var/mail
* < 256000
| /usr/bin/spamassassin
* ^X-Spam-Flag: YES

Where spambucket is the spam mailbox you need to create user spambucket (or whatever you want)

Categories: sysadmin
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: