On Tuesday 21 July 2009, Bowie Bailey wrote: >Gene Heskett wrote: >> On Tuesday 21 July 2009, Bowie Bailey wrote:
>>> make sure that you are running sa-learn as the same user SA is running >>> as. A classic mistake is to run SA as one user and then run sa-learn as >>> a different user. >> >> Aha! sa-learn is running from the root crontab, and is training the bayes >> for the user gene, and kmail then suck /var/spool/mail/gene for the input >> I'm reading. >> The script is a bit complex and designed to do its own msg haandling. >> ----------------------- >> #!/bin/bash >> PATH=/sbin:/root/bin:/usr/bin:/bin >> # make sure the database is free >> killall fetchmail >> # wait for the spamd pipes to drain >> sleep 60 >> # do this dastardly deed >> cp /root/Mail/ham/cur/* /home/gene/Mail/ham/cur/ >> cp /root/Mail/spam/cur/* /home/gene/Mail/spam/cur/ >> chown gene:gene /home/gene/Mail/ham/cur/* >> chown gene:gene /home/gene/Mail/spam/cur/* >> runuser -l gene -c "sa-learn --ham /home/gene/Mail/ham/cur/*" >> runuser -l gene -c "sa-learn --spam /home/gene/Mail/spam/cur/*" >> # now, this stuff is trash >> rm -f /home/gene/Mail/ham/cur/* >> rm -f /home/gene/Mail/spam/cur/* >> rm -f /root/Mail/spam/cur/* >> # Note, I leave the ham for moving where it really goes >> # and restore fetchmail >> # and for some reason, on wednesday morning 12/17/08, fetchmail.log >> # was owned by root:root! WTF??? >> # That is a long time for logrotate to take effect, which is the only >> # other thing that could do this >> # So: (and put it in rc.local too just for good measure) >> chown gene:gene /var/log/fetchmail.log >> # to let the disks synch >> sleep 6 >> runuser -l gene -c "fetchmail -d 90 --fetchmailrc /home/gene/.fetchmailrc" >> ------------------------ >> as can be seen, the mail delivery system all runs as the user gene. >> So, in light of this, I should be running saupdate as gene, not as a >> separate user. >> >> Thanks for the forehead slap Bowie, I needed that. :) > >Well, like I said before, sa-update has no relation to sa-learn. As >long as it is working properly, it does not matter what user you are >using for sa-update. > >The question is: What user is SpamAssassin running as? Same user, gene. Or at least htop says all the spamd children are running as gene. >If you are >running spamd as root, then it will switch itself to the user account >who is receiving the mail. If you are running using amavisd-new, it >will run as the amavis user. No amivis, new or old. >If you are calling spamassassin directly >from procmail or some other delivery agent, Yes, from procmail. >it will run as whichever >user procmail (or whatever) is running as. (Unless you have specified a >global bayes database, in which case SA will always use that db.) > >One option is to disable your learning script for a while and then once >all the users have received some auto-learned mail, search the home >directories for the "bayes_seen" file and see which one(s) are being >updated. Only one user, me, aka root. I think bayes_seen may have more than one copy though, but the only current one is: -rw------- 1 gene gene 83636224 2009-07-21 22:41 /home/gene/.spamassassin/bayes_seen So that looks semi-kosher to me. That is about 4 minutes ago. Thanks. I'll let the waters settle & clear & see how this works over the next few days. -- Cheers, Gene "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) The NRA is offering FREE Associate memberships to anyone who wants them. <https://www.nrahq.org/nrabonus/accept-membership.asp> This sentence contradicts itself -- no actually it doesn't. -- Douglas Hofstadter