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-25-2009, 10:07 AM
Intermediate Member
 
Posts: 22
Default moving spamassassin Bayes scores

Hi all.

I want to move spamassassin Bayes scores from one mail (server1) server to another (server2) to prevent lots of spam. Server2 works under ZCS. Server1 doesn't.

Firstly I tried to put Bayes files (bayes_journal, bayes_seen, bayes_toks) to /opt/zimbra/data/amavisd/.spamassassin/.

But when I tried to run zmtrainsa, I' ve got the following error:

Code:
bayes: cannot open bayes databases /opt/zimbra/data/amavisd/.spamassassin/bayes_* R/O: tie failed:
bayes: cannot open bayes databases /opt/zimbra/data/amavisd/.spamassassin/bayes_* R/W: tie failed: No such file or directory
bayes: cannot open bayes databases /opt/zimbra/data/amavisd/.spamassassin/bayes_* R/W: tie failed: No such file or directory
As far as I understand, it means that berkeley DB version are different.

Installed package information:

Server1
spamassassin 3.0.x
db42-4.2.52_4

Server2
spamassisin 3.0.x
db4-4.3.29-9
(Zimbra 5.0.11_GA_2695.RHEL5)

Secondly, I tried to update bayes database using db_upgrade

Code:
/opt/zimbra/sleepycat/bin/db_upgrade bayes_seen
db_upgrade: bayes_seen: unexpected file type or format
db_upgrade: DB->open: bayes_seen: Invalid argument

The same command with original files executes with no output (Seems to be Ok).
So this attempt failed to (for the current moment).

The question is:
How to move Bayes scores from one mail (server1) server to another (server2)?
If the problem is with db versiоn, what should I do to upgrade it?



Any suggestions are welcome. Thanks for your attention.

Last edited by manOfmoods; 03-25-2009 at 10:10 AM..
Reply With Quote
  #2 (permalink)  
Old 03-26-2009, 01:11 AM
Moderator
 
Posts: 7,928
Default

Spamassassin :: sa-learn use this to backup your Bayes and then restore it on the new server.
__________________
Reply With Quote
  #3 (permalink)  
Old 03-26-2009, 04:52 AM
Intermediate Member
 
Posts: 22
Default

Thanks for your advice I knew about sa-learn, but underestimated its functional.
There are several options which one should specify to manage backup.


I'm not quit sure what are the correct values for my ZCS version (Zimbra 5.0.11_GA_2695.RHEL5).

--dbpath /opt/zimbra/data/amavisd/.spamassassin/ -that seems to be right.
--prefspath /opt/zimbra/conf/salocal.cf.in - Is it correct?
--siteconfigpath /opt/zimbra/data/amavisd/.spamassassin/ -Is it correct? ()
Should I specify /opt/zimbra/amavisd/.spamassassin/ and where?

This command I used to make backup:

Code:
 
su -l zimbra
/opt/zimbra/libexec/sa-learn -p /opt/zimbra/conf/salocal.cf.in --dbpath /opt/zimbra/data/amavisd/.spamassassin/ --siteconfigpath /opt/zimbra/data/amavisd/.spamassassin/ --backup > /tmp/zimbra1.backup
It fails when i try to restore:
Code:
su -l zimbra
/opt/zimbra/libexec/sa-learn -p /opt/zimbra/conf/salocal.cf.in --dbpath /opt/zimbra/data/amavisd/.spamassassin/ --siteconfigpath /opt/zimbra/data/amavisd/.spamassassin/ --restore /tmp/zimbra.backup -D 
...
mkdir /opt/zimbra/.spamassassin failed: mkdir /opt/zimbra/.spamassassin: Permission denied at /opt/zimbra/zimbramon/lib/Mail/SpamAssassin.pm line 1577
..
I think it's something wrong with options. That's why it tries to make /opt/zimbra/.spamassassin. (wrong place imho)
Full output
What are the correct ones?
Attached Files
File Type: txt sa-learn.txt (11.8 KB, 49 views)
Reply With Quote
  #4 (permalink)  
Old 03-26-2009, 04:57 AM
Moderator
 
Posts: 7,928
Default

Have not tried but I would have thought the syntax would be
Code:
/opt/zimbra/libexec/sa-learn -p /opt/zimbra/conf/salocal.cf.in --dbpath /opt/zimbra/amavisd/.spamassassin/ --siteconfigpath /opt/zimbra/conf/spamassassin --restore /tmp/zimbra.backup -D
__________________
Reply With Quote
  #5 (permalink)  
Old 03-26-2009, 05:14 AM
Intermediate Member
 
Posts: 22
Default

Thanks for your attention.

the same error:

Code:
[7446] dbg: config: mkdir /opt/zimbra/.spamassassin failed: mkdir /opt/zimbra/.spamassassin: Permission denied at /opt/zimbra/zimbramon/lib/Mail/SpamAssassin
.pm line 1577
[7446] dbg: config: Permission denied
I've already tried
----siteconfigpath /opt/zimbra/conf/spamassassin - it seems to be correct value...

Maybe some other suggestions?
Reply With Quote
  #6 (permalink)  
Old 03-26-2009, 05:40 AM
Intermediate Member
 
Posts: 22
Default

I'm not sure but this options seems to be right.

Code:
/opt/zimbra/libexec/sa-learn -p /opt/zimbra/conf/salocal.cf.in --dbpath /opt/zimbra/data/amavisd/.spamassassin/ --siteconfigpath /opt/zimbra/conf/spamassassin --backup > /tmp/zimbra_q.backup

/opt/zimbra/libexec/sa-learn -p /opt/zimbra/conf/salocal.cf.in --dbpath /opt/zimbra/data/amavisd/.spamassassin/ --siteconfigpath /opt/zimbra/conf/spamassassin --restore /tmp/zimbra_q.backup
I'll post final result after testing.
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.