Maybe it is an sql config error?
Robert Moskowitz
rgm at htt-consult.com
Thu Apr 6 23:12:04 EEST 2017
I am looking at these messages in maillog:
Apr 6 15:46:58 z9m9z dovecot: dict: Error: mysql(localhost): Connect
failed to database (postfix): Can't connect to local MySQL server
through socket '/var/lib/mysql/mysql.sock' (13) - waiting for 25 seconds
before retry
Apr 6 15:46:58 z9m9z dovecot: dict: Error: mysql(localhost): Connect
failed to database (postfix): Can't connect to local MySQL server
through socket '/var/lib/mysql/mysql.sock' (13) - waiting for 1 seconds
before retry
Apr 6 15:46:58 z9m9z dovecot: dict: Error: dict sql lookup failed: Not
connected to database
and wondering if my config is wrong. Here is what I have:
in local.conf:
# dovecot.conf
protocols = imap pop3 lmtp sieve
dict {
sqlquota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
}
# 10-auth.conf
!include conf.d/auth-sql.conf.ext
# auth-sql.conf.ext
userdb {
driver = prefetch
}
# 90-quota.conf
plugin {
quota = dict:user::proxy::sqlquota
trash = /etc/dovecot/dovecot-trash.conf.ext
}
dovecot-sql.conf.ext:
driver = mysql
connect = host=localhost dbname=postfix user=postfix password=mailpassword
default_pass_scheme = MD5-CRYPT
# following should all be on one line.
password_query = SELECT username as user, password,
concat('/home/vmail/', maild
ir) as userdb_home, concat('maildir:/home/vmail/', maildir) as
userdb_mail, 101
as userdb_uid, 12 as userdb_gid FROM mailbox WHERE username = '%u' AND
active =
'1'
# following should all be on one line
user_query = SELECT concat('/home/vmail/', maildir) as home,
concat('maildir:/ho
me/vmail/', maildir) as mail, 101 AS uid, 12 AS gid,
CONCAT('*:messages=30000:by
tes=', quota) as quota_rule FROM mailbox WHERE username = '%u' AND
active = '1'
[root at z9m9z dovecot]#
dovecot-dict-sql.conf.ext:
connect = host=localhost dbname=postfix user=postfix password=mailserv
map {
pattern = priv/quota/storage
table = quota2
username_field = username
value_field = bytes
}
map {
pattern = priv/quota/messages
table = quota2
username_field = username
value_field = messages
}
Users ARE getting authenticated:
# openssl s_client -connect z9m9z.test.htt-consult.com:993
CONNECTED(00000003)
.... Cert stuff cut
---
SSL handshake has read 1676 bytes and written 405 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384
.... Cert stuff cut
---
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE
IDLE AUTH=PLAIN] Dovecot ready.
a login faxit at test.htt-consult.com faxitpaaswd
a OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE
IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS
THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN
NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH
ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS SPECIAL-USE BINARY
MOVE QUOTA] Logged in
b list "" *
* LIST (\HasNoChildren \Sent) "." Sent
* LIST (\HasNoChildren \Trash) "." Trash
* LIST (\HasNoChildren \Drafts) "." Drafts
* LIST (\HasNoChildren) "." Spam
* LIST (\HasNoChildren) "." INBOX
b OK List completed.
======
So perhaps it is with the quota sql on sending/recv mail?
thanks
More information about the dovecot
mailing list