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

Manually Clear from Console / Command Line cPanel Exim Mail Queue

To clear the cPanel exim mail queue quickly from a command line / shell use the following...

Remount /tmp with exec permission

There are times where you may need to have exec permission available for the /tmp folder. This...

cPanel Account - PHP Startup: Unable to load dynamic library

PHP Warning:  PHP Startup: Unable to load dynamic library './xsl.so' - ./xsl.so: cannot open...

FTP Failed: Service check failed to complete Unable to connect to port 21

The service “ftpd” appears to be down. The system failed to connect to this service’s TCP/IP...

FSCK Options and Maintenance

Provided below are some useful commands pertaining to FSCK. Update commands to your environment /...