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

On Wed, 27 Nov 2013, R. Berger wrote:

Steffen Kaiser schreef op 27-11-2013 17:48:
On Wed, 27 Nov 2013, Benny Pedersen wrote:

Roger Berger skrev den 2013-11-27 11:41:
If I understand right it is not possible to use system
and virtual users together.

incorrect it is, see here http://wiki2.dovecot.org/VirtualUsers part of usernames and domains

its all about dovecot auth how its configured, if you want both system and virtual users make sure system users get domain stripped in auth

in addition to Benny's remark, you can also override the username, e.g. system users may auth without domain, but passdb/userdb return the user with domain. Then you can have all users as virtual user/domain.

But probably using two userdb's is easier to maintain.

Here is my dovecot -n:
root@mail:/usr/local/etc/dovecot/conf.d # dovecot -n
# 2.2.6: /usr/local/etc/dovecot/dovecot.conf

mail_location = maildir:~/

you should not use the home directory as base for mail storage, use ~/Maildir

passdb {
  args = /usr/local/etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}

userdb {
 driver = prefetch
}
userdb {
 args = /usr/local/etc/dovecot/dovecot-sql.conf.ext
 driver = sql
}


I've been thinking about this and I want to put all system users in the database using the provided tools from postfixadmin and then sync the mail using imapsync.

OK, then all user data are in the SQL database.

In that case domain admins can handle their own mailboxes using postfixadmin.
In that case I have all users as virtual users, but they have to be able to login with only their username. That means new users should login by using their complete emailaddress and old users as username or emailaddress.
so:
old user: i...@domain1.com user: info can login as info or i...@domain1.com
old user: i...@domain2.com user: info.ltd can login as info.ltd or i...@domain2.com
new user: i...@domain3.com can login only as i...@domain3.com
if the new user tries to login as info he gets a password failure
Is this possible an correct ?

configure your SQL query so, that i...@domain1.com and info hits the same entry and that the username is overwritten (field "user", IMHO) to i...@domain1.com. Then this user can login as i...@domain1.com or info with the same password, internally Dovecot handles all mail as i...@domain1.com only.

Do the same for all other users as appropriate.

One can craft the database like so:

+ one table with the user data of i...@domain1.com, username, password a.s.o.

+ one table with alias names and foreign key of user data table

+ the select for passdb joins both tables

Search the list and wiki for such setup, e.g. http://wiki2.dovecot.org/PasswordDatabase?highlight=%28username%29

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

iQEVAwUBUpcIHl3r2wJMiz2NAQL5tgf/c130rwnZvXqNQOKiMpympmIZQhEmTMbd
skSn+Bq7oLlU1nR3ao8HrdPmDlKeJYDUgU2Gr2U1Gw8z247TdFCQhLczFrm0gL+J
gDUGS35sNVo6muSPlXGuTRL3J0kFDZX25Ic6APsvahk6HJGg3Z65cmYDLvi9PiyN
TYysA4/zHmn0rZqzAdmeJdRF5VdW4CcDJ2ThKfbUVDgVYhRLRV1NhxK1sujkAWR8
WRTd96iB7dqNZo4SMkxQ9qhwL+HmfyWY2z2WVniqkhzUSRuc3v/StOU4/T4EaUTA
wrM9TbHOWU7KU3DAmFj9TuVNP0KU2eINREainhl86IBrK5HTCY1NTQ==
=0voO
-----END PGP SIGNATURE-----

Reply via email to