[Dovecot] separate mail_location for system and normal users

Steffen Kaiser skdovecot at smail.inf.fh-brs.de
Wed Oct 30 10:37:56 EET 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 30 Oct 2013, Andrzej A. Filip wrote:

> On 10/28/2013 09:29 AM, Steffen Kaiser wrote:
>> On Fri, 25 Oct 2013, Andrzej A. Filip wrote:
>>
>>> How to configure dovecot to use different default mail_location for
>>> system (uid<1_000) and normal users (uid>=1_000)?
>>
>>> I want to to use by default
>>> * classic mailbox in standard location for system users
>>> * maildir in $HOME subdirectory for normal users
>>
>> That depends :-)
>>
>> If you have just one userdb, configure the default mail_location for
>> most users and return a mail extra field for the other ones.
>>
>> You use passwd? This probably will not work, see
>> http://wiki2.dovecot.org/UserDatabase/ExtraFields about the syntax
>>
>> You could probably copy the set of users, that requires extra fields,
>> from your /etc/passwd to somewhere else, adding the extra field. Then
>> configure the copy as userdb { driver passwd-file } _before_ the userdb
>> { passwd }. That way, the entries in the passwd-file override the ones
>> in /etc/passwd, because they are found first.
>
> I have used userdb/passwd fix for a system with a few "real user
> mailboxes". I wanted something better fit for larger systems.

Hmm? You need to return a different mail field for one set of users. 
/etc/passwd cannot do this. So you need some other userdb for the set of 
users, for whom you want to override the default mail_location, be it 
passwd-file, SQL, LDAP, ... .

You wrote "normal users (uid>=1_000)", so they are system users in 
/etc/passwd as well, I assumed. If those system already use another user 
database, try using it and extend it with the Dovecot settings.

- -- 
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBUnDFZF3r2wJMiz2NAQLjjAf9EvyLhylwZbyVuFyl59PVEdgrLdXo/9Y/
KrQhoV9c3stxJPjyz2RG1C7AL4it66NTFbKBtilV/qOILcfBtmF4pA+quMsAmQzW
ezu/yhFJyTfyqjgomrPbaBieORCY77ya1gL4OLhhhkPy4spFW4sUZWlOebRL7+sj
eHfjSHzmVVj/zA7hQNh8fsv/kx7JMqfHATkfPcMFF3lebM0SYr+N4Sc17TUDoEqG
BhHnUlDYnx08TELuAtdMipBckaFeUd2GTIH3tlSvKq9IkygnvjKDUhuz/+Bfpp6k
/Left6uzuWErcp+PaQaIgvUqJt9I2rfKzHNbVJXk8qS7TQ42Tvmztg==
=9ZZj
-----END PGP SIGNATURE-----


More information about the dovecot mailing list