IMAP sync tool (rsync for IMAP)

John Capo jc at
Tue Dec 26 12:39:59 EST 2006

Quoting Florin Andrei (florin at
> Marten Lehmann wrote:
> >
> >>Downside: If you have very large messages on the source IMAP servers, 
> >>you better run the script on a machine with lots of RAM. On my system 
> >>it died repeatedly with "out of memory" when it was hitting a 32MB 
> >>message (on-disk size), and the system has 1GB RAM.
> >
> >strange, I didn't experience this while running a sync for >15.000 
> >mailboxes some weeks ago with even larger messages partially.
> Yeah, and after a quick google search it turned out I'm not the only one 
> to experience that.

Its definately a problem with large messages.

   my $string = $from->message_string($f_msg);

A 32MB message occupies a lot more than 32MB when its a Perl string.
Use a temp file instead.

    my $message_file = "/tmp/xfer-$$";
    $from->message_to_file($message_file, $f_msg);

And further down.

   unless($new_id = $to->append_file($t_fold, $message_file, $flags_f, $d))

Instead of 

   unless($new_id = $to->append_string($t_fold,$string, $flags_f, $d))

> Ah well, except for just one very large message, everything else was 
> transferred OK.
> -- 
> Florin Andrei
> ----
> Cyrus Home Page:
> Cyrus Wiki/FAQ:
> List Archives/Info:

More information about the Info-cyrus mailing list