searching howto for RulesDuJour

CoolMike

Well-Known Member
Sep 6, 2001
312
0
316
Hi

I would like to use RulesDuJour to update my SARE rules, but I was not able to find any howto which is using the new version. I only find not working links...

Can someone send me a working link to an instruction?

Michael
 

sparek-3

Well-Known Member
Aug 10, 2002
2,007
222
368
cPanel Access Level
Root Administrator
I thought one had been posted on here. Not sure where I got mine.

Download the rules_du_jour script and place it somewhere in your path

wget http://sandgnat.com/rdj/rules_du_jour
mv rules_du_jour /usr/local/sbin
chmod 700 /usr/local/sbin/rules_du_jour


Now create a blank configuration

mkdir /etc/rulesdujour
touch /etc/rulesdujour/config


Edit the /etc/rulesdujour/config file with your favorite editor and add:

Code:
TRUSTED_RULESETS="TRIPWIRE SARE_ADULT SARE_OBFU0 SARE_OBFU1 SARE_URI0 SARE_URI1 SARE_STOCKS"
SA_DIR="/etc/mail/spamassassin"
MAIL_ADDRESS="<your e-mail address>"
SA_RESTART="/scripts/restartsrv_spamd"
You can add or take away rulesets that you wish. Obviously change <your e-mail address> to your e-mail address.

That's it, now run rules_du_jour or /usr/local/sbin/rules_du_jour. One thing to be careful about, you should only run rules_du_jour once per day. I believe rulesemporium.com has measures in place that will block your IP if you make more than one download request per day or something like that.
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,466
31
473
Go on, have a guess
You'd probably be better off looking into sa-update since RulesDuJour has been deprecated (for some months now) in favour of it.

It's very simply to do, just create a shell script called sa-update.sh and add the lines:

Code:
#!/bin/sh
/usr/bin/sa-update
/usr/bin/sa-update --nogpg --channel saupdates.openprotect.com
Then run it daily via cron.
 

CoolMike

Well-Known Member
Sep 6, 2001
312
0
316
Thanks for the both solution. Chirpy, in this solution will it update all the installed rules, or where can I configure which rules should be checked and updated?

Michael
 

CoolMike

Well-Known Member
Sep 6, 2001
312
0
316
Chirpy, I just tried your script, but there is no output and after I run it I did not find any updates rules in /etc/mail/spamassassin.

Michael
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,466
31
473
Go on, have a guess
It doesn't show output if it works. You can find the rule sets it downloads and spamassassin uses in /var/lib/spamassassin/ - what I gave you above provides you with the very latest rules from spamassassin themselves (the first sa-update) and the second one provides the latest recommended rules from SARE.
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,466
31
473
Go on, have a guess
v3 of SpamAssassin automatically looks in /var/lib/spamassassin/ for rules. It's v3 that provides the sa-update procedure itself. It's nothing to do with cPanel :)

You can see this if you run sa-update and then do a:

spamassassin --lint -D

At the start of the output you should see it importing the downloaded rules from /var/lib/spamassassin/
 

mickalo

Well-Known Member
Apr 16, 2002
782
5
318
N.W. Iowa
It doesn't show output if it works. You can find the rule sets it downloads and spamassassin uses in /var/lib/spamassassin/ - what I gave you above provides you with the very latest rules from spamassassin themselves (the first sa-update) and the second one provides the latest recommended rules from SARE.
chirpy,

shouldn't the updates be applied into the /etc/mail/spamassasssin or /usr/share/spamassassin/ folders with Cpanel?

As there is nothing in the /var/lib/spamassassin/ folder location on 3 of the Cpanel servers we use. The folder is there but not spamassassin type files are in this location. Does the SA w/Cpanel also look into this folder location along with the others listed above ??

So your saying, that using the Rules DuJour is a waste of time now and should be used ??

Mickalo
 

mickalo

Well-Known Member
Apr 16, 2002
782
5
318
N.W. Iowa
v3 of SpamAssassin automatically looks in /var/lib/spamassassin/ for rules. It's v3 that provides the sa-update procedure itself. It's nothing to do with cPanel :)

You can see this if you run sa-update and then do a:

spamassassin --lint -D

At the start of the output you should see it importing the downloaded rules from /var/lib/spamassassin/
Ok, I see this now. I just ran the update on one of our less used servers and it does read from that folder ... interesting :)

Now should the sa-update be used in conjunction with the Rules DuJour or simply replace it and not use the Rules DuJour updates??

Now what are these other folder used for, the /etc/mail/spamassassin and /usr/share/spamassassin ? I was to understand that the /usr/share/spamassassin was the default folder used by SA ?

Mickalo
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,466
31
473
Go on, have a guess
There's no need for RulesDuJour if you're using sa-update, especially as I've suggested above.

/usr/share/spamassassin/ is the local for the default installation of SA
/etc/mail/spamassassin/ is where you should put yur own local SA configuration settings for server-wide rules - if you currently have SARE rulesets in here you should remove them
/var/lib/spamassassin/ is used for dynamically updated rules from sa-update which contains both updates to the default SA rules plus the recommended selection of SARE rules
 

mickalo

Well-Known Member
Apr 16, 2002
782
5
318
N.W. Iowa
There's no need for RulesDuJour if you're using sa-update, especially as I've suggested above.

/usr/share/spamassassin/ is the local for the default installation of SA
/etc/mail/spamassassin/ is where you should put yur own local SA configuration settings for server-wide rules - if you currently have SARE rulesets in here you should remove them
/var/lib/spamassassin/ is used for dynamically updated rules from sa-update which contains both updates to the default SA rules plus the recommended selection of SARE rules
thx's Chirpy for the info, very helpful.

I did notice now, when you run the sa-update, you end up with alot of duplicate files in the /var/lib/spamassassin and /usr/share/spamassassin folders. Is this OK or should they be removed from one of the folders?

Can the sa-updates be applied to the /usr/share/spamassassin folder(with the --updatedir option) without causing problems ... or is that not recommended?

Mickalo
 

CoolMike

Well-Known Member
Sep 6, 2001
312
0
316
Great, thanks, now it's working well. Is there a need to restart spamassassin after the rules are downloaded?
Michael
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,466
31
473
Go on, have a guess
I did notice now, when you run the sa-update, you end up with alot of duplicate files in the /var/lib/spamassassin and /usr/share/spamassassin folders. Is this OK or should they be removed from one of the folders?
I'd leave the /usr/share/spamassassin/ directory alone. The newer rules will override them anyway.
 

WebHostDog

Well-Known Member
Sep 3, 2006
144
1
166
cPanel Access Level
Website Owner
Hello,
Do we need both crontabs ?

1. sa-update --allowplugins --gpgkey D1C035168C1EBC08464946DA258CDB3ABDE9DC10 --channel saupdates.openprotect.com

2. sa-update --gpgkey D1C035168C1EBC08464946DA258CDB3ABDE9DC10 --channel saupdates.openprotect.com --channel updates.spamassassin.org

or one is enought ?