I think I'm dealing with a similar situation. Here's what you could try.
Forget about changing the user that spamd runs as. The fact that it
falls back to nobody maybe ok. Say your tokens are located in
/home/admin/.spamassassin. Open /etc/spamassassin/local.cf and put these
two lines in there:

bayes_path /home/me/.spamassassin/bayes
bayes_file_mode 0777

Make sure the directory /home/me/.spamassassin and files in that
directory have write and read permissions for your nobody user.

OK, then restart spamd and send yourself a test message. Look inside
the message and look for the X-Spam-Status line. If it mentions BAYES,
then it worked. If not, run spamd with the -D option. That will put
debug messages in your syslog. Look at those messages and see what it's
doing. It's pretty descriptive.

Don't forget to remove the -D option after you're done :)

By the way, where do you call spamc from?

I'm not an expert on SA by any means, so take it with a grain of salt.



On Sun, May 21, 2006 at 12:46:32PM -1000, Chan, Wilson wrote:
> I read the man docs and I need to specify "-u username" so the question
> is where do I put this? I create a username called spam and gave it full
> rights to where the bayes tok files are to be located. 
> 
> I tried to add it to SPAMDOPTIONS="-d -c -m5 -H -u spam" Is this correct
> because after I restarted the service I still see the same error
> message. :( 
> 
> /etc/init.d/spamassassin
> #!/bin/sh
> #
> # spamassassin This script starts and stops the spamd daemon
> #
> # chkconfig: - 80 30
> # processname: spamd
> # description: spamd is a daemon process which uses SpamAssassin to
> check \
> #              email messages for SPAM.  It is normally called by spamc
> \
> #              from a MDA.
> 
> # Source function library.
> . /etc/rc.d/init.d/functions
> 
> prog="spamd"
> 
> # Source networking configuration.
> . /etc/sysconfig/network
> 
> # Check that networking is up.
> [ ${NETWORKING} = "no" ] && exit 0
> 
> # Set default spamd configuration.
> SPAMDOPTIONS="-d -c -m5 -H -u spam"
> SPAMD_PID=/var/run/spamassassin/spamd.pid
> 
> # Source spamd configuration.
> if [ -f /etc/sysconfig/spamassassin ] ; then
>         . /etc/sysconfig/spamassassin
> fi
> 
> [ -f /usr/bin/spamd -o -f /usr/local/bin/spamd ] || exit 0
> PATH=$PATH:/usr/bin:/usr/local/bin
> 
> # By default it's all good
> RETVAL=0
> 
> # See how we were called.
> case "$1" in
>   start)
>         # Start daemon.
>         echo -n $"Starting $prog: "
>         daemon $NICELEVEL spamd $SPAMDOPTIONS -r $SPAMD_PID
>         RETVAL=$?
>         echo
>         if [ $RETVAL = 0 ]; then
>                 [ -n "$SPAMD_PID" ] && ln -s $SPAMD_PID
> /var/run/spamd.pid
>                 touch /var/lock/subsys/spamassassin
>         fi
>         ;;
>   stop)
>         # Stop daemons.
>         echo -n $"Stopping $prog: "
>         killproc spamd
>         RETVAL=$?
>         echo
>         if [ $RETVAL = 0 ]; then
>                 rm -f /var/lock/subsys/spamassassin
>                 rm -f /var/run/spamd.pid
>         fi
>         ;;
>   restart)
>         $0 stop
>         $0 start
>         ;;
>   condrestart)
>        [ -e /var/lock/subsys/spamassassin ] && $0 restart
>        ;;
>   status)
>         status spamd
>         RETVAL=$?
>         ;;
>   *)
>         echo "Usage: $0 {start|stop|restart|status|condrestart}"
>         RETVAL=1
>         ;;
> esac
> 
> exit $RETVAL
> 
> 
> 
> Wilson
> 
> 
> -----Original Message-----
> From: Theo Van Dinter [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, May 21, 2006 11:58 AM
> To: users@spamassassin.apache.org
> Subject: Re: Bayes not learning (autolearn=failed)
> 
> On Sun, May 21, 2006 at 11:16:14AM -1000, Chan, Wilson wrote:
> > By default on CentOS I think it runs as root. How do you change it so
> > that spamd is not running as root? I assume I'd have to change a
> > parameter in /etc/rc.d/init.d/spamassassin? Thanks!
> 
> If you read the spamd man page, it tells you how to specify the user to
> run
> as.  You will also want to check out the Mail::SpamAssassin::Conf
> man/pod to
> see configuration options related to bayes_path, etc.
> 
> -- 
> Randomly Generated Tagline:
> Stewie: Ah!  Damn it!  I want pancakes.  God!  You people understand
>  every language except English.  Yo quiero pancakes.  Dali mua pancakes.
>  Clik clik bloody clik pancakes!
>                          - Family Guy, "Love Thy Trophy"
> 

Reply via email to