[Dovecot] load sbub-mailbox
Hi,
We're about to migrate to dovecot (2.1.7 on wheezy), and I have a question about mail migration.
Our 'old' imap mailserver will remain available, and has the same usernames/passwords as our future dovecot mailserver.
The question: Is there an easy way to make the old mailboxes available under a subfolder (for example 'oldmail') in the mailboxes on the new mailserver?
A bit like mounting an old homedirectory under an 'oldfiles' directory on a new fileserver.
This way our users could access/migrate whatever folders they choose themselves, and we would not have migrate all messages to dovecot using scripts like imapcopy, etc.
Perhaps using the proxy functionality..?
Hope I make myself clear...?
Regards, Mourik Jan
mourik jan heupink wrote:
Our 'old' imap mailserver will remain available, and has the same usernames/passwords as our future dovecot mailserver.
The question: Is there an easy way to make the old mailboxes available under a subfolder (for example 'oldmail') in the mailboxes on the new mailserver?
A bit like mounting an old homedirectory under an 'oldfiles' directory on a new fileserver.
This way our users could access/migrate whatever folders they choose themselves, and we would not have migrate all messages to dovecot using scripts like imapcopy, etc.
Perhaps using the proxy functionality..?
I would try to create a private namespace "oldmail" http://wiki2.dovecot.org/Namespaces with an imapc proxy http://wiki2.dovecot.org/HowTo/ImapcProxy
I didn't test it, but configuration could look like this:
imapc_host = oldmailserver namespace { type = private separator = / prefix = oldmail/ location = imapc: inbox = no hidden = no list = yes }
Regards Daniel
Hi Daniel, list,
Thanks for your answer, if this works, it would be simply awesome!
Meanwhile things have gotten a bit buzy here with higer priority things, but as soon as these are over, I'll give the idea below a try.
Thanks very much, and I'll report back..!
Mourik Jan
I would try to create a private namespace "oldmail" http://wiki2.dovecot.org/Namespaces with an imapc proxy http://wiki2.dovecot.org/HowTo/ImapcProxy
I didn't test it, but configuration could look like this:
imapc_host = oldmailserver namespace { type = private separator = / prefix = oldmail/ location = imapc: inbox = no hidden = no list = yes }
Hi list, Daniel,
Finalle got around to try this out. I need to use the same username/password as with the dovecot main mailbox, so I dedited your config sample like this:
imapc_host = old.mail.server imapc_user = %u imapc_password = %w
namespace { type = private separator = / prefix = oldmail/ location = imapc: inbox = no hidden = no list = yes }
However the %w is not expanded to the users password, but instead "%w" is tried as a password, and therefore obviously things fail.
Without adding imapc_user / imapc_password, I get the following error:
imap(username): Error: user username: Initialization failed: Namespace 'oldmail/': imapc: missing imapc_password
How can I get the %w to expand properly, because I think then things would work...?
Regards, Mourik Jan
I would try to create a private namespace "oldmail" http://wiki2.dovecot.org/Namespaces with an imapc proxy http://wiki2.dovecot.org/HowTo/ImapcProxy
I didn't test it, but configuration could look like this:
imapc_host = oldmailserver namespace { type = private separator = / prefix = oldmail/ location = imapc: inbox = no hidden = no list = yes }
Hi Mourik Jan,
mourik jan heupink wrote:
imapc_host = old.mail.server imapc_user = %u imapc_password = %w
namespace { type = private separator = / prefix = oldmail/ location = imapc: inbox = no hidden = no list = yes }
However the %w is not expanded to the users password, but instead "%w" is tried as a password, and therefore obviously things fail.
http://wiki2.dovecot.org/Variables states that %w only works for Dovecot-auth so this does not seem to work for imap client proxy.
How can I get the %w to expand properly, because I think then things would work...?
I assume you will need to use a master user (masteruser) to login on behalf of the actual user (loginuser), since the user should be already authenticated when he sees the namespace "oldmail".
http://wiki2.dovecot.org/Authentication/MasterUsers
There is an "imapc_master_user" setting in newer versions of Dovecot 2.1, try something like this?
imapc_user = %u imapc_master_user = masteruser imapc_password = enter_password_of_masteruser_here
or alternatively for older versions:
imapc_user = %u*masteruser imapc_password = enter_password_of_masteruser_here
Regards Daniel
http://wiki2.dovecot.org/Variables states that %w only works for Dovecot-auth so this does not seem to work for imap client proxy. I read that, yes. However I didn't know how this works, but I expected dovecot-auth (whatever that may be) to perform the authentication to the old mailserver, so I thought: "I guess %w must be available then..."
Anyway, thanks for pointing that out.
I assume you will need to use a master user (masteruser) to login on behalf of the actual user (loginuser), since the user should be already authenticated when he sees the namespace "oldmail". Yep, I have just tried that approach, and it works fine. Thanks!
There is just one thing left to sort out: From the moment we have migrated to dovecot, new accounts will not be (manually) created anymore on our old server, meaning: more and more mailboxes will become unavailable on the old server.
It seems (but I have not yet done a lot of testing) that if the imapc cannot 'mount' the old mailbox, the imap process 'dies'. (that's what squirrelmail tells me)
Since you know so much... :-) Do you happen to know a way to make the imapc non-mandatory..? Like: when 'mounting' fails: simply ignore it, and proceed as normal.
Thanks very much for you kind assistance!
Mourik Jan
Hi Jan Mourik,
mourik jan heupink wrote:
From the moment we have migrated to dovecot, new accounts will not be (manually) created anymore on our old server, meaning: more and more mailboxes will become unavailable on the old server.
It seems (but I have not yet done a lot of testing) that if the imapc cannot 'mount' the old mailbox, the imap process 'dies'. (that's what squirrelmail tells me)
Since you know so much... :-) Do you happen to know a way to make the imapc non-mandatory..? Like: when 'mounting' fails: simply ignore it, and proceed as normal.
Additional namespaces can be dynamically added via environment variables.
Try to add the "oldspace" namespace dynamically using PostLoginScripting http://wiki2.dovecot.org/PostLoginScripting if an old mailbox is available for $ENV{'USER'}
Kind regards Daniel
Hoi Daniel,
Additional namespaces can be dynamically added via environment variables.
Try to add the "oldspace" namespace dynamically using PostLoginScripting http://wiki2.dovecot.org/PostLoginScripting if an old mailbox is available for $ENV{'USER'}
Thanks very much for your kind help and assistance!
Mourik Jan
participants (2)
-
Daniel Parthey
-
mourik jan heupink