Author Archives: hostdango

Train SpamAssassin to Block SPAM!

One of the most frustrating parts of having an email account is the part where complete strangers can send you unsolicited email and you have no control over it.  You can click the little button that says “Unsubscribe” and, in a few instances, it may even prove effective enough to work.  Most of the time, though, the unsolicited email (SPAM) will actually increase as opposed to diminish.  That’s where SpamAssassin comes in. We are about to show you how to train SpamAssassin to take care of SPAM and send it to the depths of no return!

Train SpamAssassin

SpamAssassin is a powerful, highly customizable tool for, as one might imagine, fighting SPAM in your inbox or other folders.  It comes with a command-line tool called “sa-learn” which we’ll use in this post to train SpamAssassin to detect good mail (“ham”) and bad mail (“spam”).  With a little CRON magic, you can make this powerful tool learn exactly what is SPAM and what isn’t SPAM in your mailboxes.  What we’ll need is access to your cPanel account, your email address, and a desire to kill things that suck.

The first thing we’ll do is log into our cPanel account and navigate down to the “Apache SpamAssassin” link:

Select Email > Apache SpamAssassin
Select the Apache SpamAssassin icon

Enable the Spam Box

Click Enable Spam Box
If your Spam Box is disabled, select Enable Spam Box. Otherwise, skip this step.

Once there, you’ll want to enable your “Spam Box”.  The spam box is a folder which is automatically created for spam mail which is detected by SpamAssassin to go to.  The folder is there in case you want to save email which mail mistakenly be identified as SPAM.

Now that we’ve got our Spam Box enabled, we’ll need to go into your webmail client to actually subscribe to the folder which has been created.  This will allow you to see the folder from within your mail client or your webmail client.  The first step is to log into your webmail client.  We’ll go over SquirrelMail and Roundcube.

Select spam and click Subscribe
You’ll need to add your new spam folder to your list of subscriptions here.
  1. In the Email Accounts section in cPanel, choose the Access Webmail option next to the domain whose archived mail you wish to view.
  2. Click on the icon to log into SquirrelMail.
  3. Click on the Folders link at the top of the page.
  4. Under the Unsubscribe/Subscribe heading, select the folders you wish to view in the Subscribe list and click Subscribe.
    • If you wish to include the Spam folder, select the folder for Spam.
Check the box for the spam folder
Here you can add spam to your list of visible folders.
  1. In the Email Accounts section in cPanel, choose the Access Webmail option next to the domain whose archived mail you wish to view.
  2. Click on the Roundcube icon.
  3. Click the Settings icon in the top right corner of the Roundcube interface.
  4. Choose Folders in the left menu.
  5. Check the box for the folder whose archived mail you wish to view.
  6. Check the box for the date of the archived mail you wish to view.
    • If you wish to include the Spam folder, check the box for Spam.

Create Cron Jobs

Select Cron Jobs
Edit your cron jobs here.

Now that we’ve got everything going, we’ll put in an automated check via cron jobs twice a day.  The purpose of setting up this cron job is to enable an automated check of defined mail folders with good email (ham) and bad email (spam).  This will require two different cron jobs but they are set up nearly identically.  Navigate to your cPanel account and open “Cron Jobs” under “Advanced”:


Before you start adding the cron job, you can decide whether or not you would like to receive an email each time a cron job is run.  This is handy if you’re wanting to check on the status and get a feel for how sa-learn is progressing with its learning.  You can do this by entering your email address in this box:

Add an email address for results
You need to tell Cron where to send the email with the results.

If you do not want an email every time the cron job runs, you can put “>/dev/null 2>&1” after the command in the cron job.  This will stop email from being sent.

The sa-learn command is part of the SpamAssassin suite where you can forcefully train SpamAssassin the difference between ham and spam.  To create the scripts and enable the cron job, scroll down on this page.  We can do this one of two ways: per domain and per account or a blanket method which will cover all domains and accounts.  You would consider the second if you have add on domains.

Built into cPanel are basically templates for the repeating cycle timer.  You can simply pull down a box and select the frequency you’d like your cron job to run.  In this case, we’re choosing once every 12 hours, or twice a day.

Add the command for the cron job
Add your command line cron job to this box.


Now that we’ve determined the frequency of the cron job, we’re ready to insert the actual script to execute the command.  As mentioned before, there are a few different ways to do this.

The first method is to scan all domains and all accounts in one command.  This is likely the most popular way of doing this due to the fact that this will cover everything in one sweep.  An example of this would look like this:


HAM scan of the Inbox:
sa-learn -p ~/.spamassassin/user_prefs --ham ~/mail/*/*/{cur,new}

