Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: [SOLVED] sa-update spamassassin

  1. #1
    jfone is offline Intermediate Member
    Join Date
    Oct 2008
    Posts
    17
    Rep Power
    6

    Default [SOLVED] sa-update spamassassin

    I wish to implement a process to update my *.cf files for spamassasin using sa-update. I do not have a separate install of spamassasin and am not allowed to install anything outside of the the /opt/zimbra tree. I have read a great deal of documentation/forums but there is nothing specific to zimbra and sa-update/spamassassin. The only info I could find was from BUG 27844 which gives short instructions on how to install sa-update. I'm able to get sa-update to download the files and then dropped into the correct directory

    Code:
    [zimbra@lwmtai1 ~]$ ls -la /opt/zimbra/lib/spamassassin/3.002005/updates_spamassassin_org | head -10
    total 596
    drwxr-x--- 2 zimbra zimbra   4096 Mar  3 14:19 .
    drwxr-x--- 3 zimbra zimbra   4096 Mar  3 13:01 ..
    -rw-r----- 1 zimbra zimbra   5682 Mar  3 11:46 10_default_prefs.cf
    -rw-r----- 1 zimbra zimbra   7504 Mar  3 11:46 20_advance_fee.cf
    -rw-r----- 1 zimbra zimbra   6774 Mar  3 11:46 20_body_tests.cf
    -rw-r----- 1 zimbra zimbra   1889 Mar  3 11:46 20_compensate.cf
    -rw-r----- 1 zimbra zimbra  13402 Mar  3 11:46 20_dnsbl_tests.cf
    -rw-r----- 1 zimbra zimbra  14993 Mar  3 11:46 20_drugs.cf
    -rw-r----- 1 zimbra zimbra  11019 Mar  3 11:46 20_dynrdns.cf
    But I am then unable to have spamassassin read these new files.

    Is spamassassin suppose to read the default files in /opt/zimbra/conf/sapmmassassin and this new repository or just the new repositiory?

    sa-update file:
    Code:
    my $DEF_RULES_DIR   = '/opt/zimbra/conf/spamassassin';
    my $LOCAL_RULES_DIR = '/opt/zimbra/conf/spamassassin';  
    my $LOCAL_STATE_DIR = '/opt/zimbra/lib/spamassassin';
    SpamAssain.pm
    Code:
    $self->{LOCAL_STATE_DIR}      ||= '/opt/zimbra/lib/spamassassin';
    Any pointers help would be appreciated

  2. #2
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    24

    Default

    They should be dropped into /opt/zimbra/conf/spamassassin and will automatically be picked up.

  3. #3
    jfone is offline Intermediate Member
    Join Date
    Oct 2008
    Posts
    17
    Rep Power
    6

    Default

    Thanks for the answer, I assumed as much but I was hoping SA could look in the new donwloaded directory somehow. I will create a cron to move them after I run the sa-update. Thanks

  4. #4
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    24

    Default

    Or specify -C and the config file for when sa-update is ran ?

  5. #5
    jfone is offline Intermediate Member
    Join Date
    Oct 2008
    Posts
    17
    Rep Power
    6

    Default

    Unfortunately there is no -C option with sa-update. Copying the files accross is OK

  6. #6
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    24

    Default

    Will check my server tonight to see how I am doing it

  7. #7
    jfone is offline Intermediate Member
    Join Date
    Oct 2008
    Posts
    17
    Rep Power
    6

    Default

    Appreciated!

  8. #8
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    24

    Default

    Okay, I run this script from roots cron using
    Code:
    0	0-23/6  	*       *       *       su - zimbra -c /usr/local/bin/sarulesupdate.sh
    And here is the script
    Code:
    #/usr/bin/bash
    
    /usr/bin/sa-update --gpgkey 6C6191E3 --channel sought.rules.yerp.org --updatedir /opt/zimbra/conf/spamassassin --gpghomedir /opt/zimbra/conf/spamassassin
    /usr/bin/sa-update --channelfile /usr/local/etc/sare-sa-update-channels.txt --gpgkey 856AA88A --updatedir /opt/zimbra/conf/spamassassin --gpghomedir /opt/zimbra/conf/spamassassin
    cd /opt/zimbra/conf/spamassassin
    mv KAM.cf KAM.cf.old
    wget http://www.peregrinehw.com/downloads/SpamAssassin/contrib/KAM.cf
    And in my channels file
    Code:
    [root@office etc]# cat sare-sa-update-channels.txt 
    updates.spamassassin.org
    72_sare_redirect_post3.0.0.cf.sare.sa-update.dostech.net
    70_sare_evilnum0.cf.sare.sa-update.dostech.net
    70_sare_bayes_poison_nxm.cf.sare.sa-update.dostech.net
    70_sare_html0.cf.sare.sa-update.dostech.net
    70_sare_html_eng.cf.sare.sa-update.dostech.net
    70_sare_header0.cf.sare.sa-update.dostech.net
    70_sare_header_eng.cf.sare.sa-update.dostech.net
    70_sare_specific.cf.sare.sa-update.dostech.net
    70_sare_adult.cf.sare.sa-update.dostech.net
    72_sare_bml_post25x.cf.sare.sa-update.dostech.net
    99_sare_fraud_post25x.cf.sare.sa-update.dostech.net
    70_sare_spoof.cf.sare.sa-update.dostech.net
    70_sare_random.cf.sare.sa-update.dostech.net
    70_sare_oem.cf.sare.sa-update.dostech.net
    70_sare_genlsubj0.cf.sare.sa-update.dostech.net
    70_sare_genlsubj_eng.cf.sare.sa-update.dostech.net
    70_sare_unsub.cf.sare.sa-update.dostech.net
    70_sare_uri0.cf.sare.sa-update.dostech.net
    70_sare_obfu0.cf.sare.sa-update.dostech.net
    70_sare_stocks.cf.sare.sa-update.dostech.net

  9. #9
    jfone is offline Intermediate Member
    Join Date
    Oct 2008
    Posts
    17
    Rep Power
    6

    Default

    Thanks for the information. When I use a similar setting to you and change LOCAL_STATE_DIR in SpamAssasin.pm and sa-update to /opt/zimbra/conf/spamassassin/ the *.cf files are then placed in directories below /opt/zimbra/conf/spamassassin

    for eg: /opt/zimbra/conf/spamassassin/<version>/<channel>/

    /opt/zimbra/conf/spamassassin/3.002005/updates_spamassassin_org/

    Which according to the sa-update doco is correct.

    Unfortunately I can't get SpamAssassin to traverse these directories to find the *.cf files, it only uses the rule files in the /opt/zimbra/conf/spamassassin/ directory. It is no issue I will just copy them manually into the directory

  10. #10
    peng1can is offline Senior Member
    Join Date
    Aug 2007
    Location
    Indianapolis
    Posts
    54
    Rep Power
    8

    Default

    uxbod,

    A couple quick questions about your scripts...

    - My understanding is that there has to be some kind of amavis reload to get the new rulesets picked up. Is that incorrect, or are you doing that somewhere else? I'm asking partly as a sanity check for myself and partly to ensure others catch that in the future.

    - The SARE rules haven't been updated in ages. While they're still good to have and you never know when they might suddenly start being updated, is it a burden on the remote servers to check for the SARE updates every 6 hours along with everything else, or is the sa-update efficient enough that it's a trivial task?

    Thanks for all the effort in posting this and the SaneSecurity thread. They've helped me tighten up my spam setup quite a bit. Now, if only zimbra could figure out a way to let me preserve my customizations between upgrades (or perhaps better yet, include many of these customizations themselves)... :-(

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Forwarded spam - a new headache
    By dwmtractor in forum Administrators
    Replies: 10
    Last Post: 11-30-2007, 03:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •