[Dovecot] setting namespaces using script-login environment in 2.0

Alexander 'Leo' Bergolth leo at strike.wu.ac.at
Wed Nov 16 17:04:20 EET 2011


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




More information about the dovecot mailing list