Users with multiple password
Hi!
~ dovecot --version 2.2.22 (fe789d2)
I am wondering if there is a way to set up virtual users with multiple valid passwords. We want to be able to provide users with device/app-specific passwords for their email accounts, as well as being able to create temporary "access tokens" for technical support when required.
I quickly found out that passdb using passwd-file or an sql-backend does not support returning multiple entries ("Error: passwd-file /etc/dovecot/virtual.passwd: User rye exists more than once").
The documentation mentions that you can pass the plain-text password on to the MySQL-server for verification, and I suppose multiple passwords could could work, given a query like this (pseudo-SQL):
SELECT password FROM account WHERE user = '%u' AND domain = '%d' AND password = TO_BASE64((SHA2('%w', 512));
However, having Dovecot pass the plain-text password and letting the database deal with the hashing and encoding doesn't seem like a very "clean" solution. Preferably, dovecot should be the only piece of software touching the plain-text.
Ideally, I would like the following behavior:
- passdb results multiple possible hashed passwords for the user
- dovecot attempts the passwords in order
- login fails normally if none of the passdb results match
Does anyone have any experience, or tips for setting up this type of behavior?
Other ideas we have touched upon are:
- Different usernames (eg. 'user_device' or 'user_application')
- Multiple passdbs(?)
Best regards, Eirik Rye
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Fri, 24 Feb 2017, Eirik Rye wrote:
- Multiple passdbs(?)
Check out http://wiki2.dovecot.org/PasswordDatabase
result_failure = continue result_internalfail = continue result_success = return-ok
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEVAwUBWLBJDHz1H7kL/d9rAQLffwf/X7qZCiQ/a/dVYPVLC+Ie+RoFqwl/W96m syyTSsrwPa9GnkAygSpuBUByBDNwsNCTaheao3kwkhD51hBtHxkXXZlozyaJy9q7 ZA7UAQAwWGZlZpnUNzM4nRyFRyBLsZAWpMWQAZLy868kjXR75M4fxX4YdsHCp0Jf Ajp88Khcx04e11tmEpTRoDbcsWyoap8YKCblbgS6euKXYu4oQT2gV+iLQAkTBAPM Yh8Od3M7i9xf/6iP3lfj3HJtLb7KhtsgcmLQbGd+PPdWIOc9geeF9222ssP5QyYj OL5PlL3Mm7c/BrHbqKnFNILKcf31CHdahigDYNheGKeS43Zx89uRwA== =t9Fy -----END PGP SIGNATURE-----
On 24/02/2017 15:54, Steffen Kaiser wrote:
Check out http://wiki2.dovecot.org/PasswordDatabase
result_failure = continue result_internalfail = continue result_success = return-ok
- -- Steffen Kaiser
Thanks. I have looked at this, however it would still require the secondary passdb to be passing the plain-text password on to the backend in order to constrain the passdb-query to a single result, right?
- Eirik Rye
participants (2)
-
Eirik Rye
-
Steffen Kaiser