mysql - Postfix + Dovecot Connect failed to database -


i have installed new mailserver based on postfix , dovecot. setup fine while configurated everything. no error outputs or someting.

the problem is: when try connect mail account on client, going idle @ authentication.

inside /var/log/mail.log

dovecot: auth-worker(15467): error: mysql(localhost): connect failed database (mail): access denied user 'mail'@'localhost' (using password: yes) - waiting 1 seconds before retry 

so, dovecot cant connect database / wont auth. have no idea why. database user has right privileges database / tried flush privileges. read auth failed because of encrypt algo. set mail user password old_password function (found here). wont work.

here driver conf (dovecot-mysql.conf)

driver = mysql connect = host=localhost dbname=mail user=mail password='mypassword' default_pass_scheme = plain-md5 password_query = select password mailbox username = '%u' user_query = select concat('maildir:/var/vmail/',maildir) mail, 6000 uid, 6000 gid mailbox username = '%u' 

(mypassword changed here)

so dont know why wont give me access database. idea?

i grateful help!


annotation:
server: debian v7.9
database: mysql 5.6.25
dovecot: 2.1.7
postfix: 2.9.6

postconf -n

alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases append_dot_mydomain = no biff = no broken_sasl_auth_clients = yes config_directory = /etc/postfix disable_vrfy_command = yes dovecot_destination_recipient_limit = 1 inet_interfaces = local_transport = virtual mailbox_command = procmail -a "$extension" mailbox_size_limit = 0 mydestination = markheumueller.de, localhost myhostname = h2377359.stratoserver.net mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 myorigin = /etc/mailname proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps readme_directory = no recipient_delimiter = + relayhost = smtp_tls_security_level = may smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname esmtp $mail_name (debian/gnu) smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks reject_unauth_destination smtpd_sasl_auth_enable = yes smtpd_sasl_authenticated_header = yes smtpd_sasl_path = private/auth_dovecot smtpd_sasl_type = dovecot smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql-sender-login-maps.cf smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch reject_unknown_sender_domain smtpd_tls_cert_file = /etc/postfix/ssl/mailserver.crt smtpd_tls_key_file = /etc/postfix/ssl/mailserver.key smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual-alias-maps.cf virtual_gid_maps = static:6000 virtual_mailbox_base = /var/vmail/ virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual-domains-maps.cf virtual_mailbox_limit = 0 virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf virtual_minimum_uid = 104 virtual_transport = dovecot virtual_uid_maps = static:6000 

the error in log file forwarded mysql server. , states user mail cannot connect localhost.

you need check if mysql-server:

  • 1.is running.
  • 2.really listens on localhost on standard port(3306), i'd use "netstat -tnla"

just if there entry like:

proto recv-q send-q local address           foreign address        state       tcp        0      0 127.0.0.1:3306            0.0.0.0:*            listen 

if there such line try changing settings to:

driver = mysql connect = host=127.0.0.1 dbname=mail user=mail password='mypassword' 

sometimes helps.

if "netstat" commando deliver no line containing 127.0.0.1:3306,

  • make sure mysql server listen on tcp socket on unix socket, on debian , co. /etc/my.cnf file.

if runs , listens ok, there still no authentication through dovecot/postfix using set mysql account , database, try connecting same credentials on commandline in terminal window:

mysql -u mail -h localhost mail -p

you should succeed in such console login.

should receive similar error in log file, doing login attempt, didn't correctly set user access parameters in mysql. use correct grant sql sentence this, in similar way here me:

~$ mysql -u root -p  enter password:   welcome mysql monitor.  commands end ; or \g. mysql connection id 505705 server version: 5.5.49-0+deb8u1 (debian)  type 'help;' or '\h' help. type '\c' clear current input statement.  mysql> grant privileges on mail.* 'mail'@'localhost' identified 'your.password.here';  mysql> grant privileges on mail.* 'mail'@'127.0.0.1' identified 'your.password.here'; 

using grant sentences in mysql don't need flash privileges.

you can restrict user privileges , instead of grant privileges part, use: grant usage on mail.* 'mail'@'127.0.0.1' identified 'your.password.here'; grant select on mail.* 'mail'@'127.0.0.1' identified 'your.password.here';

hope helps.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -