Relation of filesystem to Cyrus mailbox structure
Joseph Brennan
brennan at columbia.edu
Fri Sep 14 12:22:40 EDT 2007
--On Friday, September 14, 2007 8:27 -0700 Rick Kunkel <kunkel at w-link.net>
wrote:
> Where I've been stuck recently is trying to figure out things like how to
> manipulate mailboxes by using the file system. Maybe this isn't really
> practical using mdir.
>
> 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.
>
> I guess the fundamental question here are these:
>
> - If I make changes to the file system, how do I get these reflected in
> Cyrus mailbox views?
It's less painful if you can use Cyrus to do this stuff. I know :-)
The main reason you might have to do this would be restoring entire
mailboxes off backups.
Given /var/mail/j/user/janedoe/folder1/folderA , Cyrus might have
three mailboxes named user.janedoe, user.janedoe.folder, and
user.janedoe.folder.folderA, but not necessarily.
cyradm will show you what folders exist, in Cyrus's view, and it
lets you create, delete, and rename mailboxes to make the Cyrus
view be what you want it to be. Cyrus will move the files around
in the filesystem accordingly.
To do batch work a perl script can use Cyrus::IMAP::Admin to do
what cyradm would do.
When we migrated from mbox, we created Cyrus mailboxes for the
directories too. For ~janedoe/mail/foo/bar (mbox file) we created
both user.janedoe.foo and user.janedoe.foo.bar, even though the
user had never stored mail in foo (since it was a directory).
This seemed simpler than having to explain later that foo could
be part of a mailbox name but not exist as a mailbox!
Joseph Brennan
Lead Email Systems Engineer
Columbia University Information Technology
More information about the Info-cyrus
mailing list