Results 1 to 6 of 6

Thread: moving spamassassin Bayes scores

  1. #1
    Join Date
    Nov 2008
    Location
    RU
    Posts
    22
    Rep Power
    7

    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 11:10 AM.

  2. #2
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    25

    Default

    Spamassassin :: sa-learn use this to backup your Bayes and then restore it on the new server.

  3. #3
    Join Date
    Nov 2008
    Location
    RU
    Posts
    22
    Rep Power
    7

    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 Attached Files

  4. #4
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    25

    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

  5. #5
    Join Date
    Nov 2008
    Location
    RU
    Posts
    22
    Rep Power
    7

    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?

  6. #6
    Join Date
    Nov 2008
    Location
    RU
    Posts
    22
    Rep Power
    7

    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.

Similar Threads

  1. Spamassassin scores not updating
    By peng1can in forum Administrators
    Replies: 5
    Last Post: 03-19-2009, 09:34 AM
  2. [SOLVED] Spamassassin per-user bayes training
    By garyo in forum Administrators
    Replies: 3
    Last Post: 12-16-2008, 11:42 AM
  3. Forwarded spam - a new headache
    By dwmtractor in forum Administrators
    Replies: 10
    Last Post: 11-30-2007, 03:16 PM
  4. Spamassassin: no Bayes testing performed
    By eombah in forum Administrators
    Replies: 7
    Last Post: 03-21-2007, 02:48 PM
  5. Replies: 6
    Last Post: 03-02-2007, 05:09 AM

Posting Permissions

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