[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

site wide spamassassin doesn't do bayes...



Hi all,


I'm having trouble getting spamassassin to do site wide bayes. I've got it trained with sufficient ham and spam and when I try it with spamassassin -D < testmessage as root, it works fine. When I run it as user filter it fails. It tries to create userprefs and it can't access the bayes db and whitelist:

==== output ====
mrblue:#su filter
filter@mrblue:$spamassassin -D < testmsg

<snip>
debug: using "/dev/null/.spamassassin" for user state dir
debug: mkdir /dev/null/.spamassassin failed: mkdir /dev/null: File exists at /usr/share/perl5/Mail/SpamAssassin.pm line 1453
File exists
<snip>
Cannot write to /dev/null/.spamassassin/user_prefs: Not a directory
Failed to create default user preference file /dev/null/.spamassassin/ user_prefs
debug: using "/dev/null/.spamassassin/user_prefs" for user prefs file
<snip>
debug: bayes: no dbs present, cannot tie DB R/O: /var/spool/ spamassassin/bayes_toks
debug: Score set 1 chosen.
debug: bayes: no dbs present, cannot tie DB R/O: /var/spool/ spamassassin/bayes_toks
<snip>
debug: open of AWL file failed: lock: 27966 cannot create tmp lockfile /var/spool/spamassassin/auto-whitelist.lock.mrblue.27966 for /var/spool/spamassassin/auto-whitelist.lock: Permission denied
<snip>
debug: auto-learning failed: lock: 27966 cannot create tmp lockfile / var/spool/spamassassin/bayes.lock.mrblue.27966 for /var/spool/ spamassassin/bayes.lock: Permission denied
<snip>
==== end output ====


I'm running spamc as user filter invoked by postfix on Debian Sarge.
In /etc/postfix/master.cf:

spamassassin
          unix  -       n       n       -       -       pipe
user=filter argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f $ {sender} ${recipient}


In /usr/share/doc/spamassassin/README.Debian it reads:

Configuring spamd
-----------------

If you intend to use Bayes sitewide, you will need to create a
world-writable and world-readable directory. /var/spool/spamassassin
is recommended as an FHS-compliant path. You will then need to add the
following lines to /etc/spamassassin/local.cf:
        bayes_path        /var/spool/spamassassin/bayes
        bayes_file_mode   0666

If you intend to run spamd as a non-root user, you will need to ensure
the pidfile to which spamd writes its PID is writable by that
user. The best way to do this is to create a directory
/var/run/spamassassin with appropriate permissions which will hold
this file.


So I added the settings to local.cf and added the world readable & writable directory:

mrblue:/# ls -lh /var/spool/ | grep spam
drw-rw-rw-   2 root     root     4.0K 2006-09-26 20:07 spamassassin

mrblue:/# ls -lh /var/spool/spamassassin/
total 4.6M
-rw-rw-rw-  1 root root  12K 2006-09-26 20:07 auto-whitelist
-rw-rw-rw-  1 root root 5.1K 2006-09-26 20:07 bayes_journal
-rw-rw-rw-  1 root root 632K 2006-09-26 20:07 bayes_seen
-rw-rw-rw-  1 root root 5.2M 2006-09-26 20:07 bayes_toks


Am I missing something? And should I look into this PID file issue mentioned in the readme? filter does seem to run.


TIA


Peter



Reply to: