[Dovecot] Wrong MySQL sintax, I can't login

Pablo boinker at gmail.com
Tue Aug 31 09:42:43 EEST 2010


Hi guys:

I can't login as a user:

The output of mail.log:

Aug 31 08:39:45 socrates dovecot: auth(default): client in:
AUTH^I1^IPLAIN^Iservice=imap^Ilip=178.63.82.247^Irip=81.39.27.227^Ilport=143^Irport=33715^Iresp=AHBhYmxvLnJvZHJpZ3VlekBlc2N1ZWxhc3VwZXJpb3JkZWNvYWNoaW5nLmNvbQBwZXJpa2l0YS4=
Aug 31 08:39:45 socrates dovecot: auth-worker(default):
sql(pablo.rodriguez at escuelasuperiordecoaching.com,81.39.27.227):
query: SELECT password FROM mailbox WHERE username =
'pablo.rodriguez at escuelasuperiordecoaching.com'
Aug 31 08:39:45 socrates dovecot: auth(default): client out:
OK^I1^Iuser=pablo.rodriguez at escuelasuperiordecoaching.com
Aug 31 08:39:45 socrates dovecot: auth(default): master in:
REQUEST^I65^I16796^I1
Aug 31 08:39:45 socrates dovecot: auth-worker(default):
sql(pablo.rodriguez at escuelasuperiordecoaching.com,81.39.27.227):
SELECT maildir, 1001 AS uid, 1001 AS gid FROM mailbox WHERE username =
'pablo.rodriguez at escuelasuperiordecoaching.com
Aug 31 08:39:45 socrates dovecot: auth-worker(default):
sql(pablo.rodriguez at escuelasuperiordecoaching.com,81.39.27.227): User
query failed: You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to
use near ''pablo.rodriguez at escuelasuperiordecoaching.com' at line 1
Aug 31 08:39:45 socrates dovecot: auth(default): master out: FAIL^I65
Aug 31 08:39:45 socrates dovecot: imap-login: Internal login failure
(auth failed, 1 attempts):
user=<pablo.rodriguez at escuelasuperiordecoaching.com>, method=PLAIN,
rip=81.39.27.227, lip=178.63.82.247

My Dovecot version: 1.2.9

My Dovecot configuration:

# 1.2.9: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-23-server x86_64 Ubuntu 10.04.1 LTS reiserfs
log_timestamp: %Y-%m-%d %H:%M:%S
protocols: imap imaps pop3 pop3s
ssl_cert_file: /etc/ssl/mail/dovecot.crt
ssl_key_file: /etc/ssl/mail/dovecot.key
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(pop3): /usr/lib/dovecot/pop3-login
mail_location: maildir:/home/vmail/%u/
mail_debug: yes
mbox_write_locks: fcntl dotlock
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(pop3): /usr/lib/dovecot/pop3
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3
auth default:
  mechanisms: plain login
  verbose: yes
  debug: yes
  debug_passwords: yes
  passdb:
    driver: sql
    args: /etc/dovecot/dovecot-sql.conf
  userdb:
    driver: sql
    args: /etc/dovecot/dovecot-sql.conf
  socket:
    type: listen
    client:
      path: /var/spool/postfix/private/auth
      mode: 432
      user: postfix
      group: postfix
    master:
      path: /var/run/dovecot/auth-master
      mode: 384
      user: vmail
      group: vmail

My Dovecot MySQL configuration:

driver=mysql
connect = host=localhost dbname=postfix user=postfix password=xxxxxx
default_pass_scheme = CRYPT
password_query = SELECT password FROM mailbox WHERE username = '%u'
user_query = SELECT maildir, 1001 AS uid, 1001 AS gid FROM mailbox
WHERE username = '%u

Can anyone help me? I've seen that log told me "wrong syntax", but I
think upper query is right, isn't it? Any hint?

Thanks in advance :-)


More information about the dovecot mailing list