User Tools

Site Tools


internet:hosting:virtualmin_spam_troubleshoot

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
internet:hosting:virtualmin_spam_troubleshoot [2016/02/05 13:22]
gcooper
internet:hosting:virtualmin_spam_troubleshoot [2016/02/10 09:36] (current)
gcooper
Line 3: Line 3:
 https://www.virtualmin.com/node/39491 https://www.virtualmin.com/node/39491
  
-Scan a message as root:+:!: Replace the <virtual-server>, <username> and <junk_message> placeholders as necessary. 
 + 
 +:!All dashes, spaces and punctuation are important. 
 + 
 +===== Check for Needed Perl Modules =====
  
 <file> <file>
-spamassassin -D --p /home/processengineeringllc/homes/eiasillo/.spamassassin/user_prefs < /home/processengineeringllc/homes/eiasillo/Maildir/.spam/cur/1454619898.14251_0.www+spamassassin -D --lint 2>&1 | grep -i failed
 </file> </file>
  
-Scan a message as a user:+===== 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:
  
 <file> <file>
-su -s /bin/sh -c "spamassassin -D -t -/home/processengineeringllc/homes/eiasillo/.spamassassin/user_prefs < /home/processengineeringllc/homes/eiasillo/Maildir/.spam/cur/1454565258.32109_0.www" eiasillo+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
 </file> </file>
  
-Train the Bayesian filter as a user:+===== Scan a Message ===== 
 + 
 +Scan a message using the ''spamc'' client with the processing done by ''spamd'' and ''spamd child'' (both running as root):
  
 <file> <file>
-su -/bin/sh -c "sa-learn -D --spam --no-sync /home/processengineeringllc/homes/eiasillo/Maildir/.spam/{cur,new}" - eiasillo+spamc -u <username>/home/<virtual-server>/homes/<username>/Maildir/.spam/cur/<junk_message>
 </file> </file>
  
-Update rules (taken from ''/etc/cron.daily/spamassassin''):+Scan a message as root:
  
 <file> <file>
-su debian-spamd -c "sa-update --gpghomedir /var/lib/spamassassin/sa-update-keys"+spamassassin ---p /home/<virtual-server>/homes/<username>/.spamassassin/user_prefs < /home/<virtual-server>/homes/<username>/Maildir/.spam/cur/<junk_message>
 </file> </file>
  
-Permissions on ''debian-spamd'' home directory:+Scan a message as a user:
  
 <file> <file>
-chown -R debian-spamd.debian-spamd /var/lib/spamassassin +su -s /bin/sh -c "spamassassin -D -t -p /home/<virtual-server>/homes/<username>/.spamassassin/user_prefs < /home/<virtual-server>/homes/<username>/Maildir/.spam/cur/<junk_message>" <username> 
-find /var/lib/spamassassin -type f -exec chmod 644 {} \; +</file>
-find /var/lib/spamassassin -type d -exec chmod 775 {} \;+
  
-reboot+===== Bayesian Filter ===== 
 + 
 +Train the Bayesian filter as a user: 
 + 
 +<file> 
 +su -s /bin/sh -c "sa-learn -D --spam --no-sync /home/<virtual-server>/homes/<username>/Maildir/.spam/{cur,new}" - <username>
 </file> </file>
 +
 +===== Rules Updates =====
 +
 +Update rules (taken from ''/etc/cron.daily/spamassassin''):
 +
 +<file>
 +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"
 +</file>
 +
internet/hosting/virtualmin_spam_troubleshoot.1454703733.txt.gz · Last modified: 2016/02/05 13:22 by gcooper