Is there any reason Dovecot shows the 'user' variable (ie: user@domain.tld) being obtained in the password query and not the (more logical) user query?
If you want to avoid doing two SQL queries when logging in with IMAP/POP3, you can make the password_query return all the necessary userdb fields and use prefetch userdb to use those fields. If you're using Dovecot's deliver you'll still need to have the user_query working.