Dovecot/MySQL authentication errors

Discussion in 'Installation/Configuration' started by Sharone, Apr 11, 2021.

  1. Sharone

    Sharone Member

    Hi! So I just reinstalled ISPConfig 3.1.15p3 on Ubuntu 18.04.5 slave server. I've got dovecot failing to connect to the database and would appreciate a few pointers on where to look. I'm sure there's a misconfiguration that I have failed to identify
    Dovecot is up and running
    Code:
    root@mail-server:~# systemctl status dovecot
    ● dovecot.service - Dovecot IMAP/POP3 email server
       Loaded: loaded (/lib/systemd/system/dovecot.service; enabled; vendor preset: enabled)
       Active: active (running) since Sun 2021-04-11 15:09:25 EAT; 10min ago
         Docs: man:dovecot(1)
               http://wiki2.dovecot.org/
      Process: 4620 ExecStop=/usr/bin/doveadm stop (code=exited, status=0/SUCCESS)
     Main PID: 4623 (dovecot)
        Tasks: 7 (limit: 4915)
       CGroup: /system.slice/dovecot.service
               ├─4623 /usr/sbin/dovecot -F
               ├─4628 dovecot/anvil
               ├─4629 dovecot/log
               ├─4632 dovecot/config
               ├─4920 dovecot/ssl-params
               ├─5278 dovecot/auth
               └─5279 dovecot/auth -w
    
    Apr 11 15:10:29 mail-server dovecot[4629]: imap-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=196.168.145.30, lip=10.0.0.2, TLS handshaking: SSL_acce
    Apr 11 15:10:48 mail-server dovecot[4629]: imap-login: Aborted login (auth failed, 1 attempts in 2 secs): user=<[email protected]>, method=PLAIN, rip=10.0.0.4,
    Apr 11 15:10:50 mail-server dovecot[4629]: imap-login: Aborted login (auth failed, 1 attempts in 2 secs): user=<[email protected]>, method=PLAIN, rip=10.0.0.4,
    Apr 11 15:15:02 mail-server dovecot[4629]: pop3-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=::1, lip=::1, secured, session=<bO68WLG/AOoAAAAAAAAAAAAAAAAA
    Apr 11 15:15:02 mail-server dovecot[4629]: imap-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=::1, lip=::1, secured, session=<9/S8WLG/NOMAAAAAAAAAAAAAAAAA
    Apr 11 15:15:46 mail-server dovecot[4629]: imap-login: Aborted login (auth failed, 1 attempts in 2 secs): user=<[email protected]>, method=PLAIN, rip=10.0.0.4,
    Apr 11 15:15:52 mail-server dovecot[4629]: imap-login: Aborted login (auth failed, 1 attempts in 6 secs): user=<[email protected]>, method=PLAIN, rip=10.0.0.4,
    Apr 11 15:16:24 mail-server dovecot[4629]: auth: Warning: auth client 0 disconnected with 2 pending requests: EOF
    Apr 11 15:20:01 mail-server dovecot[4629]: pop3-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=::1, lip=::1, secured, session=<yd+RarG/NOoAAAAAAAAAAAAAAAAA
    Apr 11 15:20:01 mail-server dovecot[4629]: imap-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=::1, lip=::1, secured, session=<fOSRarG/aOMAAAAAAAAAAAAAAAAA
    /etc/dovecot/dovecot.conf
    Code:
    root@mail-server:~# dovecot -n
    # 2.2.33.2 (d6601f4ec): /etc/dovecot/dovecot.conf
    # Pigeonhole version 0.4.21 (92477967)
    # OS: Linux 4.15.0-140-generic x86_64 Ubuntu 18.04.5 LTS
    auth_mechanisms = plain login
    disable_plaintext_auth = no
    listen = *,[::]
    log_timestamp = "%Y-%m-%d %H:%M:%S "
    mail_max_userip_connections = 100
    mail_plugins = " quota"
    mail_privileged_group = vmail
    passdb {
      args = /etc/dovecot/dovecot-sql.conf
      driver = sql
    }
    plugin {
      quota = dict:user::file:/var/vmail/%d/%n/.quotausage
      sieve = /var/vmail/%d/%n/.sieve
      sieve_max_redirects = 25
    }
    postmaster_address = [email protected]
    protocols = imap pop3
    service auth {
      unix_listener /var/spool/postfix/private/auth {
        group = postfix
        mode = 0660
        user = postfix
      }
      unix_listener auth-userdb {
        group = vmail
        mode = 0600
        user = vmail
      }
      user = root
    }
    service imap-login {
      client_limit = 1000
      process_limit = 512
    }
    service lmtp {
      unix_listener /var/spool/postfix/private/dovecot-lmtp {
        group = postfix
        mode = 0600
        user = postfix
      }
    }
    ssl_cert = </etc/postfix/smtpd.cert
    ssl_key =  # hidden, use -P to show it
    userdb {
      driver = prefetch
    }
    userdb {
      args = /etc/dovecot/dovecot-sql.conf
      driver = sql
    }
    protocol imap {
      mail_plugins = quota imap_quota
    }
    protocol pop3 {
      mail_plugins = quota
      pop3_uidl_format = %08Xu%08Xv
    }
    protocol lda {
      mail_plugins = sieve quota
      postmaster_address = [email protected]
    }
    protocol lmtp {
      mail_plugins = quota sieve
      postmaster_address = [email protected]
    }
    
    /etc/dovecot/dovecot-sql.conf
    Code:
    driver = mysql
    connect = host=localhost dbname=dbispconfig user=ispconfig password=xxxxx port=3306
    default_pass_scheme = CRYPT
    
    # password-query with prefetch
    password_query = SELECT email as user, password, maildir as userdb_home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as userdb_mail, uid as userdb_uid, gid as userdb_gid, CONCAT('*:storage=', quota, 'B') AS userdb_quota_rule, CONCAT(maildir, '/.sieve') as userdb_sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n' AND server_id = '12'
    user_query = SELECT email as user, maildir as home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n' AND server_id = '12'
    
    # The iterate_query is required for the doveadm command only and works only on dovecot 2 servers.
    # Do not enable it on Dovecot 1.x servers
    iterate_query = SELECT email as user FROM mail_user WHERE server_id = '12'
    postconf -n
    Code:
    root@mail-server:~# postconf -n
    alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
    alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
    append_dot_mydomain = no
    biff = no
    body_checks = regexp:/etc/postfix/body_checks
    broken_sasl_auth_clients = yes
    compatibility_level = 2
    content_filter = amavis:[127.0.0.1]:10024
    dovecot_destination_recipient_limit = 1
    greylisting = check_policy_service inet:127.0.0.1:10023
    header_checks = regexp:/etc/postfix/header_checks
    html_directory = /usr/share/doc/postfix/html
    inet_interfaces = all
    inet_protocols = all
    mailbox_size_limit = 0
    maildrop_destination_concurrency_limit = 1
    maildrop_destination_recipient_limit = 1
    mailman_destination_recipient_limit = 1
    message_size_limit = 0
    mime_header_checks = regexp:/etc/postfix/mime_header_checks
    mydestination = mail-server.com, localhost, localhost.localdomain
    myhostname = mail-server.com
    mynetworks = 127.0.0.0/8 [::1]/128
    myorigin = /etc/mailname
    nested_header_checks = regexp:/etc/postfix/nested_header_checks
    owner_request_special = no
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $sender_bcc_maps $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 = /usr/share/doc/postfix
    receive_override_options = no_address_mappings
    recipient_delimiter = +
    relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
    relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
    relayhost =
    sender_bcc_maps = proxy:mysql:/etc/postfix/mysql-virtual_outgoing_bcc.cf
    smtp_connect_timeout = 120s
    smtp_sasl_auth_enable = no
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
    smtp_sasl_security_options =
    smtp_tls_exclude_ciphers = RC4, aNULL
    smtp_tls_note_starttls_offer = yes
    smtp_tls_protocols = !SSLv2,!SSLv3
    smtp_tls_security_level = may
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    smtpd_client_message_rate_limit = 100
    smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
    smtpd_error_sleep_time = 1s
    smtpd_hard_error_limit = 20
    smtpd_helo_required = yes
    smtpd_helo_restrictions = permit_sasl_authenticated, permit_mynetworks, check_helo_access regexp:/etc/postfix/helo_access, reject_invalid_hostname, reject_non_fqdn_hostname, reject_invalid_helo_hostname, reject_unknown_helo_hostname, check_helo_access regexp:/etc/postfix/blacklist_helo
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_rbl_client zen.spamhaus.org, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, check_recipient_access mysql:/etc/postfix/mysql-virtual_policy_greylist.cf
    smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
    smtpd_restriction_classes = greylisting
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_sasl_local_domain =
    smtpd_sasl_path = private/auth
    smtpd_sasl_security_options = noanonymous
    smtpd_sasl_type = dovecot
    smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql-virtual_sender_login_maps.cf
    smtpd_sender_restrictions = check_sender_access regexp:/etc/postfix/tag_as_originating.re , permit_mynetworks, permit_sasl_authenticated, check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf, check_sender_access regexp:/etc/postfix/tag_as_foreign.re
    smtpd_soft_error_limit = 10
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_exclude_ciphers = RC4, aNULL
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    smtpd_tls_loglevel = 1
    smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
    smtpd_tls_protocols = !SSLv2,!SSLv3
    smtpd_tls_received_header = yes
    smtpd_tls_security_level = may
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtpd_use_tls = yes
    transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    virtual_alias_domains =
    virtual_alias_maps = hash:/var/lib/mailman/data/virtual-mailman, proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_gid_maps = mysql:/etc/postfix/mysql-virtual_gids.cf
    virtual_mailbox_base = /var/vmail
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_maps = hash:/var/lib/mailman/data/virtual-mailman
    virtual_transport = dovecot
    virtual_uid_maps = mysql:/etc/postfix/mysql-virtual_uids.cf
    /var/log/mysql/error.log
    Code:
    2021-04-11T12:10:02.355665Z 5 [Note] Got an error reading communication packets
    2021-04-11T12:15:02.439274Z 25 [Note] Got an error reading communication packets
    2021-04-11T12:20:01.608065Z 48 [Note] Got an error reading communication packets
    2021-04-11T12:25:01.734866Z 66 [Note] Got an error reading communication packets
    2021-04-11T12:30:01.867367Z 89 [Note] Got an error reading communication packets
    2021-04-11T12:34:12.356635Z 85 [Note] Aborted connection 85 to db: 'dbispconfig' user: 'ispconfig' host: 'localhost' (Got an error reading communication packets)
    2021-04-11T12:34:12.356662Z 84 [Note] Aborted connection 84 to db: 'dbispconfig' user: 'ispconfig' host: 'localhost' (Got an error reading communication packets)
    2021-04-11T12:35:01.943357Z 106 [Note] Got an error reading communication packets
    
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Search for
    Code:
    Got an error reading communication packets
    on the forum, you will find quite some other threads on this.
     
  3. Sharone

    Sharone Member

    I looked through all of them but none of the solutions worked for me. I decided to re-install the application.
     
  4. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    And everything works now?
     

Share This Page