Dovecot/Postfix auth problems

Discussion in 'Installation/Configuration' started by Aeron, Feb 12, 2016.

  1. Aeron

    Aeron New Member

    Hello, i have try to install Plesk on my dedicated server (Debian Squeeze) and it was an error..
    so i have just reboot my server, and since i can't receive mails :'(
    I have postfix/dovecot installer, and this is the mail log:
    Code:
    Feb 12 09:23:19 mail dovecot: auth-worker(default): mysql: Connect failed to 127.0.0.1 (postfix): Access denied for user 'postfix'@'127.0.0.1' (using password: YES) - waiting for 75 seconds before retry
    Feb 12 09:23:19 mail dovecot: auth-worker(default): sql([email protected],78.235.151.132): Password query failed: Not connected to database
    Feb 12 09:23:28 mail postfix/trivial-rewrite[7853]: fatal: mysql:/etc/postfix/mysql_virtual_alias_maps.cf(0,lock|fold_fix): table lookup problem
    Feb 12 09:23:28 mail postfix/trivial-rewrite[7854]: fatal: mysql:/etc/postfix/mysql_virtual_alias_maps.cf(0,lock|fold_fix): table lookup problem
    Feb 12 09:23:48 mail dovecot: auth-worker(default): mysql: Connect failed to 127.0.0.1 (postfix): Access denied for user 'postfix'@'127.0.0.1' (using password: YES) - waiting for 75 seconds before retry
    Feb 12 09:23:48 mail dovecot: auth-worker(default): sql([email protected],78.235.151.132): Password query failed: Not connected to database
    Feb 12 09:24:09 mail dovecot: auth-worker(default): mysql: Connect failed to 127.0.0.1 (postfix): Access denied for user 'postfix'@'127.0.0.1' (using password: YES) - waiting for 75 seconds before retry
    Feb 12 09:24:09 mail dovecot: auth-worker(default): sql([email protected],127.0.0.1): Password query failed: Not connected to database
    Feb 12 09:24:11 mail dovecot: auth-worker(default): sql([email protected],127.0.0.1): Password query failed: Not connected to database
    Feb 12 09:24:13 mail dovecot: auth-worker(default): sql([email protected],92.45.206.80): Password query failed: Not connected to database
    Feb 12 09:24:21 mail dovecot: auth-worker(default): sql([email protected],127.0.0.1): Password query failed: Not connected to database
    Feb 12 09:24:23 mail dovecot: auth-worker(default): sql([email protected],127.0.0.1): Password query failed: Not connected to database
    Feb 12 09:24:29 mail postfix/trivial-rewrite[7887]: fatal: mysql:/etc/postfix/mysql_virtual_alias_maps.cf(0,lock|fold_fix): table lookup problem
    Feb 12 09:24:29 mail postfix/trivial-rewrite[7888]: fatal: mysql:/etc/postfix/mysql_virtual_alias_maps.cf(0,lock|fold_fix): table lookup problem
    Feb 12 09:24:29 mail dovecot: auth-worker(default): mysql: Connect failed to 127.0.0.1 (postfix): Access denied for user 'postfix'@'127.0.0.1' (using password: YES) - waiting for 75 seconds before retry
    Feb 12 09:24:29 mail dovecot: auth-worker(default): sql([email protected],127.0.0.1): Password query failed: Not connected to database
    Feb 12 09:24:31 mail dovecot: auth-worker(default): sql([email protected],127.0.0.1): Password query failed: Not connected to database
    
    My postfix main.cf :
    Code:
    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
    biff = no
    disable_vrfy_command = yes
    smtpd_helo_required = yes
    
    # appending .domain is the MUA's job.
    append_dot_mydomain = no
    
    # Pour faire simple, il est conseutiliser le reverse DNS de votre serveur.
    myhostname = mail.tonheberg.com
    myorigin = mail.tonheberg.com
    mydestination = mail.tonheberg.com, localhost.localdomain, localhost, 195.154.83.134
    relayhost =
    mynetworks = 127.0.0.0/8, 195.154.83.134
    mailbox_size_limit = 0
    message_size_limit = 20240000
    recipient_delimiter = +
    inet_interfaces = all
    
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    smtpd_use_tls = yes
    smtpd_tls_cert_file = /etc/ssl/certs/mailcert.pem
    smtpd_tls_key_file = $smtpd_tls_cert_file
    
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    
    virtual_uid_maps = static:3000
    virtual_gid_maps = static:3000
    virtual_mailbox_base = /home/facteur
    
    virtual_transport = dovecot
    
    virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_mailbox_domains.cf
    virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
    virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
    relay_domains = mysql:/etc/postfix/mysql_relay_domains.cf
    
    smtpd_recipient_restrictions =
      permit_mynetworks,
      permit_sasl_authenticated,
      reject_non_fqdn_hostname,
      reject_non_fqdn_sender,
      reject_non_fqdn_recipient,
      reject_unauth_destination,
      reject_unauth_pipelining,
      reject_invalid_hostname
    
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    
    I have check the files for the mysql access, and it's ok.
    virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_mailbox_domains.cf
    virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
    virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
    relay_domains = mysql:/etc/postfix/mysql_relay_domains.cf

    When i try a telnet 127.0.0.1 25
    it's a : Connection closed by foreign host

    Someone have an idea ?
    Thanks a lot !
     
  2. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    While I went trough the hazzle of managing some plesk servers for several years ... one advise: get rid of it asap and use ispconfig :)
    swsoft/parallels is a nightmare when it comes to security fixes and config/software flexibility.

    But your issue is clear "
    Access denied for user 'postfix'@'127.0.0.1'

    "


    Check the permissions for the postfix user, either the generated passphrase is wrong or entry for the user connecting to 127.0.0.1 instead of localhost is missing entirely.

    Make sure the user postfix is able to login to your database.

    You can check the credentials by looking at /etc/postfix/mysql_virtual_alias_maps.cf

    and the database-rights by using phpmyadmin > users tab for example.

    You might want to reset the password to the expected one again, make sure localhost and 127.0.0.1 is set as allowed host for the user.
    Since there is no general connect error you can probably skip setting listen-interface for mysql to 127.0.0.1
     

Share This Page