Re: Plain text dump of cyrus.index?

From: Bron Gondwana (no email)
Date: Tue Apr 03 2007 - 03:16:11 EDT

  • Next message: (no name): "Murder / frontend does not connect to backend"

    On Sun, Apr 01, 2007 at 07:30:11PM -0400, Miller, Greg wrote:
    > Hello,
    >
    >
    >
    > I found myself in a the situation where I need to do the opposite of a
    > reconstruct on my mailboxes. That is, instead of rebuilding the cyrus.*
    > files to reflect the messages on the file system, I want to query the
    > cyrus.* files to see which message files are indexed, and then delete
    > any extraneous message files on the file system.
    >
    >
    >
    > My first step is to find a utility that can dump cyrus.index so that I
    > can determine which message file are valid, and therefore should not be
    > deleted.

    This isn't a utility as such, but still:

    #!/usr/bin/perl

    require 'IndexFile.pm';

    my $path = shift;

    my $index = Cyrus::IndexFile->new_file($path);

    while (my $record = $index->next_record()) {
      print "$record->{Uid}\n";
    }

    I've written enough little tools to unpack parts of the index file
    that I got sick of it and just wrote something that can pack and
    unpack the whole thing! Yay for evil little perl utilities. It's
    not safe against index file format changes, but it's quite extensible
    in that case, just add some more formats to the start of the file :)

    Bron.


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


  • Next message: (no name): "Murder / frontend does not connect to backend"





    Hosted Email Solutions

    Invaluement Anti-Spam DNSBLs



    Powered By FreeBSD   Powered By FreeBSD