[plug] Backup of Cyrus Imap Mail

Phillip Bennett phillip at mve.com
Wed Apr 25 22:32:09 WST 2007

----- Original Message ----- 
From: "Shannon Carver" <shannon.carver at gmail.com>
To: <plug at plug.org.au>
Sent: Wednesday, April 25, 2007 12:57 PM
Subject: Re: [plug] Backup of Cyrus Imap Mail

> Bernd Felsche wrote:
>> "Shannon Carver" <shannon.carver at gmail.com> wrote:
>>> I'm about to go abroad for a couple of years,
>> Look, just because astronomers have spotted a "habitable" planet
>> orbiting a red dwarf some 20 lightyears away, doesn't mean you
>> should pack your bags just yet! :-)
>>> and take my home mail server off line.  I've got approximately 3GB
>>> of personal mail stored in .maildir/<mailbox>/cur/* format (in
>>> plain text).  If I was to take a backup of this, can this be copied
>>> directly into a similar IMAP server that uses .maildir format?
>>> The huge bulk of the mail isn't important at all, but, like a library, 
>>> I'd
>>> rather keep it and realise I need something later than lose it 
>>> altogether.
>>> Anyone had any experience with this in the past?
>>> It's a Cyrus IMAP server, using postfix for the MTA, but I've played 
>>> with
>>> similar setups in the past using dovecot and other imapd's and the 
>>> layout
>>> of the maildir seems to be the same.
>> I've transferred mailboxes from one Cyrus system to another with
>> "identical" configuration. (Not .maildir, as that's not afaik a
>> _Cyrus_ format. Perhaps you're thinking Courier?)
>> There's a "rebuild" of sorts that should be run to bring the
>> articles "online" -- don't remember exactly what it's called.
>> Cyrus maintains a database of articles and mailboxes in
>> e.g. /var/lib/imap
>> I suggest that instead of feeding the "backup" into an existing
>> user's mailbox, set up a fresh one, load the articles, "rebuild" the
>> cyrus databases and give access to the real users who need it.
>> You will of course organize folders within the main IMAP folder,
>> won't you? I had one user complain that his Outlook was slow
>> starting (and so was Thunderbird) and would lock up for minutes
>> at a time. He had 13 GB in roughly 60,000 articles in his Inbox.
>> One can probably recognize his house by the 18-metre shipping
>> container that he uses as his letter-box at the front of his house.
> Yes, of course! Sorry, it's a Courier IMAP system, not Cyrus.
> Definitely, in different folders, nothing in my inbox apart from maybe 10 
> messages.  And Outlook/Thunderbird takes no time at all to load..
> So I'm guessing with standard .maildir setup, its fine to restore it later 
> on??

I have done this when restoring mail for a user.  Just chuck it in the 'cur' 
directory of the desired folder and restart the IMAP client.  Works like a 
charm.  I regularly move mail about this way when aggregating for SPAM 
identification (moving it all to one place and running sa-learn on it). 
Just make sure the permissions on it are correct, or the client can fail 
with awful error messages.

I am running dovecot with postfix.


More information about the plug mailing list