[Dovecot] Grant access for Unix-User _and_ virtual Users

Steffen Kaiser skdovecot at smail.inf.fh-brs.de
Thu Sep 26 11:34:12 EEST 2013

Hash: SHA1

On Thu, 26 Sep 2013, marco wrote:

> I have installed a postfix as an MTA and configured two "main" domains as 
> well as two virtual mailbox domains. Normal unix users have their maildir in 
> their homes (/home/%u) and the virtual mailboxes are located in 
> /var/mail/vhosts. It works well, I only have a problem configuring dovecot.
> I wondered if it's possible to configure it in a way that both, unix users 
> and virtual users, can access their mailboxes. I found some tutorials but 
> they either give access to the "normal" unix users or to virtual users who 
> are defined in a text file.
> Here some system infos:
> - Ubuntu 12.04.2 LTS (Kernel Version: 3.2.0-23)
> - Dovecot Version: 2.0.19

In Dovecot you configure one or more password databases and one or more 
user databases.

s. http://wiki2.dovecot.org/Authentication/MultipleDatabases

that covers system user + virtual users.

The order of the database definition is important, because the first 
database an user is defined in wins. And there is no connection between 
passdb and userdb, that means if an user authentificated agains the passwd 
password database successfully, his/her user data are not necessarily read 
from the passwd user database, if there is another userdb before, which 
contains the data of that user.

Be sure to return a proper home directory for the virtual users. You can 
do so in various ways, eg by returning the directory individually per user 
and by defaults, see http://wiki2.dovecot.org/UserDatabase
Or you can use the "static" userdb for virtual users and "passwd" userdb 
for system users, but place userdb passwd { } before userdb static { }.

Actually, Dovecot allows many ways to achieve your goal, so I would take 
an example for system users and add the virtual users to it. Later, when 
you know more about Dovecot, you can make the config more efficient.

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


More information about the dovecot mailing list