archive cyrus mailboxes to .mbox

Craig Ringer craig at
Wed Jan 28 10:06:39 EST 2004

> thats exactly what we need to do, archive old mailfoldes 
> and mails and burn them on cd or move them somewhere
> where we have lots of space

OK, that makes sense then. 

> Sounds interesting. We'll have a look at it (it
> understands 
> maildir, mh, imap, pop etc. and I think maildir is the
> format we have).

Cyrus uses it's own mail storage format, but you're unlikely to ever
need to access it directly; you can just use IMAP to copy mail in and
out. As such, all you really need is for mailutil to support IMAP and
the creation of MBOX files - both of which it does.

> So this is the only tool which converts mailboxes into
> .mbox format?

No. You could use any mail client that supports exporting mail to MBOX
files, you could use the IMAP modules for perl, etc. There are lots of
things out there. mailutil, is, however, probably the quickest and
easiest way of doing what you want - especially for quite a bit of mail.
To archive a folder, you can just:

mailutil copy {imaphost/user=username} `pwd`/archive_mailbox

and it should merrily do it's thing. With Cyrus it's also possible to
tell mailutil to use a separate authuser, avoiding the need to know the
password for each user whose mail you're archiving.

Of course, if you want to archive only mail older than a given date or
do other such things you may need to look at tools other than mailutil.

My approach in your situation would probably be to get the client to
move messages to be archived into a sub-mailbox, then use mailutil to
archive them to MBOX and drop them on a CD.

Craig Ringer

More information about the Info-cyrus mailing list