I had to restore some Maildir-style mailboxes from an old Courier IMAP
server to a newish Cyrus IMAP server. There’s not much to it, and
this is well documented elsewhere, but basically you can copy the
files in (I don’t know if they need to be named like 123.
like Cyrus
does by default), make sure permissions are right (and SELinux, if
applicable), and invoke some combinations of reconstruct
.
I did hit a few gotchas though:
- Like I said above, don’t forget to
restorecon -Rv
on the restored files if you’re on a system with SELinux enabled. - If you have mailboxes, particularly folders underneath the inbox,
you may need to invoke
reconstruct
with-p default
. This registers them inmailboxes.db
, I guess? It makes them show up inlm
fromcyradm
which can’t be bad. - Related to the above, I don’t think
reconstruct
will believe a directory is a mailbox unless there is acyrus.header
file in it. Justtouch cyrus.header
was enough for me. (I was callingreconstruct -p default -xrf
BTW; I don’t know if, for example,-x
makes it rewritecyrus.header
to have valid/meaningful contents. It should be non-empty, I believe.) - Finally, Courier’s messages all just used a line feed for line
endings. Cyrus demands DOS-style CRLF for line endings. Symptom
for this: bringing up the message index (in Mutt, at least) goes
much, much slower than it should. I believe this happens because
too much information gets put in the Cyrus header/cache files. (Use
the
mbexamine
program and you’ll see lots of weird information in the “headers” I think.) Fixing this for me was as simple as runningunix2dos
over the files (and then fixing permissions; I should have donesudo -u cyrus unix2dos [0-9]*.
instead of just runningunix2dos
asroot
.)