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.

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

Recent Comments

  • Percy Kwong on Boosting Octane Yourself. I did the research, made it, and proved it.
  • Nick Doelman on Boosting Octane Yourself. I did the research, made it, and proved it.
  • Percy Kwong on International Text solutions – A solution
  • Muzahid Ul Islam on The Browser Wars; Which One is Best?
  • Muzahid Ul Islam on International Text solutions – A solution

Archives

  • September 2019
  • August 2019
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • August 2011
  • June 2011
  • March 2011
  • February 2011
  • November 2010
  • October 2010
  • September 2010
  • July 2010
  • January 2010
  • November 2009
  • October 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008

Categories

  • Activism
  • All
  • Amazon S3
  • Announcements
  • Apache
  • Apple
  • Applications
  • Automation
  • AWS
  • Azure
  • Backups
  • Blogging
  • Books
  • Bootcamp
  • CentOS – RHEL
  • Cloud Computing
  • Cloudformation
  • Consulting Advice
  • Craigslist
  • Databases
  • Deep Packet Inspection
  • Doing the right thing
  • e-Book Readers
  • E-Mail
  • EC2
  • energy-efficiency
  • environment
  • Expose
  • firewalls
  • General Observations
  • Hardware
  • Hope
  • Hosting
  • IaC
  • Important things to do in life
  • Infrastructure as Code
  • Kubernetes
  • Linux
  • Media and Encoding
  • Miscellany
  • Mobile Phones
  • MySql
  • Networking
  • Performance
  • Personal
  • pfsense
  • Politics
  • Privacy
  • Redundancy
  • Routers
  • security
  • SPAM
  • Tech that doesn't work like it should
  • Tips and Tricks
  • Tools that work
  • Tout
  • Video
  • Virtual Computing
  • VOIP-Voice Over IP
  • VPN
  • Web Browsers
  • Web Hosting
  • Websites
  • Windows
  • Wordpress

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2026 Swimminginthought | Built using WordPress and Responsive Blogily theme by Superb