[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


-----BEGIN PGP SIGNED MESSAGE-----
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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBUkPxhF3r2wJMiz2NAQLkLQgAjZr00JXzbmoCx/RXyTB7r/UG92DV4ucV
OnI/SSvBwlbFeIGayvt/9hrmNN8j5aep46CfKQxNZoXPrp1Y7SHgczZ6IFoAV8wN
pIy8KkDG0+OhqG78hUbR7qEZO6SG32XCyP4F4KNa7+L13y1kP/MIaNI6AziHQgYE
7ML5VcvTA/0dDBjskOJQhxJf9385vT1hT7d9yMk/vbF76zMLh3FuGdrIxMrRlmTr
r2/xLr3A9hDNUx3seq9EevAbxz933KyVbdeFuLH6SLN+AkEGCyhv0WlfxoSQaHe8
grL6M/tPFkYAe6yIRFW3ixLUDshflgFfZhoQLxk4D6L+sjO4A6EPRw==
=AtBE
-----END PGP SIGNATURE-----


More information about the dovecot mailing list