How to Set Up Spam Filters

As Internet users we have to deal with the problem of spam Email. Most people already have effective tools for dealing with spam but may find that they are aware of it.. It is a simple matter to set up spam filters which will protect us from all of that unwanted spam.

Internet users normally fall into one of two categories. It is likely that we either have an ISP which offers spam filters or we have an online hosting service which offers them. We shall take a look at the spam filters that are a part of online hosting services. I speak of those included in the cPanel of your hosting account. Most that I have seen are very similar.

On the cPanel you will see a section entitled Mail. Under the Mail section chose the option “User Level Filtering”. This option will allow you to set filters for each email account that exists under your hosting account. Choose the particular account that you want to set filters for. Click the button at the top labeled “Create A New Filter”. When you do this you will get a page which looks much like a web form. At the top chose a name for the filter. You may set up a number of rules (think conditions) which if met, will allow the server to deal with your spam mail.

In my instance I had used a particular account to inquire of some software on a particular website. It turned out that the site was not particularly reputable. From that point on I got a large amount of spam from this and perhaps other companies. Common things about the emails were that they were always from a hotmail.com address and always had a long string of key words all run together in the subject line similar to the following: HugeSotwareAdobeDealsMicroDiscountOffice2010Photoshop. By keeping in mind these commonalities I was able to put together a good profile to filter these mails out.

If you are getting recurring mail from one mail service like Hotmail, here is an effective first step. Chose “From” under the left side of the form. On the right side choose “matches regex”. Regex means “regular expression”. This gives you the power to match all mail which has a certain string in the line of spam phrases. It is hard to screen out Hotmail because it is only part of a “From Line”. But if you use “matches regex” – Hotmail, then the filter will pick out all mail which includes the expression Hotmail in it even if run together with other words. This will choose all email addresses with a domain of Hotmail in them regardless of what follows the “@” symbol.

Now you may not want to screen out all messages from users who have Hotmail. Second click the plus sign to the far right side of the form. This will give you a new box for a new condition. In that box choose subject and then matches regex again. Set the little drop down between the first two conditions to and. For my example, the regex is going to be “soft”. Do not use software because the spammer might cut it short and just use soft. This will pick up both soft and software. Click another option and list a new condition. Here I would use subject and regex again, this time using “or” in the dropdown between the two. Once again list a word out of the long string, one which often occurs in these mails, such as “Adobe”. You can repeat this a time or two, using “or” between each choice.

Finally choose a new condition and then select “Spam Bar” and “contains”. This is assuming that your Hosting Company has equipped you with SpamAssassin Which most have. SpamAssassin grades all of your email according to some scientific principles which determine the likelihood that it is spam. It does not filter email on its own, merely grades it. Here you will set filters to take out mail with the forgoing conditions and a SpamAssassin score of 5 or 6 or whatever you want. You enter the spam bar into the “contains field” by entering a consecutive number of plus symbols. I chose 5 in my instance. Be careful of setting the spam bar too low or you will run the risk of losing valid mail. It is very unlikely that any of my friends would send me mail from a Hotmail address which had those words in the subject line and also met a SpamAssassin score of 5.

There is a difference between “and” and “or” conditions. If you choose “and” the filtering will have to meet the whole combination of conditions. If you chose “or” the filtering will meet the previous conditions or the new one you are selecting. These choices allow for setting up a filter which is specific to your situation and perhaps very specific.. Be careful of being very general in the conditions for if you do you will probably miss some personal emails. Choose the details that are normally a part of your spam emails and are not like the normal ones that you get.

The last thing to do is to set an action. I chose merely to discard the email. Other options serve mainly to redirect desired mail to a specific folder on your server and this doesn’t meet the needs of dealing with spam.

There now, that wasn’t really very difficult. You can study different scenarios to meet your own situation. You have now set up a spam filter which will act only on the one email account and only if the problem conditions exist. SpamAssassin will only act on this one account and not system wide. This is a smart, specific spam filter tailored just for you.

It is a shame that we have to deal with this sort of parasite called spam mail. By learning to set up spam filters at the ISP or Hosting level it is possible to be free of a lot of it.

Leave a Reply