====== Troubleshoot Virtualmin Spam Filtering ====== https://www.virtualmin.com/node/39491 :!: Replace the , and placeholders as necessary. :!: All dashes, spaces and punctuation are important. ===== Check for Needed Perl Modules ===== spamassassin -D --lint 2>&1 | grep -i failed ===== Permissions ===== :!: Provisional - Be careful with this - Example is for Ubuntu 14.04 :!: Use ''-D'' to look for access problems. Permissions on ''debian-spamd'' home directory: chown -R debian-spamd.debian-spamd /var/lib/spamassassin find /var/lib/spamassassin -type f -exec chmod 644 {} \; find /var/lib/spamassassin -type d -exec chmod 775 {} \; chmod 700 /var/lib/spamassassin/sa-update-keys find /var/lib/spamassassin/sa-update-keys -type f -exec chmod 600 {} \; reboot ===== Scan a Message ===== Scan a message using the ''spamc'' client with the processing done by ''spamd'' and ''spamd child'' (both running as root): spamc -u < /home//homes//Maildir/.spam/cur/ Scan a message as root: spamassassin -D -t -p /home//homes//.spamassassin/user_prefs < /home//homes//Maildir/.spam/cur/ Scan a message as a user: su -s /bin/sh -c "spamassassin -D -t -p /home//homes//.spamassassin/user_prefs < /home//homes//Maildir/.spam/cur/" - ===== Bayesian Filter ===== Train the Bayesian filter as a user: su -s /bin/sh -c "sa-learn -D --spam --no-sync /home//homes//Maildir/.spam/{cur,new}" - ===== Rules Updates ===== Update rules (taken from ''/etc/cron.daily/spamassassin''): su - debian-spamd -c "sa-update -D --gpghomedir /var/lib/spamassassin/sa-update-keys" # Result codes: 0=got updates, 1=no updates, 2=lint failed echo $? su - debian-spamd -c "sa-compile"