Trouble with Bayes

Glenn Steen glenn.steen at gmail.com
Thu Aug 31 09:45:37 IST 2006


On 31/08/06, Martin <martin.lyberg at gmail.com> wrote:
> Glenn Steen wrote:
>
> > Right. And as the postfix user, doing a
> > spamassassin --lint -D 2>&1 | less -e
> > everything works as expected, right?
> > Is that lint snippet from MailWatch, perhaps? In that case, you need
> > do the same test for the apache user (whatever that is on your system.
> > It is "apache" on mine:).
>
> Yes, but i had to add -p /etc/MailScanner/spam.assassin.prefs.conf for
> it to pick up the right conf-file.
>
> You're right that the snippet in my post was made from Mailwatch
> webadmin. If i do it from the commandline as the postfix-user i get this:
>
> spamassassin -p /etc/MailScanner/spam.assassin.prefs.conf --lint -D 2>&1
> | less -e:
>
> [9298] dbg: bayes: tie-ing to DB file R/O
> /var/spool/MailScanner/spamassassin/bayes_toks
> [9298] dbg: bayes: tie-ing to DB file R/O
> /var/spool/MailScanner/spamassassin/bayes_seen
> [9298] dbg: bayes: found bayes db version 3
> [9298] dbg: bayes: DB journal sync: last sync: 0
> [9298] dbg: bayes: not available for scanning, only 86 spam(s) in bayes
> DB < 200
> [9298] dbg: bayes: untie-ing
> [9298] dbg: bayes: untie-ing db_toks
> [9298] dbg: bayes: untie-ing db_seen
>
> So it seem to work as it should when doing it this way. Could it be that
> Mailwatch is using some other user when linting from the web-admin?
>
>   > The way to get everything to work with Postfix and MailWatch (if that
> > is the problem) is to make the necessary parts run as postfix:apache,
> > and adjust the group rights accordingly.
> > On a system near me I've got:
> > drwxrwsrwx  2 postfix apache     4096 aug 30 15:28 ./
> > drwxr-xr-x  7 root    root       4096 aug 30 04:12 ../
> > -rw-rw----  1 postfix apache    76440 aug 30 15:27 bayes_journal
> > -rw-rw----  1 postfix apache     1200 aug 30 15:27 bayes.mutex
> > -rw-rw----  1 postfix apache 20971520 aug 30 15:27 bayes_seen
> > -rw-rw----  1 postfix apache  5111808 aug 30 15:27 bayes_toks
> >
> > ... with
> > Run As User = postfix
> > Run As Group = postfix
> > Quarantine User = postfix
> > Quarantine Group = apache
> > Incoming Work Permissions = 0660
> > Quarantine Permissions = 0660
> > ... in /etc/MailScanner.conf, and
> > bayes_path /etc/MailScanner/bayes/bayes
> > bayes_file_mode 0770
> > ... in /etc/mail/spamassassin/mailscanner.cf (softlink to
> > spam.assassin.prefs.conf).
>
> I have the following in my MailScanner.conf:
>
> Quarantine User = postfix
> Quarantine Group = www-data
> Quarantine Permissions = 0660
>
> Run As User = postfix
> Run As Group = postfix
> Incoming Work Permissions = 0600
>
> I can't see any error here? Clues?
>
> Thank you
>
> / Martin
>
I didn't give it as actual commands, my bad:-)... Do:
chown -R postfix:www-data /var/spool/MailScanner/spamassassin
chmod 0660 /var/spool/MailScanner/spamassassin/*
and set
bayes_file_mode 0770
in spam.assassin.prefs.conf ...
Now everything should look OK from MailWatch too, and you'll probably
have better luck training bayes from that interface too. You can check
it either from MailWatch or by
su - www-data -s /bin/sh
spamassassin -D --lint -p /etc/MailScanner/spam.assassin.prefs.conf
... of course:-).
That you need specify the spam.assassin.prefs.conf on the commandline
isn't good... Either you have a somewhat dated install, or install.sh
(or whatever method you used to install) failed ot create the symlink
in /etc/mail/spamassassin ... If the former, that is probably OK, but
you should consider upgrading, if the latter.... Well, you might need
fix that then (manually creating the link or rerunning your install
methid, or somesuch).

HtH and Cheers (BTW, you wouldn't hapopen to be in Sweden, now would you?)
-- 
-- Glenn
email: glenn < dot > steen < at > gmail < dot > com
work: glenn < dot > steen < at > ap1 < dot > se


More information about the MailScanner mailing list