Alexander 'Leo' Bergolth
2011-Oct-31 17:00 UTC
[Dovecot] setting namespaces using script-login environment in 2.0
Hi! With dovecot 1.x, I was using a post-login script to dynamically add shared mailboxes using NAMESPACE_X.. environment variables, based on filesystem permissions: After login, the post-login script was executed with user permissions (mail_drop_priv_before_exec=yes). It added all subdirectories of "/var/spool/mail/Shared" as namespaces for which the user had write permissions. E.g.: NAMESPACE_2='maildir:/var/mail/Shared/spamrep:INDEX=~/Maildir/index/Shared/spamrep' NAMESPACE_2_PREFIX=Shared/spamrep/ NAMESPACE_2_SEP=/ NAMESPACE_2_TYPE=public NAMESPACE_2_LIST=yes See the attached post-pogin-script for details. After switching to 2.0.14 (using executable script-login -d...), the script actually gets executed but the namespace settings do not seem to be honored. Besides, I don't see any pre-set NAMESPACE_ environment variables anymore. Have environment based namespace settings been abandoned in 2.0? Does Dovecot 2.0 maybe provide a better way to only display those folders, for which the user has at least read permissions? (Unix-permission based) Thanks in advance, --leo -- e-mail ::: Leo.Bergolth (at) wu.ac.at fax ::: +43-1-31336-906050 location ::: IT-Services | Vienna University of Economics | Austria
e-frog
2011-Oct-31 17:41 UTC
[Dovecot] setting namespaces using script-login environment in 2.0
On 31.10.2011 18:00, wrote Alexander 'Leo' Bergolth:> > Have environment based namespace settings been abandoned in 2.0? >I think you need to add them to USERDB_KEYS now... http://wiki2.dovecot.org/PostLoginScripting#Running_environment /e-frog
Timo Sirainen
2011-Nov-04 21:18 UTC
[Dovecot] setting namespaces using script-login environment in 2.0
On Mon, 2011-10-31 at 18:00 +0100, Alexander 'Leo' Bergolth wrote:> NAMESPACE_2='maildir:/var/mail/Shared/spamrep:INDEX=~/Maildir/index/Shared/spamrep' > NAMESPACE_2_PREFIX=Shared/spamrep/ > NAMESPACE_2_SEP=/ > NAMESPACE_2_TYPE=public > NAMESPACE_2_LIST=yesThe settings are now named. http://wiki2.dovecot.org/MailLocation#Custom_namespace_location shows the basics. So for example if you have: namespace foo { .. } You can change it via: NAMESPACE/FOO/PREFIX=Shared/spamrep/ NAMESPACE/FOO/SEP=/ ..etc.. The '/' character is a bit problematic with shells scripts though, see the wiki link how to do it via "env" at least. Another problem is if you want to add more namespaces than you have configured. IIRC it's possible to simply add: NAMESPACE=foo And more than one is probably either "foo bar" or "foo,bar". If you get something to work, please add example to http://wiki2.dovecot.org/PostLoginScripting :)