How to train SpamAssassin on Plesk server?

Follow

Comments

14 comments

  • Avatar
    Taras Ermoshin

    Hello @Justin Lnch!

    >It says above that "SpamAssassin is not being trained by default." But then below says "there is the utility spamtrain in Plesk which is executed during the Daily Maintenance Task." Do we need to put this in a cron job each day to have it run? Or is it being run already?

    No additional actions are needed - once SpamAssassin is installed and enabled, the utility spamtrain is executed automatically once a day in the scope of the Plesk Daily Maintenance Task.

    There was indeed confusing wording in the article, so I updated it accordingly.

    >Where do we see which daily maintenance tasks are set to run?

    You can see the list of the Plesk Daily Maintenance Task subtasks by executing the command plesk daily -l. All subtasks are executed when the main task is executed once a day.

    1
    Comment actions Permalink
  • Avatar
    BP

    Are there details on how spamtrain works? Which e-mails / folders does it consider to be ham or spam?

    1
    Comment actions Permalink
  • Avatar
    Justin Lnch

    It says above that "SpamAssassin is not being trained by default." But then below says "there is the utility spamtrain in Plesk which is executed during the Daily Maintenance Task." Do we need to put this in a cron job each day to have it run? Or is it being run already? I would have thought this is being run to learn that all the messages in a users Spam filter are spam? 

    Where do we see which daily maintenance tasks are set to run?


    1
    Comment actions Permalink
  • Avatar
    John Bertin

    Whenever I enter "/usr/local/psa/bin/sw-engine-pleskrun" in SSH, the console just hangs and returns nothing. Did I missing anything?

    1
    Comment actions Permalink
  • Avatar
    Jan van den Broek

    Hi,

    Is there a way to add some words directly into its dictionary. 

    Is there a file (or database table e.a.) which we can modify manually?

     

     

     

    0
    Comment actions Permalink
  • Avatar
    gernot schabkar

    where can i find spam folder, if there are many with same name??

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello Jordan Schelew

    It's required to have a deep investigation.

    This will be continued in a ticket.

    0
    Comment actions Permalink
  • Avatar
    John Bertin

    There is no spam folder under /var/qmail/mailnames/

    Is there another place this could be?

    0
    Comment actions Permalink
  • Avatar
    Jordan Schelew

    We're attempting to run `/sbin/plesk daily ExecuteSpamtrain` on cron hourly rather than just sticking to the default daily schedule so that those who like to archive or organize their ham messages can do so sooner than next-day. This generally works, but it seems to take equally as long to run each time.

    According to the sa-learn docs:

    "if you have previously learnt [any messages] as ham, it'll skip them this time around."

    Are we sure that's working as it should be? I would expect that running spamtrain repeatedly would make for much faster runs after the first one as it would essentially be skipping everything but maybe 1 or 2 messages that arrived between runs.

    I wonder if because Plesk appears to be piping the message contents into sa-learn, rather than specifying file paths, perhaps it's not able to detect what messages it has already trained. If so, then this creates much greater load than is necessary, not only in our scenario where we're running it more frequently, but also in the normal daily run that Plesk does by default as it would have to rescan *all* messages every single day.

    0
    Comment actions Permalink
  • Avatar
    Ivan Kamnev

    Hello @gernot schabkar,

    On Plesk for Linux Spam folder has the following path:
    /var/qmail/mailnames/example.com/johndoe/Maildir/.Spam/cur/

    On Plesk for Windows Spam folder has the location as below:
    C:\Program Files (x86)\Mail Enable\Postoffices\example.com\MAILROOT\johndoe\Junk E-mail

    0
    Comment actions Permalink
  • Avatar
    Konstantin Annikov (Edited )

    Hello, 

    Plesk is using sa-lern utility to train SpamAssasin. The description of the utility is available in its documentation: 

         https://spamassassin.apache.org/full/3.1.x/doc/sa-learn.html

    And bayes algorithms (which are used in SpamAssasin) are described on another documentation page:

         https://wiki.apache.org/spamassassin/BayesInSpamAssassin

    Here is the quote:

         The Bayesian classifier in Spamassassin tries to identify spam by looking at what are called tokens; words or short character sequences that are commonly found in spam or ham. 

    If you need more details regarding that, please contact SpamAssasin developers. 

    0
    Comment actions Permalink
  • Avatar
    George Alibegashvili

    Hello @John Bertin

    In the example provided in the article mailbox with the name spam@example.com was created.

    So directory var/qmail/mailnames/example.com/spam/ is created for spam@example.com mailbox.
    It is just an example and in your case, you can use any other mailbox to train Spam Assasin.
    For example, if you will create mailbox spammailbox@example.com directory var/qmail/mailnames/example.com/spammailbox/ will be created for that mailbox.

    0
    Comment actions Permalink
  • Avatar
    Alexandr Redikultsev

    Hi, @John Bertin.

    By default output is empty, however you can enable Plesk debug and run the command again in case you want to see what is actually happening.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request