>[оверквотинг удален]
> virtual_gid_maps = static:1981
> virtual_uid_maps = static:1981
> virtual_mailbox_base = /var/mail
> virtual_transport = dovecot
> $ cat /etc/dovecot/dovecot.conf
> mail_location = maildir:/var/mail/%u
> mail_privileged_group = virtual
> first_valid_uid = 1981
> last_valid_uid = 1981
> first_valid_gid = 1981 Спасибо, поправил конфиг с учетом ваших замечаний, теперь dovecot-sql.conf выглядит так:
driver = mysql
connect = host=/var/run/mysqld/mysqld.sock dbname=mail user=mail password='kasu8dsWsi8df2'
default_pass_scheme = MD5
password_query = SELECT `username` AS `user`, `password` FROM `mailbox` WHERE `username` = '%u' AND active = '1'
user_query = SELECT CONCAT('/home/vmail/', `maildir`) AS `home`, 150 AS uid, 8 AS gid, concat('*:bytes=', quota) as quota_rule FROM `mailbox` WHERE `username` = '%u' AND `active` = '1'
Права на чтение из базы у пользователя mail есть:
mysql> show grants for mail@localhost;
+-------------------------------------------------------------------------------------------------------------+
| Grants for mail@localhost |
+-------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'mail'@'localhost' IDENTIFIED BY PASSWORD '*D617AC8AFE70B8A175415CB41E5ABA596F2EA7F8' |
| GRANT ALL PRIVILEGES ON `mail`.* TO 'mail'@'localhost' |
+-------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
Рестартанул dovecot, но ошибка по прежнему осталась:
auth-worker(6354): Error: mysql(/var/run/mysqld/mysqld.sock): Connect failed to database (mail): Access denied for user 'mail'@'localhost' (using password: YES) - waiting for 25 seconds before retry
Подозреваю, что причина где то в механизмах аутентификации и схемах паролей, но где именно не могу разобраться :(