Check out this script if you want to use sa-learn with cyrus. sa-learn is the tool that is part of spamassassin that learns to identify spam. sa-learn-cyrus is the wrapper script that glues both toguether.
sa-learn-cyrus.conf
On my openSUSE server the sa-learn-cyrus.conf file looks like this:
# Configuration for sa-learn-cyrus # # hjb -- 2005-05-22 # # ------------------------------------------------------- # global parameters # [global] # file to store output of sa-learn and ipurge temporarily tmp_file = /tmp/sa-learn-cyrus.tmp # level of verbosity (0 .. 3)? verbose = 1 # ------------------------------------------------------- # Mailbox # [mailbox] # list of mailboxes/users which will be consirered in any case include_list = '' # otherwise, only mailboxes matching this pattern will be considered include_regexp = '.*' # list of mailboxes/users which will be ignored exclude_list = '1' # otherwise, mailboxes matching this pattern will be ignored exclude_regexp = '' # spam folder relative to INBOX (cyrus nomenclature: e.g. 'junk.Spam') spam_folder = 'Spam' # ham folder relative to INBOX (cyrus nomenclature: e.g. 'junk.Ham') ham_folder = 'Learn.Ham' # remove spam after feeding it to SA remove_spam = yes # remove ham after feeding it to SA remove_ham = yes # ------------------------------------------------------- # Spamassassin # [sa] # path with system-wide SA preferences site_config_path= /etc/mail/spamassassin # SA configuration file prefs_file = /etc/mail/spamassassin/local.cf # path to sa-learn learn_cmd = /usr/bin/sa-learn # SA user and group user = mail group = mail # run sa-learn in debug mode (useful to examine problems) debug = no # ------------------------------------------------------- # IMAP # [imap] # base directory of IMAP spool (below that mailboxes are located) base_dir = /var/spool/imap # if base_dir has subdivisions with initial letters of mailbox names # set initial_letter = yes (default), otherwise choose no # Example for joe's mailbox: # yes: <base_dir>/j/user/joe/ # no: <base_dir>/user/joe/ initial_letter = no # imap command to purge mail messages purge_cmd = /usr/lib/cyrus/bin/ipurge # Cyrus-IMAPd user user = cyrus
Spam has become ever more harrasing than ever before. I am fed up with it and am taking more actions. I run Cyrus as our IMAP mail server at home. Mail gets filtered through SpamAssassin before it reaches the server. But how to let SpamAssassin learn from the mails you get that are spam but did not get detected?