Postfix offline - SASL error

Discussion in 'Installation/Configuration' started by NueX, Nov 24, 2020.

  1. NueX

    NueX Member

    Unfortunately, restoring dovecot-sql.conf does not solve the issue.
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Just tested on a test system if I could login with a custom login name - seems like it doesn't work, though it might be a misconfiguration aswell, never used it.

    The connection refused issue seems like something is not working, but you have no failed services. Have you tried rebooting the system? What is the output of
    Code:
    systemctl status dovecot
    ?
     
  3. NueX

    NueX Member

    Tried rebooting, did not help.
    Code:
    # 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 Tue 2020-11-24 22:06:28 CET; 1min 9s ago
         Docs: man:dovecot(1)
               http://wiki2.dovecot.org/
     Main PID: 29693 (dovecot)
        Tasks: 7 (limit: 4915)
       Memory: 6.0M
       CGroup: /system.slice/dovecot.service
               ├─29693 /usr/sbin/dovecot -F
               ├─29694 dovecot/anvil
               ├─29695 dovecot/log
               ├─29696 dovecot/config
               ├─29698 dovecot/auth
               ├─29699 dovecot/stats
               └─29700 dovecot/auth -w
    
    Nov 24 22:06:28 xxx.xxxx.de systemd[1]: Started Dovecot IMAP/POP3 email server.
    Nov 24 22:06:28 xxx.xxxx.de dovecot[29693]: master: Dovecot v2.3.4.1 (f79e8e7e4) starting up for imap, pop3, lmtp (core dumps disabled)
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    My guess is that the connection refused issues are from a service restart, when postfix receives an email and you restart dovecot at that moment, then you'll get such an error.

    Probably some other the SQL queries have been changed with the 3.2.1 update, as a short-term solution copying back the whole /etc/postfix and /etc/dovecot config file set might help, just take care to back up the current directories before trying this. Or @Jesse Norell might chime in as he has probably the deepest insight into what might cause this.
     
  5. NueX

    NueX Member

    Thanks a lot for your support! Copying the backup /etc/postfix and /etc/dovecot brought it back to life.
     
  6. NueX

    NueX Member

    I suspect the difference in /etc/postfix/, here all the diffs:
    Code:
    # diff etc/postfix /etc/postfix
    diff etc/postfix/mysql-virtual_email2email.cf /etc/postfix/mysql-virtual_email2email.cf
    5a6
    >            AND EXISTS (SELECT domain_id FROM mail_domain WHERE domain = SUBSTRING_INDEX('%s', '@', -1) AND active = 'y' AND server_id = 1)
    7a9
    >            AND EXISTS (SELECT domain_id FROM mail_domain WHERE domain = SUBSTRING_INDEX('%s', '@', -1) AND active = 'y' AND server_id = 1)
    diff etc/postfix/mysql-virtual_gids.cf /etc/postfix/mysql-virtual_gids.cf
    5c5,6
    < query = select gid from mail_user where email = '%s' and postfix = 'y' and server_id = 1
    ---
    > query = SELECT gid FROM mail_user WHERE email = '%s' AND postfix = 'y' AND server_id = 1
    >            AND EXISTS (SELECT domain_id FROM mail_domain WHERE domain = SUBSTRING_INDEX('%s', '@', -1) AND active = 'y' AND server_id = 1)
    diff etc/postfix/mysql-virtual_mailboxes.cf /etc/postfix/mysql-virtual_mailboxes.cf
    5c5,6
    < query = select CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') from mail_user where email = '%s' and postfix = 'y' and disabledeliver = 'n' and server_id = 1
    ---
    > query = SELECT CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') FROM mail_user WHERE email = '%s' AND postfix = 'y' AND disabledeliver = 'n' AND server_id = 1
    >            AND EXISTS (SELECT domain_id FROM mail_domain WHERE domain = SUBSTRING_INDEX('%s', '@', -1) AND active = 'y' AND server_id = 1)
    diff etc/postfix/mysql-virtual_outgoing_bcc.cf /etc/postfix/mysql-virtual_outgoing_bcc.cf
    7c7,9
    <               FROM mail_user WHERE email = '%s' AND disablesmtp = 'n' AND sender_cc != '' AND server_id = 1
    ---
    >               FROM mail_user
    >              WHERE email = '%s' AND disablesmtp = 'n' AND sender_cc != '' AND server_id = 1
    >                AND EXISTS (SELECT domain_id FROM mail_domain WHERE domain = SUBSTRING_INDEX('%s', '@', -1) AND active = 'y' AND server_id = 1)
    15a18
    >                AND EXISTS (SELECT domain_id FROM mail_domain WHERE domain = SUBSTRING_INDEX('%s', '@', -1) AND active = 'y' AND server_id = 1)
    diff etc/postfix/mysql-virtual_policy_greylist.cf /etc/postfix/mysql-virtual_policy_greylist.cf
    7a8
    >       AND EXISTS (SELECT domain_id FROM mail_domain WHERE domain = SUBSTRING_INDEX('%s', '@', -1) AND active = 'y' AND server_id = 1)
    9c10
    <    SELECT `greylisting`, 2 as `prio` FROM `mail_forwarding` WHERE `server_id` = 1 AND `source` = '%s'
    ---
    >    SELECT `greylisting`, 2 as `prio` FROM `mail_forwarding` WHERE `server_id` = 1 AND `source` = '%s' AND active = 'y'
    11c12
    <    SELECT `greylisting`, 3 as `prio` FROM `mail_forwarding` WHERE `server_id` = 1 AND `source` = '@%d' ORDER BY `prio` ASC LIMIT 1
    ---
    >    SELECT `greylisting`, 3 as `prio` FROM `mail_forwarding` WHERE `server_id` = 1 AND `source` = '@%d' AND active = 'y' ORDER BY `prio` ASC LIMIT 1
    diff etc/postfix/mysql-virtual_sender_login_maps.cf /etc/postfix/mysql-virtual_sender_login_maps.cf
    7c7,8
    <         SELECT email FROM mail_user WHERE email = '%s' AND disablesmtp = 'n' AND server_id = 1;
    ---
    >         SELECT email FROM mail_user WHERE email = '%s' AND disablesmtp = 'n' AND server_id = 1
    >            AND EXISTS (SELECT domain_id FROM mail_domain WHERE domain = SUBSTRING_INDEX('%s', '@', -1) AND active = 'y' AND server_id = 1)
    diff etc/postfix/mysql-virtual_uids.cf /etc/postfix/mysql-virtual_uids.cf
    5c5,6
    < query = select uid from mail_user where email = '%s' and postfix = 'y' and server_id = 1
    ---
    > query = SELECT uid FROM mail_user WHERE email = '%s' AND postfix = 'y' AND server_id = 1
    >            AND EXISTS (SELECT domain_id FROM mail_domain WHERE domain = SUBSTRING_INDEX('%s', '@', -1) AND active = 'y' AND server_id = 1)
    
     
  7. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Code:
     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 = '1' AND EXISTS (SELECT domain_id FROM mail_domain WHERE domain = '%d' AND active = 'y' AND server_id = 1)
    Yeah, this wouldn't account for an alternative login name without a domain name. Many postfix queries were similarly changed, that'll need reworked.
     
  8. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

  9. NueX

    NueX Member

    @Jesse Norell Thanks for taking over! Maybe I should just change to mail address type login to get away from this topic... ;)
     
    Th0m likes this.
  10. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

  11. NueX

    NueX Member

    @Jesse Norell Great, thanks! Seems to work and solves the issue!
     
    Th0m likes this.

Share This Page