[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: spamd and the nobody home
From: |
Bob Proulx |
Subject: |
Re: spamd and the nobody home |
Date: |
Sun, 18 Jul 2021 19:28:57 -0600 |
Bob Proulx wrote:
> I decided to fix this. But don't want to use those files from 2012
> and 2013 so I move the directory to old-nobody and set up new files.
> I will experiment around to see if I can make this usable so that
> there can be Bayes learning for it.
I might have this working now.
/var/lib/spamassassin/nobody:
-rw------- 1 nobody nogroup 6 Jul 18 21:06 bayes.mutex
-rw------- 1 nobody nogroup 12288 Jul 18 21:06 bayes_seen
-rw------- 1 nobody nogroup 24576 Jul 18 21:16 bayes_toks
-rw-r--r-- 1 root root 571 Jul 18 20:42 user_prefs
For reasons of general performance in the user_prefs file I turned off
bayes_auto_expire. That's a normal thing for me because inline
expiration takes a long time for normal message processing. This
speeds that up significantly.
# Because there is no NFS involved we can speed things up by specifying
# to use flock explicitly.
lock_method flock
# Stop SA from running bayes expires (takes long time) during message
# handling. But now must have cronjob run sa-learn --force-expire!
bayes_auto_expire 0
# Default is 150000 tokens which on this busy system is one day.
bayes_expiry_max_db_size 500000
That required setting up a separate cron job that is run every few
hours. I also increased the size of the database as I have found that
helps with things too. Here is the new /etc/cron.d/spamd-local file.
30 0,6,12,18 * * * root start-stop-daemon --start --user nobody
--pidfile /var/run/spamd.pid --name spamd --exec /usr/bin/sa-learn -- --dbpath
/var/lib/spamassassin/nobody --force-expire
I used start-stop-daemon to switch user for consistency with other
things on this Debian based system. Also it checks pid and name too.
If it were on a non-Debian system then I would use "su" for the same
purpose of switch user instead and not worried about the pid and name
checking.
After just a few minutes I see that messages are being processed.
root@debbugs:~# start-stop-daemon --verbose --start --user nobody --pidfile
/var/run/spamd.pid --name spamd --exec /usr/bin/sa-learn -- --dbpath
/var/lib/spamassassin/nobody --dump magic
Starting /usr/bin/sa-learn...
0.000 0 3 0 non-token data: bayes db version
0.000 0 0 0 non-token data: nspam
0.000 0 4 0 non-token data: nham
0.000 0 527 0 non-token data: ntokens
0.000 0 1626656201 0 non-token data: oldest atime
0.000 0 1626656774 0 non-token data: newest atime
0.000 0 0 0 non-token data: last journal sync
atime
0.000 0 1626657419 0 non-token data: last expiry atime
0.000 0 0 0 non-token data: last expire atime
delta
0.000 0 0 0 non-token data: last expire
reduction count
Time to let it sit and simmer for a while and then check it again
later. It needs to collect at least 200 messages of both nspam and
nham in order for SpamAssassin to use it. I am sure that will happen
within a short time. And then hopefully the Bayes will improve the
anti-spam accuracy somewhat. Although frankly I am not sure where
this comes into play in the email flow of debbugs. Maybe just exim
incoming and not elsewhere? I have no idea.
Bob