1

Topic: Dovecot Driver not set

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.0.0
- Deployed with iRedMail Easy or the downloadable installer? downloadable
- Linux/BSD distribution name and version: Debian 9.12
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Web server (Apache or Nginx): nginx
- Manage mail accounts with iRedAdmin-Pro? yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
May 23 16:53:16 post uwsgi: spawned uWSGI worker 5 (pid: 24810, cores: 1)
May 23 16:58:31 post dovecot: auth: Fatal: sql: driver not set in configuration file /etc/dovecot/dovecot-mysql.conf
May 23 16:58:31 post dovecot: master: Error: service(auth): command startup failed, throttling for 60 secs
May 23 16:59:31 post dovecot: auth: Fatal: sql: driver not set in configuration file /etc/dovecot/dovecot-mysql.conf
May 23 16:59:31 post dovecot: master: Error: service(auth): command startup failed, throttling for 60 secs
May 23 17:07:23 post dovecot: master: Fatal: Dovecot is already running with PID 900 (read from /var/run/dovecot/master.pid)
May 23 17:10:33 post dovecot: master: Warning: Killed with signal 15 (by pid=29001 uid=0 code=kill)
May 23 17:10:33 post dovecot: master: Dovecot v2.2.27 (c0f36b0) starting up for pop3, imap, sieve, lmtp (core dumps disabled)
May 23 17:20:31 post dovecot: auth: Fatal: sql: driver not set in configuration file /etc/dovecot/dovecot-mysql.conf
May 23 17:20:31 post dovecot: master: Error: service(auth): command startup failed, throttling for 2 secs
====

Hi,

I am in the progress of upgrading and working on implementing "Track user last login time" from https://docs.iredmail.org/track.user.last.login.html

When done, I found the error at the top in /var/log/dovecot/dovecot.log

/etc/dovecot/dovecot-mysql.conf looks like this:

user_query = SELECT \
    '%u' AS master_user, \
    CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, \
    CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule \driver = mysql
default_pass_scheme = CRYPT
connect = host=127.0.0.1 port=3306 dbname=vmail user=vmail password=####

# Required by doveadm tools which require to list all mail users.
iterate_query = SELECT username AS user FROM mailbox

password_query = SELECT mailbox.password, mailbox.allow_nets \
        FROM mailbox,domain \
       WHERE mailbox.username='%u' \
             AND mailbox.`enable%Ls%Lc`=1 \
             AND mailbox.active=1 \
             AND mailbox.domain=domain.domain \
             AND domain.backupmx=0 \
             AND domain.active=1
user_query = SELECT \
    '%u' AS master_user, \
    CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, \
    CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule \
FROM mailbox,domain \
WHERE mailbox.username='%u' \
    AND mailbox.domain='%d' \
    AND mailbox.`enable%Ls%Lc`=1 \
    AND mailbox.domain=domain.domain \
    AND domain.backupmx=0 \
    AND domain.active=1 \
    AND mailbox.active=1

So there is a driver statement but chained to the SQL select user_query. Putting it on a line of itself, does not help at all...

I tried to always follow the upgrade path as close as possible...

On google I found, that the driver statement may not be part of a .conf file, it has to be included... but I am out here on how to go further.

I did not find anything by searching the forum.

Thanks for any help, regards

Jochen

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Dovecot Driver not set

You should set "driver = mysql" in /etc/dovecot/dovecot-mysql.conf.

3

Re: Dovecot Driver not set

Hi,

ZhangHuangbin wrote:

You should set "driver = mysql" in /etc/dovecot/dovecot-mysql.conf.

The code is there in my file, but appended to the SQL-Statement... if I put it on it's own line, the error persists, but if I put it at the top of the file, it seems to work again. Mhmm... I do not understand this... seems like user_select is not an ordinary string variable... Nevertheless it looks cleaner this way and works again:

driver = mysql
default_pass_scheme = CRYPT
connect = host=127.0.0.1 port=3306 dbname=vmail user=vmail password=####
user_query = SELECT \
    '%u' AS master_user, \
    CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, \
    CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule  \
FROM mailbox,domain \
WHERE mailbox.username='%u' \
    AND mailbox.domain='%d' \
    AND mailbox.`enable%Ls%Lc`=1 \
    AND mailbox.domain=domain.domain \
    AND domain.backupmx=0 \
    AND domain.active=1 \
    AND mailbox.active=1