On 01/03/2019 08.39, Andrey Repin wrote:
Greetings, Thomas Seilund!
smtp inet n - n - - smtpd -o
content_filter=spamfilter -o receive_override_options=no_address_mappings
spamfilter unix - n n - - pipe
flags=Rq user=vmail argv=/usr/bin/spamfilter.sh -oi -f ${sender}
${recipient}
Furthermore, I have this script in /usr/bin/spamfilter:
#!/bin/bash
SENDMAIL=/usr/sbin/sendmail
SPAMASSASSIN=/usr/bin/spamc
RECEIVER=`echo $4 | tr '[:upper:]' '[:lower:]'`
${SPAMASSASSIN} -u $RECEIVER | ${SENDMAIL} "$@"
exit $?
Finally, this is the parameters I have for SA in file
/etc/sysconfig/spamassassin:
SPAMDOPTIONS="--daemonize --create-prefs --max-children=5
--helper-home-dir=/mnt/ebs01/vmail/%d/%l/SpamAssassin --username=vmail
--nouser-config --virtual-config-dir=/mnt/ebs01/vmail/%d/%l/SpamAssassin"
export PYTHONPATH=/usr/lib/python2.6/site-packages
If your users are not using personal spamassasin lists, you can just tell it
to use same user for all server works.
I assume I do use personal SA lists as I run like this:
-- Each user has a LearnAsSpam and LearnAsHam mailfolder.
-- I instruct users to move mails that SA falsely did not tag as spam to
the LearnAsSpam folder
-- I instruct users to have at least 10 not spam messages in LearnAsHam
-- Once a day for each user I clear the bayes files and rebuild bayes
files with:
-- sudo -u vmail sa-learn --username vmail --spam --dbpath
$SUBDIR/SpamAssassin $SUBDIR/mail/LearnAsSpam/cur
-- sudo -u vmail sa-learn --username vmail --ham --dbpath
$SUBDIR/SpamAssassin $SUBDIR/mail/LearnAsHam/cur
-- $SUBDIR evaluates to each users vmail directory, ie.
/mnt/ebs01/vmail/netmaster.dk/tps
If there is a better way to keep bayes upto date I would be happy to know.
BTW, thanks for all the help