Re: Problem with reconstruct

From: (no name) (no email)
Date: Tue Feb 08 2005 - 08:23:07 EST

  • Next message: Ken Murchison: "Re: Global Include Verb"

    Quoting Lars Kristiansen <lars+>:
    > In short, dump to text on the old machine and import from text on the new
    > is the way to go.

    The "old server" install was all fucked up, and no text backup was available. I
    used the following script to dump mailbox lists and ACL on "old host" and
    lauched the result on "new server". I supposed it does the same thing than
    transfering the flat text file but does it ?

    use IMAP::Admin;

    $imap = IMAP::Admin->new('Server' => 'localhost', 'Login' => 'cyrus',
                             'Password' => '****');

    @list = $imap->list("user.*");
    foreach $mailbox (@list) {
            next if ($mailbox =~ /user.[A-Z_]+\..+/);
            printf("\$imap->create(\"%s\");\n", lc($mailbox));
            %acl = $imap->get_acl($mailbox);
            foreach $user (keys %acl) {
                    printf("\$imap->set_acl(\"%s\", \"%s\", \"%s\");\n",
                           lc($mailbox), lc($user), $acl{$user} );
            }
            @quota = $imap->get_quota($mailbox);
            if ($#quota > 0) {
                    printf("\$imap->set_quota(\"%s\", %d);\n",
                           lc($quota[0]), $quota[2] );
            }
    }

    ---
    Cyrus Home Page: http://asg.web.cmu.edu/cyrus
    Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
    List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
    

  • Next message: Ken Murchison: "Re: Global Include Verb"





    Hosted Email Solutions

    Invaluement Anti-Spam DNSBLs



    Powered By FreeBSD   Powered By FreeBSD