SpamAssassin Command Line Bayesian Learn Command cPanel

Once it is enabled, it is necessary to train spamassassin to learn what is junk mail and what is ham. To scan through an email folder with assigned junk with a cPanel install run the following command (Update for your environment):


/usr/local/cpanel/3rdparty/bin/sa-learn --no-sync --spam /home/username/mail/domain.com/account/.Junk/



To scan and add for ham (good email) run the following command:


/usr/local/cpanel/3rdparty/bin/sa-learn --no-sync -ham /home/username/mail/domain.com/account/Inbox/cur



  • 165 Users Found This Useful

Was this answer helpful?

Related Articles

CSF Error: *WARNING* Binary location for [HOST] [/usr/bin/host] in /etc/csf/csf-conf is either incorrect, is not installed or is not executable

During a CSF start or restart you may encounter this error. This is a result of /usr/bin/host...

Whitelisting Multiple IPs with Mod_Security

Whitelisting Multiple IPs in ModSecurity   If ModSecurity is blocking legitimate requests...

Manually Clear from Console / Command Line cPanel Exim Mail Queue

Clearing the Exim Mail Queue From Command Line   If the Exim mail queue on your server has...

cPanel Max Defers Occurring for an Account

While viewing exim_mainlog and seeing the following:   enforce_mail_permissions: Domain...

cPanel Account - PHP Startup: Unable to load dynamic library

PHP Startup Error: Unable to Load Dynamic Library   The error "PHP Startup: Unable to load...



Save 30% on web hosting - Use coupon code Hosting30