> password_query = SELECT \ > username as user, password, \ > '%w' AS userdb_mail_crypt_private_password \ > FROM mailbox WHERE username="%u"; Try if using ' instead of " makes a difference. FROM mailbox WHERE username='%u';