Swimminginthought

A place for all things technical and my mind..

Menu
  • About Me / Hire Me
Menu

A very easy way to eliminate quite a bit of SPAM if you’re using Postfix and Spamassassin. [SOLVED]

Posted on April 17, 2012 by Percy Kwong

SPAM is definitely a huge problem in our lives.  Here’s a real simple way to eliminate spam.  This assumes you’re running postfix and Spamassassin already.

You need to remember that Spamassassin does nothing but score and tag spam.  There will always be false positives.  There are solutions that will handle most of it though.

If you’ve ever taken a look at your spam folder and if you’ve done it correctly, you’ll notice that the majority of it is already marked or tagged as being in pyzor or is 99 to 100% probability spam according to pyzor.

What I’ve done (a VERY simple thing) is just simply instituted a simple body check.  (While many people say it’s high cost “In terms of CPU cycles”, it really depends on how you’ve set up your mailserver).  I’m not known for setting up inefficient servers.

Mine, for example, is a simple setup using Postfix, Mysql, Courier, Spamassassin, Amavis, and Squirrelmail with TLS Auth and SASL (for security), Squirrelmail, and Fail2ban.

It’s fast, it works, and it eliminates the majority of the SPAM.  I also instituted Greylisting and Fail2ban to scan the mail log for spammers and locked them out.  You’d be surprised at how effective the entire setup is.  (The cloud server instance is actually for sale in my estore).

Here’s the simple setup to help eliminate the actual amount of spam that makes it to your mailbox.

I institute two simple body checks.

1. In postfix, go to your main.cf and add this line:

 

body_checks = regexp:/etc/postfix/body_checks

2. in the body_checks file, just simply put two lines:

/Bayes spam probability is 99 to 100/ DISCARD
/Listed in Pyzor/ DISCARD

save the file and restart postfix.

Watch how quickly the spam just starts going away.  While you’ll still get some spam that gets through, you’re going to find that VERY LITTLE actually gets into the mailbox.

I went from getting 200 to 300 spams a day in my spambox to 2-3 a week.

Not bad, huh? It got to the point where I was wondering whether my mailserver was working! So here I was for a whole week constantly testing my mailserver to make sure it was actually functioning.

It’s s simple solution to a complicated problem.

The one thing about Bayesian rating of spam is actually training it on a regular basis.  That is a story for another day though.

I know this is going to help many people.  So PLEASE donate if you implement this.  I’m actually trying to feed the family 🙂

Cheers!  and Good Luck!

If you’re looking for a very powerful and easy to use mailserver, consider using this cloud solution.  It’s very fast, efficient, and easy to manage.  Imagine being able to host hundreds of domains on a simple server with very little utilization on CPU.  I’ve been running this solution for years.

Buy my Virtual Mailserver Image: $59.95 per month.

[wp_eStore_buy_now:product_id:3:end]

1 thought on “A very easy way to eliminate quite a bit of SPAM if you’re using Postfix and Spamassassin. [SOLVED]”

  1. Dibundu says:
    June 14, 2012 at 10:04 am

    dit :Bonjour;Bienvenue dans le club de ceux qui (ont) gale9re (re9) avec postfix’ !J’ai mis plus de six mois pour cougifnrer postfix avec ssl/sasl-auth! Donc, un seul conseil: ne dese9spe9rez pas A l’occasion, je pourrais vous donner ma config, si vous avez quelques soucis.(en e9change, si vous avec un peu d’expe9rience avec bind9 . )Amicalement.Re9mi.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • Kubernetes install gotcha on CentOS-7.x
  • Infrastructure as Code using AWS Cloudformation
  • Does SSL matter? It does and it’s not just web encryption.
  • Apache can’t serve the .well-known directory
  • Cloudy with a chance of Meatballs
  • Resurrection of the Blog
  • Encryption type Matters with Deep Packet Inspection – solved
  • Completely off topic.. Just a personal note.
©2025 Swimminginthought | Built using WordPress and Responsive Blogily theme by Superb