Introduction
While the SpamAssassin service is a great tool for fighting against incoming SPAM messages, unwanted emails continue to change in order to try and bypass these checks. The sa-learn utility (/usr/local/cpanel/3rdparty/bin/sa-learn
) is included to help SpamAssassin keep up with your needs. The account owner can use this tool to teach the SpamAssassin database what messages you deem as 'spam' or 'ham' (legitimate mail) directly, in order to update its detection database to meet your personal needs.
Please note that the sa-learn utility should not be run as the 'root' user.
Procedure
Please note that to use the sa-learn tool, the SpamAssassin service will need to be running and enabled for the related account, and Auto-delete must be disabled for SpamAssassin so that any false positives can be marked as 'ham.'
- Log into Webmail for an email account.
- Move all spam from the Inbox to the spam/Junk folder.
- Move any legitimate email in the spam/Junk folder to the Inbox.
- Access the server's command line as the cPanel user via SSH or "Terminal" in cPanel.
- Run the following command to teach SpamAssassin to identify 'spam' messages.
- maildir mailbox format
/usr/local/cpanel/3rdparty/bin/sa-learn -p /home/$cpusername/.spamassassin/user_prefs --spam /home/$cpusername/mail/$domain.tld/$user/.Junk/{cur,new}
- mdbox mailbox format
/usr/local/cpanel/3rdparty/bin/sa-learn --mbox -p /home/$cpusername/.spamassassin/user_prefs --spam /home/$cpusername/mail/$domain.tld/$user/.Junk/{cur,new}
- maildir mailbox format
- Run the following command to teach SpamAssassin to identify 'ham' messages.
- maildir mailbox format
/usr/local/cpanel/3rdparty/bin/sa-learn -p /home/$cpusername/.spamassassin/user_prefs --ham /home/$cpusername/mail/$domain.tld/$user/{cur,new}
- mdbox mailbox format
/usr/local/cpanel/3rdparty/bin/sa-learn --mbox -p /home/$cpusername/.spamassassin/user_prefs --ham /home/$cpusername/mail/$domain.tld/$user/{cur,new}
- maildir mailbox format
Please note that SpamAssassin should be trained with at least 1000 'spam' messages and 1000 'ham' messages. The more messages SpamAssassin is trained on, the more accurate the spam identification will be. Training SpamAssassin with more than 5000 messages doesn't significantly improve its accuracy.
Additional resources
Exim Configuration Manager Basic Editor: Apache SpamAssassin™ Options
Comments
0 comments
Article is closed for comments.