Line 301: |
Line 301: |
| see [[Greylisting]] | | see [[Greylisting]] |
| | | |
− | ===Bayesian Autolearning=== | + | ===Bayesian Filtering=== |
| + | From [[wikipedia:Naive_Bayes_spam_filtering|Wikipedia]]: |
| + | <blockquote>Naive Bayes classifiers work by correlating the use of tokens (typically words, or sometimes other things), with spam and non-spam e-mails and then using Bayes' theorem to calculate a probability that an email is or is not spam.</blockquote> |
| | | |
− | The default SME settings do not include bayesian filtering in spamassassin to allow spamassassin to learn from received email and improve over time. [[Bugzilla: 6822]]
| + | SME server supports bayesian filtering, but does not have it enabled by default. |
| | | |
| + | Enabling bayesian filtering, autolearning, and spam/ham training allows spamassassin to learn from received email and improve spam filter performance. [[Bugzilla: 6822]] |
| + | |
| + | ====Bayesian Autolearning==== |
| The following command will enable the bayesian learning filter and set thresholds for the bayesian filter. | | The following command will enable the bayesian learning filter and set thresholds for the bayesian filter. |
| config setprop spamassassin UseBayes 1 | | config setprop spamassassin UseBayes 1 |
Line 336: |
Line 341: |
| | | |
| The database is located in /var/spool/spamd/.spamassassin/bayes | | The database is located in /var/spool/spamd/.spamassassin/bayes |
| + | |
| + | ====LearnAsSpam / LearnAsHam (spam/ham training)==== |
| + | |
| + | LearnAsSpam & LearnAsHam are scripts that can be installed on your server to allow users to manually "train" the bayes database. Training is done by users moving Spam from their Inbox to the "LearnAsSpam" folder, and by COPYING real email that was delivered to junkmail into the "LearnAsHam" folder. All messages in both LearnAsSpam and LearnAsHam are deleted once they have been processed and their tokens have been added to the bayes database. |
| + | |
| + | To install: |
| + | |
| + | <ol> |
| + | <li>Enable bayes database as described in [[Email#Bayesian_Autolearning | Bayesian Autolearning]]</li> |
| + | <li>Download the latest versions of LearnAsSpam.pl, LearnAsHam.pl, LearnAsSpam.cron and LearnAsHam.cron from [[Bugzilla: 1701]]<pre> |
| + | <nowiki>curl -o /usr/bin/LearnAsSpam.pl http://bugs.contribs.org/attachment.cgi?id=1293 |
| + | curl -o /usr/bin/LearnAsHam.pl http://bugs.contribs.org/attachment.cgi?id=1290 |
| + | curl -o /etc/cron.d/LearnAsSpam.cron http://bugs.contribs.org/attachment.cgi?id=1231 |
| + | curl -o /etc/cron.d/LearnAsHam.cron http://bugs.contribs.org/attachment.cgi?id=1232</nowiki></pre></li> |
| + | <li>Create LearnAsSpam & LearnAsHam folders for all users<pre> |
| + | <nowiki># create skellaton for new users : |
| + | |
| + | mkdir -p /etc/e-smith/skel/user/Maildir/{.LearnAsHam/{cur,new,tmp},.LearnAsSpam/{cur,new,tmp},.LearnInWL/{cur,new,tmp}} |
| + | |
| + | # create folders for existing users : |
| + | |
| + | pushd /home/e-smith/files/users/; \ |
| + | for u in `ls | grep -v admin`; \ |
| + | do \ |
| + | mkdir -p $u/Maildir/.LearnAsHam/{cur,new,tmp}; \ |
| + | chown -R $u:$u $u/Maildir/.LearnAsHam/; \ |
| + | mkdir -p $u/Maildir/.LearnAsSpam/{cur,new,tmp}; \ |
| + | chown -R $u:$u $u/Maildir/.LearnAsSpam/; \ |
| + | mkdir -p $u/Maildir/.LearnInWL/{cur,new,tmp}; \ |
| + | chown -R $u:$u $u/Maildir/.LearnInWL/; \ |
| + | done; \ |
| + | popd</nowiki></pre></li> |
| + | <li>Instruct your users to move any SPAM they find from their Inbox to their LearnAsSpam folder, and to COPY any non-spam (ham) they find in their junkmail folder into their LearnAsHam folder.</li> |
| + | </ol> |
| + | |
| + | ====Learn Contrib==== |
| + | The [[Learn]] contrib was intended to install and configure the bayes training tools LearnAsSpam & LarnAsHam but is no longer maintained(?) |
| | | |
| ====Reset the Bayes Database==== | | ====Reset the Bayes Database==== |