Relation of filesystem to Cyrus mailbox structure

Jorey Bump list at joreybump.com
Fri Sep 14 13:24:00 EDT 2007


Rick Kunkel wrote, at 09/14/2007 11:27 AM:

> Where I've been stuck recently is trying to figure out things like how to 
> manipulate mailboxes by using the file system.

Don't do that. That's the "black box" part of Cyrus IMAP. Forget about 
all the cool things you could do by directly manipulating mbox files.

> Here's the latest:  I have a user that we migrated from mbox.  She has her 
> inbox folder, which migrated fine.  Then she has a couple of other folder, 
> which migrated fine.  Then she has folders within folders, and those 
> refuse to show up, and it won't let her subscribe to them.  Here's how it 
> they're in the filesystem:
> 
> /var/mail/j/user/janedoe   <-- Inbox: Migrated fine
> /var/mail/j/user/janedoe/folder1  <-- Also migrated fine
> /var/mail/j/user/janedoe/folder1/folderA  <-- I can't get to show
> 
> I don't think the user really NEEDS the folder called folder1 above, but 
> wants the folders inside of it.  So I tried to move folderA back one level 
> so that it was sitting inside the /var/mail/j/user/janedoe folder, but 
> that doesn't work.  I figured I had to run a reconstruct command, but no 
> avail there either.

This is one area migration tools failed me, as well. None of them were 
able to automatically create the mailbox that corresponds to the 
*directory* that held mbox files, even via IMAP. They were able to 
preserve the structure, however.

If Cyrus IMAP complains:

  localhost> lam user.janedoe.folder1
  Mailbox does not exist

Then you must create the mailbox:

  localhost> cm user.janedoe.folder1

Don't worry, it won't delete or overwrite anything on the filesystem, 
it's just registering the existence of the mailbox in the blackbox system.

Check again, then repeat the process for any other mailboxes that still 
don't exist. I never did find a way to completely automate this for an 
entire mailstore. I was quite surprised to discover that most users 
don't even bother to move mail out the INBOX, let alone organize them in 
multiple levels of subdirectories, so I managed to do most of it manually.




More information about the Info-cyrus mailing list