SPAM scan of the “spam” folder:
sa-learn -p ~/.spamassassin/user_prefs --spam ~/mail/*/*/.spam/{cur,new}

The other example is to scan by single domain and by single email account.  Examples of this would look like this:

HAM scan of a folder called “Archive”:
sa-learn -p ~/.spamassassin/user_prefs --ham ~/mail/{cur,new}

SPAM scan of the “spam” folder:
sa-learn -p ~/.spamassassin/user_prefs --spam ~/mail/{cur,new}

The end result of all of this work?  Less spam.  More ham.  We’ve set up a cron job to train SpamAssassin to look through the specified mailboxes searching for either good email (ham) or bad email (spam) and, for future messages, direct bad email directly into the spam folder so you never even have to see it.  Have questions or suggestions on different ways to accomplish this?  Let us know in the comments!

EPIC. Raised a Notch.

Happy Birthday to Us!

Hostdango - Bigger, Badder, Smarter

For the past 19 years, and counting, we’ve been offering reliable, epic hosting to a steadily growing number of short-term clients who, many of which, have turned into long-term friends. We come from a small town and relationships have always been important to us. Getting to know our customer base and their specific needs for their specific sites has allowed us to offer support you just don’t find in the big-box host who are inclined to treat you more like a number than a person. The feedback we have been given is overwhelmingly, well, EPIC! So, how do you take EPIC, and improve upon it?  We took a stab at it by adding and changing just a few things around here, if you hadn’t noticed.  Among the many recent changes, you’ll see things like a new line-up of promotions, two new ways to reliably support you, as well as a new, brighter, and easier to read web site and client area.

Phone Support is Here!

After years of waiting (19 years, to exact!), we’ve rolled out a phone support line!  This phone line (206.486.3324) is staffed 24/7/365 by our friendly, capable, knowledgeable staff.  For years, we have based our support on personable yet swift resolution to your support tickets.  Today we roll out a new way to reach out to us and actually speak to one of us over the phone.

Around the Clock Live Support!

Phone support is pretty awesome, but it’s not always convenient to pick up a phone and make a call.  We’ve had live support around for the past ten years and, while we admit that we haven’t always been great at it in order to focus on support and sales tickets, we are happy to say that we are now fully committed to being on the other end of our web site based live chat when you need us.  We are now staffing our web site live chat 24/7/365 in order to make sure that we are here, serving up EPIC when ever you need us!

How About That Web Site?

As part of our new services and support offerings, we also decided it was time to lift the shades and let in some light!  We’ve gone from dark to light for our customer-facing web presence and we’re really excited about it!  We hope you are, too!

Yes. Services!

Upgraded services! Limits suck, so, as of today, we are offering unmetered bandwidth for all shared hosting packages, as well as some of our reseller packages!  Head over to the Web Hosting page and the Reseller Hosting page for the details!

On top of the awesomesauce that is ripping the limits off of things, we’ve also got a few actually new services to offer!  We’re now offering the following services as new offerings:

  • SSL certificates by Symantec VeriSign.  Feel confident that transactions done through your web site are secure when your site is secured by Symantec!  With prices starting at just $17.95 a year, security is an affordable feeling.
    About Symantec: Since 1991, Symantec has powered the world-renowned anti-virus brand, Norton, and the Symantec name and brand has become synonymous with internet security. Symantec is one of the most recognised brands among consumers and in 2010, they acquired VeriSign and today are the #1 choice in Internet Security.
  • Email Spam-killing by SpamExperts. SPAM sucks. Let the experts deal with cleaning it up! Starting at just $2.99 a month for incoming mail protection, sticking it to the bad guys hasn’t ever been easier.
    About SpamExperts: Founded in 2005, SpamExperts is a leading email security provider for Web hosts, ISPs/Telcos and IT Resellers all over the world. Based in Amsterdam, the Netherlands, the SpamExperts mission is to secure email worldwide.
  • Website Builder by Weebly. Building a web site is literally a drag, drop, and click away!  And with this web site builder, you don’t need to change a thing!  All content is hosted on your server or account and published there automatically!
    About Weebly: Founded in 2007, Weebly is a San Francisco-based, global platform that lets people easily create a unique website, blog or online store. With a powerful online drag and drop editor, and apps for all major mobile devices, today over 40 million people and small businesses use Weebly to build their online presence.

For pricing information for these services, head over to the Product Addons page (login required) and check it out!

What do you mean you don’t carry a computer around in your pocket?

If you’re like us, you don’t like carrying around a computer where ever you go.  We’ve made this piece of things easier to deal with than ever.  Our site is not only more awesome to look at on a computer, but is now 100% mobile-friendly!  That means logging in to your portal account or even your cPanel-powered hosting account hasn’t ever been easier and more convenient.