Hi Timo,
Been trying to track this problem down further. The problem seems to be related to verifying the master user failing.
My passdb looks like this:
passdb { driver = sql args = /etc/dovecot/dovecot-domain-owner-sql.conf master = yes pass = yes }
dovecot-domain-owner-sql.conf contains:
user_query = SELECT user_name, domain_name FROM users WHERE user_name = '%n' AND domain_name = '%d' AND owns_domain='1'
password_query = SELECT user_name, domain_name, password FROM users WHERE user_name = '%n' AND domain_name = '%d' AND owns_domain='1' AND '%d'='%{login_domain}'
In this example - bill@plf.net is an ordinary user. tom@plf.net is a domain owner. Tom wants to read bills email.
The login is: bill@plf.net*tom@plf.net
This results in tom@plf.net being classified as an unknown user.
Aug 17 08:38:30 auth: Debug: sql(tom@plf.net,127.0.0.1): query: SELECT user_name, domain_name, password FROM users WHERE user_name = 'tom' AND domain_name = 'plf.net' AND owns_domain='1' AND 'plf.net'='' Aug 17 08:38:30 auth: Info: sql(tom@plf.net,127.0.0.1): unknown user Aug 17 08:38:32 auth: Debug: client out: FAIL 15 user=tom@plf.net Aug 17 08:38:32 imap-login: Info: Aborted login (auth failed, 1 attempts): user=tom@plf.net, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=0, secured
Note that the query used to determine that tom@plf.net is valid is the password_query and not the user_query resulting in unknown user. I think that's where the problem is.