[Dovecot] Per user namespace

Timo Sirainen tss at iki.fi
Mon Aug 24 20:21:30 EEST 2009


On Mon, 2009-08-24 at 11:13 -0600, Ashley M. Kirchner wrote:
> I'm in the process of upgrading an old server which is running 
> uw-imap to a new one running Dovecot.  With the old machine, 
> unfortunately, my users had the opportunity to store their e-mails in 
> various locations.  For example, some have their mail boxes stored in 
> ~/mail/[various mbox files], others ALSO have a ~/mail/clients/[various 
> mbox files] and yet others simply stored them in their ~/ path (thanks 
> to the old IMAP).  Is there a way to create per-user namespaces?  I 
> don't want to create a "mail/", "mail/clients/", etc., etc. global name 
> space that will end up showing up on everyone's mail client, nor do I 
> want to individually change each user's setup (and rewrite their 
> .subscriptions file).

I think the best solution would be to just finally standardize
everyone's mailboxes under ~/mail/. It'll probably help you in future..

But yeah, it's possible to create per-user namespaces by returning
namespace_* extra fields from your userdb. There isn't existing
documentation how exactly to do that, but basically you'll just have to
return the same namespace_* fields that exist in NAMESPACE_* environment
variables. You can get a dump of those using post-login script, see
http://wiki.dovecot.org/PostLoginScripting. Alternatively you could just
set up those NAMESPACE_* settings directly in the post-login script by
e.g. reading some file from home dir. But don't let users specify
anything, the process is still running as root at that point and they'll
get root privileges by changing just a few environment settings..

http://wiki.dovecot.org/Plugins/Virtual also gives a simple example how
to return a different inbox=yes namespace for different users.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20090824/a90fc00e/attachment.bin 


More information about the dovecot mailing list