I'm trying to configure Dovecot + Postfix + PostfixAdmin with postgresql support. I successfully configured postfix to send emails to aliases for my domain, and now I want to configure actual mailboxes support on my server. I followed the configuration options for database support on dovecot 2 wiki (http://wiki.dovecot.org/AuthDatabase/SQL), dovecot starts without errors, but at the first attempt to connect by IMAP, dovecot complains on maillog:

auth: Fatal: Unknown database driver 'pgsql'

I'm sure dovecot has postgres support, here's the output for dovecot --build-options:

Build options: ioloop=epoll notify=inotify ipv6 openssl io_block_size=8192
Mail storages: cydir dbox maildir mbox mdbox raw shared
SQL driver plugins: mysql postgresql sqlite
Passdb: checkpassword ldap pam passwd passwd-file shadow sql
Userdb: checkpassword ldap(plugin) nss passwd prefetch passwd-file sql

Additional information:


passdb {
  driver = pgsql
  # Path for SQL configuration file, see example-config/dovecot-sql.conf.ext
  args = /etc/dovecot/conf.d/dovecot-sql.conf.ext

For driver section I tried: 'pgsql, 'postgresql' and 'sql', I always get the error.


connect = host=localhost dbname=postfix user=postfix password=secret
default_pass_scheme = CRYPT
password_query = SELECT userid as user, password FROM users WHERE userid = '%u'
user_query = SELECT '/home/'||home AS home, uid, gid FROM users WHERE userid = '%u'

Any idea about something I'm missing? Thank you.

  • 1
    Fixed by myself. I was missing the dovecot-pgsql package. Pretty trivial. – lorenzo.marcon Nov 25 '11 at 21:15

On CentOS 6 is necessary to install not only the dovecot package, but also the additional modules, in this case the package dovecot-pgsql is also needed for postgresql support.

The right syntax for the driver line in /etc/dovecot/conf.d/auth-sql.conf.ext is:

driver = sql

and then the right driver is specified in /etc/dovecot/conf.d/dovecot-sql.conf.ext

driver = pgsql
  • It's worth noting that /etc/dovecot/conf.d/10-auth.conf on my Fedora23 system has a section at the bottom for "Password and user databases": !include auth-sql.conf.ext might need to be uncommented also/instead. – ILMostro_7 Jul 26 '16 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.