John D. Hardin wrote:
> On Tue, 20 Jun 2006, Michael Di Martino wrote:
> 
>> How does one feed bayes ham and spam on an smpt gateway(no local
>> deliverey). All sever does is accetp mail for one 2 domains scrub
>> for virus and spam and then forward it to its nastly littly
>> exchange server.
> 
> Can you set up shared Exchange folders that can be exported to mbox
> format? If so, set up learn-ham and learn-spam folders, tell people to
> train to them, then periodically export them, transfer them to the SA
> host, and run sa-learn on them.
> 
> Perhaps someone sufficiently motivated could write an sa-learn <->
> IMAP client utility to train from arbitrary IMAP folders hosted
> remotely...
> 

We have trained users to put misclassified ham and spam into two public
folders, should-be-spam and should-be-ham.  We created an exchange user,
spamiam, that has full rights to these folders.

At the top of every hour, this script is run on the one MX server:


# more get_ham_spam
#! /bin/sh
rm -f /var/spool/mail/spamiam
touch /var/spool/mail/spamiam
chown spamiam:mail /var/spool/mail/spamiam
su  spamiam -c 'fetchmail -a -K -f
/usr/local/scripts/spamiam.fetchmailrc -r "Public Folders/should-
be-spam"'
cat /var/spool/mail/spamiam >> /var/www/html/spamstuff/should-be-spam
sa-learn --spam --mbox /var/www/html/spamstuff/should-be-spam
rm -f /var/spool/mail/spamiam
touch /var/spool/mail/spamiam
chown spamiam:mail /var/spool/mail/spamiam
su  spamiam -c 'fetchmail -a -K -f
/usr/local/scripts/spamiam.fetchmailrc -r "Public Folders/should-
be-ham"'
cat /var/spool/mail/spamiam >> /var/www/html/spamstuff/should-be-ham
sa-learn --ham --mbox /var/www/html/spamstuff/should-be-ham

# more spamiam.fetchmailrc
poll    exchange.xxxx.com
        proto imap
        user spamiam
        password xxxxxxxxx
        is spamiam here

At 15 past each hour, the two other mail servers use wget to grab the
should-be files to their local /tmp and run sa-learn.

The files are included in logrotate, so they get zero'd every Sunday
morning.

-- 

  Steve

Reply via email to