• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Running spamtrain for a single mailbox

PSi_101

Regular Pleskian
Spamtrain runs for all mailboxes on the server but often I want to put spam into the spam folder and then run spamtrain for a single mailbox.
Is this possible?
 
Hi PSi_101,

sure, this is possible. Let's assume, that you use the eMail - adress: [email protected] and you moved all SPAM into the current SPAM - folder and already marked them all as read, then you would use the following command to train SPAM:

/usr/bin/sa-learn --no-sync --spam --mbox /var/qmail/mailnames/YOUR-DOMAIN.com/test/Maildir/.Spam/cur

while you would use the following command to train HAM, for eMails you already marked as read:

/usr/bin/sa-learn --no-sync --ham --mbox /var/qmail/mailnames/YOUR-DOMAIN.com/test/Maildir/cur

Once you completed you trainings, you would use the command "sa-learn --sync".


It is as well possible to use the string "/{cur,new}" instead of the single folder "/cur", so that you could train as well new, unread messages, but I still recommend the first examples.

 
Last edited by a moderator:
If I use the --mbox option it doesn't work (picks up 0 spam), but if I remove the option, it picks up the spam just fine.
 
If I use the --mbox option it doesn't work (picks up 0 spam), but if I remove the option, it picks up the spam just fine.
Yes, you are correct... I normally convert mailboxes into a mbox - format, because of compatibility/backup reasons. You would certainly use the provided commands without the "--mbox" - option when you use standart settings.
 
Back
Top