#pragma section-numbers off This page describes how to use Spam``Assassin to keep junk email under control. [[TableOfContents]] = Introduction = You will probably want to set up Spam``Assassin to detect junk e-mail for you. [http://spamassassin.org/ SpamAssassin] is a program for categorizing e-mail as spam based on a wide range of criteria. It indicates its decisions by adding special headers to messages. Please note that we will never reject any spam email before it hits your filtering rules. It is up to you to decide how to classify the email that hits your inbox. = Enabling spam detection = We use a custom tool called {{{setsa}}} to determine whether your email should be run through Spam``Assassin. To enable Spam``Assassin for mail to your UNIX account, run {{{ setsa on }}} To later disable it, run {{{ setsa off }}} To check whether you've enabled it or not, run {{{ setsa }}} You can similarly enable or disable Spam``Assassin for a virtual mailbox address by adding it as the first argument to {{{setsa}}}; for example, '''{{{setsa user@domain.com on}}}''' enables Spam``Assassin for {{{user@domain.com}}} if you have DomTool permissions for {{{domain.com}}}. '''Please don't enable this if you can't commit to following the training procedure below when Spam``Assassin makes an incorrect classification!''' Spam``Assassin makes small mistakes over time, and this can interact poorly with its automatic learning of which message properties signify spam. If you don't correct its small misclassifications, then these increase the chance of misclassifying future messages, which itself leads to more faulty learning, vicious cycle style. = Moving spam email to a different folder = The above procedure only asks Spam``Assassin to examine your mail and add extra headers indicating its verdict, spam or legit. To use these headers to move junk mail to a folder called Spam in your IMAP mailbox, copy the template {{{/etc/.forward}}} to {{{~/.public/.forward}}}. This is an Exim filter that looks for Spam{{{}}}Assassin headers that indicate spamhood. You need to create a Spam folder manually to use this. You can modify this template to save spam to other places, if you don't use IMAP or prefer another scheme. (If you already have a {{{~/.public/.forward}}} file because you forward all of your mail to another account elsewhere, then you can ignore this section. You should use that e-mail provider's spam filtering services.) Spam``Assassin flags spam with a spamminess level of 5.0 or higher. You can use the X-Spam-Level: header to customize your own filter to your own liking, however. As an example, you can see NathanKennedy's .forward file on the ["MemberManual/Email/EximFilter"] page. = Training = One way that Spam``Assassin spots spam is by using statistical (Bayesian) analysis. This requires lots of training data to work properly. Sometimes this analysis will make mistakes, and you'll want to perform the electronic equivalent of slapping it with a newspaper. The way to do that is to deposit misclassified mail in special system-wide IMAP folders, one called {{{SiteSpam}}} for spam that Spam``Assassin missed and one called {{{SiteHam}}} for good messages that were erroneously marked as spam. If you ever run into this situation, here's how you can feed our system-wide trainer: '''Apparently there is more to do in order for SiteSpam and SiteHam to show up as shared folders. Shouldn't the shared-maildirs file in ~/Maildir be edited? Is that all or must the shared-folders directory be filled in by the user or does courier or the client do that? A user has been having difficulties getting this to work''' -- RyanMikulovsky 1. First, this is only going to work if you are using IMAP. If you're not, or if you have other sources of spam or ham that you'd like handled specially, place a support request on [https://members2.hcoop.net/portal/ the portal]. 1. Use your IMAP client's "subscribe" feature to subscribe to {{{SiteSpam}}} and/or {{{SiteHam}}}, which should appear in the {{{SpamAssassin}}} mailbox inside the {{{shared}}} tree. 1. When you want a message to be used as an example of spam or ham, place a copy of it in the appropriate folder. 1. Every five minutes, our faithful spamhound will sniff these folders, update its data, and clear their contents. If you would like to automate this process somewhat, check out FeedingSpamAssassin. For the curious and the sysadmins out there, SpamAssassinAdmin gives more details on how we set this up.