Bayesian Scanning

Kris Zabriskie zabriskw at ITECH.NET
Tue Jul 8 19:50:21 IST 2003


I am having one heck of a time getting Bayesian scanning to work properly.
I am having several problems.  The first problem is with the Bayesian
scanning itself.  I have been using the script below in a cron job, but have
had several problems with it:

#!/bin/sh

SPAM=/var/spool/mail/spam
NOTSPAM=/var/spool/mail/notspam
TOTAL=.cumulative

LOGFILE=/var/log/learn.spam.log
PREFS=/usr/local/MailScanner/etc/spam.assassin.prefs.conf
SALEARN=/usr/local/MailScanner/bin/sa-learn

date >> $LOGFILE
if [ -f $SPAM ]; then
  BOX=${SPAM}.processing
  mv $SPAM $BOX
  sleep 5 # Wait for writing current message to complete
  $SALEARN --prefs-file=$PREFS --spam --mbox $BOX >> $LOGFILE 2>&1
  cat $BOX >> ${SPAM}${TOTAL}
  echo >> ${SPAM}${TOTAL}
  rm -f $BOX
fi

if [ -f $NOTSPAM ]; then
  BOX=${NOTSPAM}.processing
  mv $NOTSPAM $BOX
  sleep 5 # Wait for writing current message to complete
  $SALEARN --prefs-file=$PREFS --ham --mbox $BOX >> $LOGFILE 2>&1
  cat $BOX >> ${NOTSPAM}${TOTAL}
  echo >> ${NOTSPAM}${TOTAL}
  rm -f $BOX
fi

Now.. the problem I see with this is.. it is moving the spam at domain.com and
notspam at domain.com mailboxes, and they are not being recreated. Has anyone
else experienced this problem?  I tried adding these lines and it worked,
but caused the following errors to be reported:

touch $SPAM
chown spam $SPAM

and visa versa for $NOTSPAM

This is causing the processes to be killed however.

The other problem is when I attempt to run the Bayesian clean up script this
is the error I get:

Failed to create default user preference file //.spamassassin/user_prefs

............................................................................
............................................................................
...........................................................bayes
expire_old_tokens: Out of memory during "large" request for 1052672 bytes,
total sbrk() is 133331264 bytes at
/usr/local/lib/perl5/site_perl/5.6.1/Mail/SpamAssassin/BayesStore.pm line
390.


Has anyone experienced these problems before?  Any help would be greatly
appreciated.  Thanks!



More information about the MailScanner mailing list