Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-03-2009, 06:45 AM
Intermediate Member
 
Posts: 17
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
Reply With Quote
  #2 (permalink)  
Old 03-03-2009, 06:49 AM
Moderator
 
Posts: 7,928
Default

They should be dropped into /opt/zimbra/conf/spamassassin and will automatically be picked up.
__________________
Reply With Quote
  #3 (permalink)  
Old 03-03-2009, 06:57 AM
Intermediate Member
 
Posts: 17
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
Reply With Quote
  #4 (permalink)  
Old 03-03-2009, 07:12 AM
Moderator
 
Posts: 7,928
Default

Or specify -C and the config file for when sa-update is ran ?
__________________
Reply With Quote
  #5 (permalink)  
Old 03-03-2009, 07:35 AM
Intermediate Member
 
Posts: 17
Default

Unfortunately there is no -C option with sa-update. Copying the files accross is OK
Reply With Quote
  #6 (permalink)  
Old 03-03-2009, 07:35 AM
Moderator
 
Posts: 7,928
Default

Will check my server tonight to see how I am doing it
__________________
Reply With Quote
  #7 (permalink)  
Old 03-03-2009, 07:37 AM
Intermediate Member
 
Posts: 17
Default

Appreciated!
Reply With Quote
  #8 (permalink)  
Old 03-03-2009, 01:16 PM
Moderator
 
Posts: 7,928
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
__________________
Reply With Quote
  #9 (permalink)  
Old 03-04-2009, 05:30 AM
Intermediate Member
 
Posts: 17
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
Reply With Quote
  #10 (permalink)  
Old 03-10-2009, 06:14 AM
Senior Member
 
Posts: 52
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)... :-(
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.