The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

searching howto for RulesDuJour

Discussion in 'General Discussion' started by CoolMike, Jan 5, 2007.

  1. CoolMike

    CoolMike Well-Known Member

    Joined:
    Sep 6, 2001
    Messages:
    307
    Likes Received:
    0
    Trophy Points:
    16
    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
     
  2. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,383
    Likes Received:
    23
    Trophy Points:
    38
    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.
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    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.
     
  4. CoolMike

    CoolMike Well-Known Member

    Joined:
    Sep 6, 2001
    Messages:
    307
    Likes Received:
    0
    Trophy Points:
    16
    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
     
  5. CoolMike

    CoolMike Well-Known Member

    Joined:
    Sep 6, 2001
    Messages:
    307
    Likes Received:
    0
    Trophy Points:
    16
    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
     
  6. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    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.
     
  7. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    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/
     
  8. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    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
     
  9. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    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
     
  10. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    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
     
  11. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    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
     
  12. CoolMike

    CoolMike Well-Known Member

    Joined:
    Sep 6, 2001
    Messages:
    307
    Likes Received:
    0
    Trophy Points:
    16
    Great, thanks, now it's working well. Is there a need to restart spamassassin after the rules are downloaded?
    Michael
     
  13. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    I'd leave the /usr/share/spamassassin/ directory alone. The newer rules will override them anyway.
     
  14. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    Ok, thanks :)

    Mickalo
     
  15. abadaba

    abadaba Registered
    PartnerNOC

    Joined:
    Dec 14, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
  16. WebHostDog

    WebHostDog Well-Known Member

    Joined:
    Sep 3, 2006
    Messages:
    144
    Likes Received:
    0
    Trophy Points:
    16
    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 ?
     

Share This Page