1

Topic: Dovecot is told its MySQL password is incorrect; dict can't connect

Hello,

I have a new installation.

Everything seemed to be working fine until last night when I removed pop and imap protocols from dovecot.conf. Doing this seems to have broken RoundCube mail so I re-added them back to dovecot.conf.

However, now it seems that dovecot cannot connect to the MySQL database:

from dovecot.log:

Apr 06 20:36:52 dovecot: Warning: Killed with signal 15 (by pid=23523 uid=0 code=kill)
Apr 06 20:36:52 dovecot: Info: Dovecot v1.2.9 starting up (core dumps disabled)
Apr 06 20:37:14 dict: Error: mysql: Connect failed to localhost (iredadmin): Access denied for user 'iredadmin'@'localhost' (using password: YES) - waiting for 1 seconds before retry
Apr 06 20:37:14 dict: Error: dict sql lookup failed: Not connected to database
Apr 06 20:37:45 dict: Error: mysql: Connect failed to localhost (iredadmin): Access denied for user 'iredadmin'@'localhost' (using password: YES) - waiting for 75 seconds before retry
Apr 06 20:37:45 dict: Error: dict sql lookup failed: Not connected to database
Apr 06 20:37:45 dict: Error: dict sql lookup failed: Not connected to database

The odd thing is I never changed iredadmin's MySQL password. The crypt form of the password is in dovecot-used-quota.conf:

#
# File generated by iRedMail (2011.04.06.00.50.45):
#
# Version:  0.7.0
# Project:  http://www.iredmail.org/
#
# Community: http://www.iredmail.org/forum/
#

connect = host=localhost dbname=iredadmin user=iredadmin password=<crypted-pass>
map {
    pattern = priv/quota/storage
    table = used_quota
    username_field = username
    value_field = bytes
}
map {
    pattern = priv/quota/messages
    table = used_quota
    username_field = username
    value_field = messages
}

Using the iredadmin MySQL password I can manually log in to MySQL and use the iredadmin database:

root@machine:/etc/dovecot# mysql -uiredadmin -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9623
Server version: 5.1.41-3ubuntu12.10 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use iredadmin;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql>

How can I change the password for dovecot so it can connect?

How did it become changed after functioning for 24 hrs normally?

Thanks,
Phil

----

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

2

Re: Dovecot is told its MySQL password is incorrect; dict can't connect

I forgot to add that forwarding rules seem to work fine.
Outbound mail works fine.

Phil

3

Re: Dovecot is told its MySQL password is incorrect; dict can't connect

AUPhil wrote:

connect = host=localhost dbname=iredadmin user=iredadmin password=<crypted-pass>

Try to use '127.0.0.1' instead of 'localhost' here, restart dovecot to test it.

Roundcube processes mails via IMAP or IMAPS protocol, if you want to remove IMAP support in dovecot, you should change roundcube settig in 'main.inc.php' to use IMAPS instead.

4

Re: Dovecot is told its MySQL password is incorrect; dict can't connect

Zhang,

Thanks for the reply. The strange thing is the problem when I put in the cleartext password in the config line:

connect = host=localhost dbname=iredadmin user=iredadmin password=mypasswordincleartext

Perhaps I was confused about the previous password. On a clean install of iRedMail, is the password for the connect line above an iRedMail generated password in cleartext, or is it a crypted password from my input on the iRedMail configuration screen?

Thanks!
Phil

5

Re: Dovecot is told its MySQL password is incorrect; dict can't connect

It's a cleartext PLAIN password, just LOOKS LIKE a encrypted password. big_smile

6

Re: Dovecot is told its MySQL password is incorrect; dict can't connect

ZhangHuangbin wrote:

It's a cleartext PLAIN password, just LOOKS LIKE a encrypted password. big_smile

HAHA!! Very good, sir! Thank you for your help.

Phil