Skip to main content

spamassassin sa-learn run on cron job

Comments

10 comments

  • cPRex Jurassic Moderator
    Is that the correct way to use the command to run on cron job in every 24 hours?

    Hey there! I would expect that cron to work well - that will scan the data in your .spam folder every 24 hours to help teach SpamAssassin to better define what you mark as spam. The "-p" option with "/home/USER/.spamassassin/user_prefs" is used to ensure previous user configurations are honored, like a white-listed email account. That "user_prefs" file will get used every time the scan runs. user_prefs is specifically that - manually configured preferences, and that wouldn't get updated each night.
    When I receive the junk emails and move them to junk folder, will the cron job command with spamassassin to tell them what new emails in the junk folder are spam so the spamassassin will learn from it?

    Yes, exactly
    And also I want to know how I increase the spam scores when I send myself a test emails to send spammy emails from gmail to my own domain??

    I'm not sure there is a good way to do that. You don't want to start marking test messages as spam, or SpamAssasssin will learn from that as well, and mark future Gmail messages as spam. You can adjust the spam score threshold as outlined here: Spam Filters | cPanel & WHM Documentation
    0
  • chris0147
    Hey there! I would expect that cron to work well - that will scan the data in your .spam folder every 24 hours to help teach SpamAssassin to better define what you mark as spam.

    Oh I got it!
    The "-p" option with "/home/USER/.spamassassin/user_prefs" is used to ensure previous user configurations are honored, like a white-listed email account. That "user_prefs" file will get used every time the scan runs. user_prefs is specifically that - manually configured preferences, and that wouldn't get updated each night.

    Oh right, so how I can update in the user_prefs to add the spam emails? Do I have to write on PHP or there is no need to??
    0
  • cPRex Jurassic Moderator
    user_prefs doesn't get updated each time you run salearn. That file controls the global options for the cPanel account, such as the score settings and whatnot. I'm not sure what you mean with your PHP question - can you get me more details?
    0
  • chris0147
    user_prefs doesn't get updated each time you run salearn. That file controls the global options for the cPanel account, such as the score settings and whatnot. I'm not sure what you mean with your PHP question - can you get me more details?

    Sorry I mean that do I have to update in the user_prefs like subject, blacklist the emails, body...etc or I dont have to do this as long spamassassin are monitoring my incoming emails??
    0
  • cPRex Jurassic Moderator
    Correct - you shouldn't have to change anything in there unless you want to later on for the score settings.
    0
  • chris0147
    Correct - you shouldn't have to change anything in there unless you want to later on for the score settings.

    You haven't answered my question.
    0
  • chris0147
    I have got other questions. I'm storing the source emails in a database after I have fetching the emails from imap. I'm running the cron job in every 24 hours to monitor for spam emails in the spam folder so the Bayes database can get update. Here is what I use to run on cron job: /usr/local/cpanel/3rdparty/bin/sa-learn -p ~/.spamassassin/user_prefs --spam ~/mail/mydomain.com/myaccount/.spam/{cur,new I'm using to store the emails in a database, can I run the PHP on cron job to get the Bayes database update? Example: /usr/local/cpanel/3rdparty/bin/sa-learn -p ~/.spamassassin/user_prefs --spam ~/public_html/username/myfolder/update_bayes.php Would it ever work to get the Bayes database update when I run the PHP script in the cron job so the spamassassin could learn from it??
    0
  • cPRex Jurassic Moderator
    That part I don't know - it would be best to create a ticket with our team so we can do some additional investigation into how those interact, as I'm not finding much clear information on my end for the Bayes portion of your questions.
    0
  • chris0147
    That part I don't know - it would be best to create a ticket with our team so we can do some additional investigation into how those interact, as I'm not finding much clear information on my end for the Bayes portion of your questions.

    Oh ok, I have created a ticket to get the staff to look at but it have been 24 hours and I get no answer.
    0
  • cPRex Jurassic Moderator
    Can you post the ticket number here so I can check that out?
    0

Please sign in to leave a comment.