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




Share this page:


Was this article useful? Have any suggestions or improvements to the information?

Also Read

Reset cPanel Max Defers for an Account

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

Failed to start tailwatchd. Unit tailwatchd.service entered failed state.

Failed to start tailwatchd. Unit tailwatchd.service entered failed state.  tailwatchd.service...

Remount /tmp with exec permission

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

E Sysup: Needed system RPMs were not installed: yum-utils

When encountering the following:E Sysup: Needed system RPMs were not installed: yum-utils*****...

ModSecurity: collection_store: Failed to access DBM file "/var/cpanel/secdatadir/ip": Permission denied

The error Failed to access DBM file /var/cpanel/secdatadir/ip: Permission denied can occur on...