[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
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
On 10/31/2011 06:41 PM, e-frog wrote:
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
I have added NAMESPACE_1 NAMESPACE_1_SEP NAMESPACE_1_TYPE NAMESPACE_1_LIST NAMESPACE_1_PREFIX to USERDB_KEYS.
Unfortunately the namespace still isn't used. :-(
--leo
e-mail ::: Leo.Bergolth (at) wu.ac.at fax ::: +43-1-31336-906050 location ::: IT-Services | Vienna University of Economics | Austria
On 11/01/2011 09:12 PM, Alexander 'Leo' Bergolth wrote:
On 10/31/2011 06:41 PM, e-frog wrote:
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
I have added NAMESPACE_1 NAMESPACE_1_SEP NAMESPACE_1_TYPE NAMESPACE_1_LIST NAMESPACE_1_PREFIX to USERDB_KEYS.
Unfortunately the namespace still isn't used. :-(
Can anyone confirm that setting namespaces via environment isn't supported in 2.0 anymore?
Is there another way to dynamically add namespaces?
Thanks, --leo
e-mail ::: Leo.Bergolth (at) wu.ac.at fax ::: +43-1-31336-906050 location ::: IT-Services | Vienna University of Economics | Austria
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=yes
The 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 :)
On 11/04/2011 10:18 PM, Timo Sirainen wrote:
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/
The 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
Thanks a lot, Timo!
Changing to named, /-separated environment variables did the job.
NAMESPACE/S-SPAMREP/LIST=yes NAMESPACE/S-SPAMREP/LOCATION=maildir:/var/spool/mail/Shared/spamrep:INDEX=~/Maildir/index/Shared/spamrep NAMESPACE/S-SPAMREP/PREFIX=Shared/spamrep/ NAMESPACE/S-SPAMREP/SEPARATOR=/ NAMESPACE/S-SPAMREP/TYPE=public NAMESPACE/S-TESTSHARED/LIST=yes NAMESPACE/S-TESTSHARED/LOCATION=maildir:/var/spool/mail/Shared/testshared:INDEX=~/Maildir/index/Shared/testshared NAMESPACE/S-TESTSHARED/PREFIX=Shared/testshared/ NAMESPACE/S-TESTSHARED/SEPARATOR=/ NAMESPACE=s-testshared s-spamrep NAMESPACE/S-TESTSHARED/TYPE=public
USERDB_KEYS=SYSTEM_GROUPS_USER UID GID HOME NAMESPACE/S-SPAMREP/LIST NAMESPACE NAMESPACE/S-TESTSHARED/SEPARATOR NAMESPACE/S-TESTSHARED/TYPE NAMESPACE/S-TESTSHARED/PREFIX NAMESPACE/S-TESTSHARED/LIST NAMESPACE/S-TESTSHARED/LOCATION NAMESPACE/S-SPAMREP/SEPARATOR NAMESPACE/S-SPAMREP/TYPE NAMESPACE/S-SPAMREP/PREFIX NAMESPACE/S-SPAMREP/LOCATION
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 :)
I'll add my script to the Wiki.
Cheers, --leo
e-mail ::: Leo.Bergolth (at) wu.ac.at
fax ::: +43-1-31336-906050
location ::: IT-Services | Vienna University of Economics | Austria
participants (3)
-
Alexander 'Leo' Bergolth
-
e-frog
-
Timo Sirainen