Marc Perkel
2010-Aug-17 15:50 UTC
[Dovecot] Master Login using MySQL problem - %{login_domain}
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 at plf.net is an ordinary user. tom at plf.net is a domain owner. Tom wants to read bills email. The login is: bill at plf.net*tom at plf.net This results in tom at plf.net being classified as an unknown user. Aug 17 08:38:30 auth: Debug: sql(tom at 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 at plf.net,127.0.0.1): unknown user Aug 17 08:38:32 auth: Debug: client out: FAIL 15 user=tom at plf.net Aug 17 08:38:32 imap-login: Info: Aborted login (auth failed, 1 attempts): user=<tom at 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 at 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.
Timo Sirainen
2010-Aug-17 16:45 UTC
[Dovecot] Master Login using MySQL problem - %{login_domain}
On Tue, 2010-08-17 at 08:50 -0700, Marc Perkel wrote:> Been trying to track this problem down further. The problem seems to be > related to verifying the master user failing.Show the whole dovecot -n output and the whole logs when master user is logging in? You've cut away some stuff I'd like to see.