Spamassassin: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 5: | Line 5: | ||
DomainDotCom=Email_account_domain | DomainDotCom=Email_account_domain | ||
EmailUser=Email_account_name | EmailUser=Email_account_name | ||
echo -e "\n\nThe accounts username is $CpUser and the email account for the bayesian filter is $EmailUser@$DomainDotCom\n\n" | echo -e "\n\nThe accounts username is $CpUser and the email account for the bayesian filter is $EmailUser@$DomainDotCom\n\n" | ||
Line 14: | Line 13: | ||
Make the script | Make the script | ||
echo | echo '#!/bin/bash' >> /home/$CpUser/.spamassassin/spamassassin.sh | ||
echo -e "#learning spam\n sa-learn --spam /home/$CpUser/mail/$DomainDotCom/$EmailUser/.Spam/{cur,new}\n#clean out the spam\n# find /home/$CpUser/mail/$DomainDotCom/$EmailUser/.Spam/{cur,new}/* -type f -maxdepth=1 -delete \n\n#learning safe mail\n sa-learn --ham /home/rapmusic/mail/$DomainDotCom/$EmailUser/.Ham/{cur,new}" >> /home/$CpUser/.spamassassin/spamassassin.sh | |||
Change perms and add cron: | Change perms and add cron: |
Revision as of 21:58, 24 October 2014
Bayesian Filter
First set the Variables that you are working on
CpUser=cpanel_username_here DomainDotCom=Email_account_domain EmailUser=Email_account_name echo -e "\n\nThe accounts username is $CpUser and the email account for the bayesian filter is $EmailUser@$DomainDotCom\n\n"
Then do the following:
cd /home/$CpUser/.spamassassin/ echo "use_bayes 1" >> user_prefs echo "bayes_auto_learn 1" >> user_prefs
Make the script
echo '#!/bin/bash' >> /home/$CpUser/.spamassassin/spamassassin.sh echo -e "#learning spam\n sa-learn --spam /home/$CpUser/mail/$DomainDotCom/$EmailUser/.Spam/{cur,new}\n#clean out the spam\n# find /home/$CpUser/mail/$DomainDotCom/$EmailUser/.Spam/{cur,new}/* -type f -maxdepth=1 -delete \n\n#learning safe mail\n sa-learn --ham /home/rapmusic/mail/$DomainDotCom/$EmailUser/.Ham/{cur,new}" >> /home/$CpUser/.spamassassin/spamassassin.sh
Change perms and add cron:
chown $CpUser. /home/$CpUser/.spamassassin/spamassassin.sh chmod +x /home/$CpUser/.spamassassin/spamassassin.sh echo "00 1 * * * /home/$CpUser/.spamassassin/spamassassin.sh" >> /var/spool/cron/$CpUser /etc/init.d/crond reload