spamassassin sa-learn run on cron job
Hi all,
I need your help with running the command on cron job. I am currently using this command to run on cron job in every 24 hours following by:
/usr/local/cpanel/3rdparty/bin/sa-learn -p /home/myusername/.spamassassin/user_prefs --spam /home/myusername/mail/mydomain.com/myaccount/.spam/{cur,new} >/dev/null 2>&1
Is that the correct way to use the command to run on cron job in every 24 hours?
If not, what command is the correct way for me to use to run on cron job??
How I can get the user_prefs to get update when I move the emails to junk folder and the cron job run the command in every 24 hours?
When I moved the emails to junk folder and I ran the command on cron job, the user_prefs doesn't get updated. The only things what I can see is the bayes_toks and bayes_seen get update, not for user_prefs. I am not sure why??
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?
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??
-
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, exactlyAnd 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 Documentation0 -
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 -
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 -
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 -
Correct - you shouldn't have to change anything in there unless you want to later on for the score settings. 0 -
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 -
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 -
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 -
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 -
Can you post the ticket number here so I can check that out? 0
Please sign in to leave a comment.
Comments
10 comments