welcome: please sign in

Diff for "SpamAssassinAdmin"

Differences between revisions 3 and 4
Revision 3 as of 2005-08-08 22:45:26
Size: 1427
Editor: AdamChlipala
Comment: Add to sysadmin category
Revision 4 as of 2005-09-11 11:43:36
Size: 1721
Editor: AdamChlipala
Comment: -x
Deletions are marked like this. Additions are marked like this.
Line 17: Line 17:
 1. Modify `/etc/default/spamassassin` by adding `-u spamd` to `OPTIONS`.  1. Modify `/etc/default/spamassassin` by adding `-u spamd -x` to `OPTIONS`. The `-x` prevents `spamd` from trying to look for per-user configuration, which would be silly because it always runs as the same user here. Without this flag, the cron job triggered every 5 minutes would log an error message, which would lead to an e-mail being sent to the `spamd` user.

Here's how we set up our site-wide SpamAssassin bayes database, including the ability for users to train it.

  1. Create a new user spamd with home /home/spamd.

  2. Perform the following as spamd:

    1. cd /home/spamd

    2. maildirmake -S Maildir, to create the shared SpamAssassin mailbox.

    3. maildirmake -f SiteSpam -s write Maildir, to create a writable folder for misclassified spam.

    4. maildirmake -f SiteHam -s write Maildir, to create a writable folder for misclassified ham.

  3. Add the following to spamd's crontab to learn from and delete messages in those shared folders every five minutes:

    • 0,5,10,15,20,25,30,35,40,45,50,55 * * * * sa-learn --spam --dir /home/spamd/Maildir/.SiteSpam/cur >/dev/null; cd /home/spamd/Maildir/.SiteSpam/cur ; ls | xargs -r rm
      0,5,10,15,20,25,30,35,40,45,50,55 * * * * sa-learn --ham --dir /home/spamd/Maildir/.SiteHam/cur >/dev/null; cd /home/spamd/Maildir/.SiteHam/cur ; ls | xargs -r rm

      The funny xargs-based way of deleting files is important, because ls has a hard limit on how many files it can handle, which we learned the hard way! Also, be sure there's a newline after the last line, or it won't be processed.

  4. Modify /etc/spamassassin/local.cf with the directive:

    • bayes_path /home/spamd/
  5. Modify /etc/default/spamassassin by adding -u spamd -x to OPTIONS. The -x prevents spamd from trying to look for per-user configuration, which would be silly because it always runs as the same user here. Without this flag, the cron job triggered every 5 minutes would log an error message, which would lead to an e-mail being sent to the spamd user.


CategorySystemAdministration

SpamAssassinAdmin (last edited 2010-11-29 17:33:53 by ClintonEbadi)