If you want to get started quickly with spam filtering we have developed a "wizard" to create a set of rules which should start reducing the amount of spam you receive in your Inbox.
After you've changed your MX records visit the "Mail Filtering" section in the control panel
You will view a page of options with the first being the wizard.
The spam identification software rates each mail giving it a score and you can then decide what an appropriate score is for your mail.
As a starting point, we recommend 5. The next page allows you to set some further options and choose which domain names you want it enabled on.
Note that if you leave the "divert to" address blank, then the message will be rated and informational headers added, but the mail will be delivered as normal so you may deal with it in your client program.
Building Sets of Rules
In order to use mail filtering you must start by defining your "filtering rule". You then group filtering rules into an ordered "filtering group". Finally, you apply a filtering group to mail forwarding rules.
A filtering rule contains a test and a list of email addresses. The list needs to be formatted as follows:
- It needs to be formed as a regular expression
- Separated by pipes with no new lines
- There shouldn't be a pipe after the final match
When a mail matches the test the email is diverted off to those addresses. If the address field is left blank then the test is performed, but the mail is sent to the original address (so you can do spam scoring, without diversion, for example).
Initially, we recommend diverting your mail to a specific pop3 mail box for collection and evaluation. e.g. firstname.lastname@example.org.
Note that all this system does is divert a mail that matches a rule into a particular email address. This means that you can either send it to a particular address for review or collection, or divert it to email@example.com if you want it to be deleted, or divert it to an auto responder (which can also generate bounce mails), or any other sort of address.
There are several types of filtering rules:
- SpamAssassin Triggers. The SpamAssassin system rates mail according to a number of rules and gives it a score. If the mail score is higher than your defined level, the mail gets diverted.
- Mail Size Triggers. If a mail is greater in size than a specified number of bytes then the mail gets diverted. So, for example, you can have all mail greater than 40Kbytes go into a special "large mails" pop3 box which you only download when you're not using your mobile phone's modem...
- Quarantine Triggers. This rule type causes the mail to be stored, and an email is sent to the sender requiring they visit a URL to confirm that their mail is genuine. As with other rules, you can apply a whitelist to this rule type, and additionally, whenever a correspondent visits the confirmation page, their email address is added to an internal whitelist.
- Header Matching. You can specify any header in an email and do either and "is equal to" or a "contains" match. So, you might say "Header 'Mailing List' contains apple" and divert all the mail on the apple-lovers mailing list into a special box. Or, you could say "Header 'Mailing List' is 'apple-growers'", which would allow you to match general apple mails and the apple-growers mailing lists differently. Header matching is case insensitive.
Every mail that goes through a filtering rule will get a header attached. That header can either be a short header, or you can enable a more detailed header, if you want to understand a bit more about the rationale of the filtering and where the mail was sent too.
For every filtering rule, you can set an optional whitelist of addresses (comma seperated) which will bypass the filtering and an optional subject tag which is pre-pended to the subject on a match.
Once you've defined a set of mail filtering rules to match on, they need to be built into a filter group and set into an order. Priorities start at one, which means "first" and get bigger. Please avoid having filters with identical priorities!
You can define a short identifier for each group of filtering rules to help you assign them to the forwarding rules.
Mail Forwarding Rules
Having defined your filters and groups you can apply them to mail forwarding rules. View the forwarding rules for your relevant domain name and assign the appropriate group to the appropriate rule.
If you're using a mail forwarding alias as your "divert to" address in the filtering rule, try and avoid enabling filtering on it! (To stop a loop forming.) [N.B. If a loop were to form, it would just cause a mail bounce.]
You can only have one group per mail forwarding rule.
Our mail system uses perl regular expressions and thus you can specify complex matches for your header matching rules.
Let's say you wanted to put
into your header match rule.
On its own, this would be formed into a regexp:
With brackets, this becomes:
Please note - there should be NO spaces around any regexp , if spaces are included then we will expect to match on a word/phrase prefixed/seperated with a space
What's the difference?
Well, the first line will match any line containing:
While the second will match: