migrating to virtual domain support

Torsten Schlabach TSchlabach at gmx.net
Fri Feb 1 09:11:46 EST 2008


Hi Stefan!

I think what you are looking for goes by the name of "rename a mailbox" which as far as I remember isn't that easy in Cyrus IMAPd, but definitely possible.

Depending on the size of your system and the amount of acceptable downtime, one potential strategy would definitely include to just halt delivery (shut down your MTA), then create the new mailboxes (with the domain in their name), then use a tool such as imapsync to transfer mailbox content.

But before you embark on that:

Have you really though twice if you want virtual domains in the sense of the actual Cyrus IMAPd implementation? I once built a larger system that way and I am suffering from that until today. So my takeaway was that I would never do it again that way, for a number of reasons. Well, it heavily depends on what kind of system you're running and for whom.

I have built a newer, large system by using entirely domain agnostic mailbox names, i.e. xxxYYYYY where xxx is a prefix and YYYYY is just an ID number. They have nothing to do with email addresses.

We moved the email address -> mailbox name conversion entirely into the MTA, which gives you way more flexibility. Someone wants an additional email address? No problem. Someone wants to change the email address while keeping the mailbox untouched? (Think people changing their names after a marriage or divorce, for example.) No problem.

And the #1 issue we have been facing with virtual domains: We do have lots of users who have their domain registered in multiple TLDs but use one local namespace, i.e. they want to have mail for johndoe at acme.com / johndoe at acme.net / johndoe at acme.de go into the same mailbox.

I need to make you aware though that this concept introduces extra complexity when it comes to authentication. You will need to use a SASL canon plugin to turn the email address into a mailbox name for IMAP auth and potentially also for SMTP auth. (Has nothing to do with Cyrus IMAPd, but should be left out.)

If you're interested in the concept, let me know what OS you're running. There are some pitfalls setting this up properly.

On the mailbox rename subject:

http://www.irbs.net/internet/info-cyrus/0107/0018.html

The relevant section of the book mentioned can be read online as well:

http://www.oreilly.com/catalog/mimap/chapter/ch09.html#73456
(look for the headline: Rename an account)

HTH

Regards,
Torsten


-------- Original-Nachricht --------
> Datum: Fri, 01 Feb 2008 14:29:40 +0100
> Von: Stefan Palme <kleiner77 at gmx.net>
> An: "info-cyrus at lists.andrew.cmu.edu" <info-cyrus at lists.andrew.cmu.edu>
> Betreff: migrating to virtual domain support

> Hi
> 
> I have a cyrus imap server installation without virtual domain support.
> Some months ago I started receiving mails for other domains besides my
> "default" domain, so I have usernames like "bob" (for the default
> domain) and "fred.domain2" (for the additional domain domain2.com).
> (The naming scheme "NAME.DOMAIN" has been introduced to avoid
> collisions, in fact I emulated virtual domains this way).
> 
> This gets more and more ugly, so I want to migrate to "real" virtual
> domain support. I've tested virtual domains on a test server, and
> everything is fine. 
> 
> My only problem: how do I migrate the mails from the old "fred.domain2"
> mailbox to the new "fred at domain2.com" mailbox? Until now there
> exists a mailbox "user/fred.domain2" (I'm using unixhierarchystyle).
> The new mailbox for this user is "user/fred at domain2.com" - so there
> is a new mailspool directory for this account.
> 
> I guess I can not simply move the content of
> /var/spool/imap/f/user/fred^domain2
> to the new location /var/spool/imap/domain/d/domain2.com/f/user/fred
> without breaking something. 
> 
> So what needs to be done to ensure, that fred will be able to read his
> old mails (and seeing his old mailbox structure) after switching to 
> virtual domains and logging in using his new account "fred at domain2.com"?
> 
> Thanks and regards
> -stefan-
> 
> 
> ----
> Cyrus Home Page: http://cyrusimap.web.cmu.edu/
> Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
> List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


More information about the Info-cyrus mailing list