SpamAssassin Trainer

DEPRECATION NOTICE: As of March 1st, 2016, I will no longer be supporting this SpamAssassin trainer script. I will maintain bug fixes at a GitHub repo I set up a long time ago for the script, but I will no longer be supporting users who choose to download and use the script. I’ve been helping folks battle spam using this script in one form or another since early 2003, and it’s time to focus on other things. I truly appreciate the support of everyone who has downloaded sa-trainer over the years.

Frequently Asked Questions

  1. Will the script stop working?
    No, the sa-trainer script will continue to work as long as it’s configured properly and has access to SpamAssassin. The callback to to watch for new versions has been taken out of v4.04.
  2. Can we still contact you for help?
    Yeah, but I’m less inclined to respond as quickly as in the past.
  3. Where can we find updates to the script from now on?
    I’ll maintain big fixes at GitHub but I’m not likely to introduce any new changes going forward.

DISCLAIMER: If you’re fairly new to using my SpamAssassin training script, be sure to read the instructions carefully. While I’ve tried to document this as carefully as I can, every hosting environment can be completely different than the next, so I’ll be happy to support this thread as much as possible. I CANNOT BE HELD RESPONSIBLE FOR ANY NEGATIVE EFFECTS FROM USING THIS SCRIPT, AND BY USING IT YOU AGREE TO RELEASE ME FROM ALL LIABILITY. THERE ARE NO GUARANTEES ON THESE INSTRUCTIONS OR THE SCRIPT OR USING THE SCRIPT WHATSOEVER, NO WARRANTY OR CLAIM IS MADE THAT USING ANY OF THIS WILL HELP REDUCE THE AMOUNT OF SPAM YOU GET. (but it should drastically reduce it after training it for a few weeks…)

Second Disclaimer: I am not affiliated with SpamAssassin, I am not employed in any capacity by LunarPages, my trainer script is not part of SpamAssassin’s official release, nor part of cPanel. None of these groups will give you any direct support.

If You are a LunarPages user, Your Primary Support Source is THE HOWTO guide at LunarPages has asked that I direct all LunarPages users back to their forums where I posted my original thread, which I’m absolutely happy to do, and plan to support the script there myself: I get a kick out of knowing that my script has made such an impact for their client base, and happy to direct people back to LunarForums for help.

Other Support Info

You're also welcome to contact me through this site for assistance with your copy of the script if you run into trouble, but please do consider donating a few bucks for my time, since I've been supporting this script for free for several years ;o) If you do contact me via Email, I will ask you for the following pieces of information:

  • a full copy of your script sent as an attachment
  • a copy of your SpamAssassin user_prefs file
  • your domain name and CPanel username
  • the URL where you actually run the script so I can see what it's doing (or not)

Configuration/Installation for Non-Technical users

If you don't feel you can (or want to) configure this new script and your hosting environment by yourself and would like help doing it, as well as writing up training documentation to distribute to your users, I'll be happy to assist you with configuration and installation for a small support donation of $20 via (include your Email address and phone number and I'll contact you as soon as possible to discuss getting you set up) If you've used this script in the past, and you'd like to donate even as little as $1 to say thanks, I'd appreciate it. This script is always going to be free, you are under NO OBLIGATION to donate for the script. I'm not a registered charity, this is not tax-deductible, and will be spent at Starbucks to keep me caffeinated enough to keep working on new versions of the script :o)


Between 1997 and 2004, I operated a small web hosting business, and found SpamAssassin to be an invaluable tool to combat the flood of spam that would hit my systems on a daily basis. Some of my clients, prior to implementing SpamAssasin (SA), were getting hundreds of pieces of spam for every one piece of legitimate Email. When I closed my hosting business in 2004, I needed a new hosting provider for my own personal domais, and after some research chose LunarPages. I was happy to see that SA was a tool available, however the version of CPanel at the time did not allow us to actually train SpamAssassin, and to be honest, my work to get SA working on my LunarPages account to scan and track my own bayesian database was a bit of a hacker's delight, and I was happy to get it up and running. With the latest CPanel upgrades at LunarPages, to version 11, SpamAssassin has not operated as well as I'd like, and have had to make some oeprating chagnes to this sa-trainer script in order to maintain compatibility with LunarPages' systems. This training, from my experience with my now-defunct hosting business, was the difference between getting a trickle of spams every day or getting hundreds of spam messages per day, and getting one or two spam messages per day is still far better than getting tens of thousands delivered to my servers every day without SpamAssassin at all. Still, it would have been nice to have a CPanel interface for training spam… Since I already had scripts written to assist me in my hosting business, and found it to work at LunarPages with a little tweaking, I modified the script a little more and wrote a pretty lengthy post at about training SpamAssassin. It was quickly accepted by LunarPages management as a HOWTO article and, in the time the article has been live, has received about 20,000 views and at least 11 pages of follow-up questions and comments from other users. I have no idea how many people actually use the script on a regular basis though, but statistical analysis on the callback feature of the v3 script to check for upgrades tellsme that there are about 50 people per week using the script. I originally wrote my HOWTO article for supporting users at LunarPages, however since the script operates under a standard CPanel virtual hosting, and that I've personally run the script successfully on four other hosting providers other than LunarPages, I figured I'd just make the instructions as generic as possible and make the claim that this script should work with most standard CPanel installations. I did not need to tweak the operationg portions of the script to ru on any of the hosting environments I personally used, I simply needed to change the configurations slightly for pathing information which I've tried to eliminate in newer versions of the script. I decided I should move the article here to and rewrite most of it to explain in greater detail what steps are necessary and why, since the forum software that LP uses only allows 20,000 bytes of information per message posting, and the new script itself is at 25kb and growing, so I'm unable to even post the script in their forums any longer. With regards to long-term support of the sa-trainer script: I do intend to move my own personal accounts away from LunarPages in early 2008 for multiple reasons. One of those reasons is that I don't like how SA operates now (like lack of subject line rewriting or shorter Email headers), and I frankly need more control (like adding my own SA rules), so I've rented a dedicated private server for my needs, but this script operates perfectly okay on my new dedicated server. I still intend to support the sa-trainer script to the best of my ability, though I'm not sure whether I'll continue support at LunarPages's forum site ( or only support the script here at this web site.