[Dovecot] dovecot is working, sort of

LuKreme kremels at kreme.com
Thu Aug 15 08:13:52 EEST 2013


I have dovecot setup and authenticating away for local users, but when I try to add MySQL users from postfix admin, not only does that fail, but all authentication fails.

This configuration does not work:

 doveconf -n
# 2.2.5: /usr/local/etc/dovecot/dovecot.conf
# OS: FreeBSD 9.1-RELEASE i386  
namespace inbox {
  inbox = yes
  location = 
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix = 
}
passdb {
  driver = pam
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
ssl_cert = </etc/ssl/certs/dovecot.pem
ssl_key = </etc/ssl/private/dovecot.pem
userdb {
  driver = passwd
}
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}

and I get the following errors for *ALL* attempts to connect, not just sql ones:
mail dovecot: imap-login: Error: Timeout waiting for handshake from auth server. my pid=10591, input bytes=0
Aug 14 22:56:36 mail dovecot: imap-login: Error: Timeout waiting for handshake from auth server. my pid=10592, input bytes=0
mail dovecot: auth: Fatal: mysql: Missing value in connect string: password-dovecot
mail dovecot: master: Error: service(auth): command startup failed, throttling for 60 secs
mail dovecot: imap-login: Disconnected: Auth process broken (disconnected before auth was ready, waited 1 secs): user=<>, rip=67.176.106.217, lip=75.148.117.91, TLS, session=<U82VTPXjvQBDsGrZ>


This configuration works, but only for local users obviously:
# 2.2.5: /usr/local/etc/dovecot/dovecot.conf
# OS: FreeBSD 9.1-RELEASE i386  
namespace inbox {
  inbox = yes
  location = 
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix = 
}
passdb {
  driver = pam
}
ssl_cert = </etc/ssl/certs/dovecot.pem
ssl_key = </etc/ssl/private/dovecot.pem
userdb {
  driver = passed
}

The dovecot-sql.conf.ext file is:
$ cat /etc/dovecot/dovecot-sql.conf.ext
driver =  mysql
connect = host=localhost dbname=postfix user=dovecot password-dovecot
default_pass_scheme = CRYPT
password_query = select password from mailbox where username ='%u'
user_query = select concat('/usr/local/virtual/', maildir) from mailbox where username = '%u;

#iterate_query = SELECT username AS user FROM users

Both to the password_query and user_query lines return the right results when I do them manually in MySQL.

The one thing I am very unsure of is the default_pass_scheme (the postfixdb is a postfixadmin db), but even if that were completely wrong, it seems like the local users should still be able to authenticate even if the MySQL ones cannot?

-- 
And east is east and west is west and if you take cranberries and stew
them like applesauce they taste much more like prunes than rhubarb does.



More information about the dovecot mailing list