FIX: Automated ISPConfig 3 Installation - [WARN] dovecot seems not to be running!

Discussion in 'ISPConfig 3 Priority Support' started by curiousadmin, Apr 27, 2021.

  1. curiousadmin

    curiousadmin Member HowtoForge Supporter

    Hello Community,
    Thank you for posting the amazing script Perfect Server Automated ISPConfig 3 Installation on Debian 10 and Ubuntu 20.04^
    Once I finished the setup I only had one problem - the dovecot would not start.
    Code:
    [INFO] dovecot: FAILED
    [WARN] dovecot seems not to be running! (/lib/os/class.ISPConfigDebianOS.inc.php:1364)
    In my case this error occurred because I force disabled IPv6:
    nano /etc/sysctl.d/60-custom.conf
    Code:
    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    net.ipv6.conf.lo.disable_ipv6 = 1
    net.ipv6.conf.eth0.disable_ipv6 = 1
    sudo sysctl -p
    sudo systemctl restart procps
    source: https://www.linuxbabe.com/ubuntu/disable-ipv6-on-ubuntu
    If you do #systemctl status dovecot
    It's actually quite obvious what's happening:
    Code:
    # systemctl status dovecot
    ● dovecot.service - Dovecot IMAP/POP3 email server
         Loaded: loaded (/lib/systemd/system/dovecot.service; enabled; vendor preset: enabled)
         Active: failed (Result: exit-code) since Tue 2021-04-27 00:57:26 UTC; 5min ago
           Docs: man:dovecot(1)
                 http://wiki2.dovecot.org/
        Process: 200506 ExecStart=/usr/sbin/dovecot -F (code=exited, status=89)
       Main PID: 200506 (code=exited, status=89)
    
    Apr 27 00:57:26 server1 dovecot[200506]: Error: service(imap-login): listen([::], 143) failed: Address family not supported by protocol
    Apr 27 00:57:26 server1 dovecot[200506]: master: Error: service(imap-login): listen([::], 143) failed: Address family not supported by protocol
    Apr 27 00:57:26 server1 dovecot[200506]: Error: socket() failed: Address family not supported by protocol
    Apr 27 00:57:26 server1 dovecot[200506]: Error: service(imap-login): listen([::], 993) failed: Address family not supported by protocol
    Apr 27 00:57:26 server1 dovecot[200506]: Fatal: Failed to start listeners
    Apr 27 00:57:26 server1 dovecot[200506]: master: Error: socket() failed: Address family not supported by protocol
    Apr 27 00:57:26 server1 dovecot[200506]: master: Error: service(imap-login): listen([::], 993) failed: Address family not supported by protocol
    Apr 27 00:57:26 server1 dovecot[200506]: master: Fatal: Failed to start listeners
    Apr 27 00:57:26 server1 systemd[1]: dovecot.service: Main process exited, code=exited, status=89/n/a
    Apr 27 00:57:26 server1 systemd[1]: dovecot.service: Failed with result 'exit-code'.
    The fix is to disable listening on IPv6 address:
    nano /usr/local/ispconfig/server/conf-custom/install/dovecot_custom.conf.master
    add one line:
    Code:
    listen = *
    afterwards run:
    ispconfig_update.sh --force
    Credit goes to: @Etcetera (see last post)
    Old method (does not survive ISPConfig upgrade) - not recommended:
    # nano /etc/dovecot/dovecot.conf

    Change line:
    Code:
    listen = *,[::]
    To the following:
    Code:
    listen = *
    Save and quit
    Now start dovecot again:
    # systemctl start dovecot
    And check the status:
    # systemctl status dovecot
    Dovecot now works fine:
    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 2021-04-27 01:04:36 UTC; 2s ago
           Docs: man:dovecot(1)
                 http://wiki2.dovecot.org/
       Main PID: 333013 (dovecot)
          Tasks: 4 (limit: 2286)
         Memory: 3.7M
         CGroup: /system.slice/dovecot.service
                 ├─333013 /usr/sbin/dovecot -F
                 ├─333030 dovecot/anvil
                 ├─333031 dovecot/log
                 └─333032 dovecot/config
    
    Edit1: Updated method to disable IPv6 on Ubuntu 22.04
    Edit2: Added to OP better method by Etcetera
     
    Last edited: Feb 23, 2023
    Etcetera and ahrasis like this.
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Why are you disabling IPv6?? And if you really want to, why not through a firewall rule?

    IPv4 addresses are running out and there are already internet user that have a IPv6 only connection...
    https://ipv6bingo.com/
     
    Taleman likes this.
  3. curiousadmin

    curiousadmin Member HowtoForge Supporter

    Because I don't need it and and couple of ipv6bingo scenarios actually apply for me.
     
  4. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Like what? I'm curious ;)
     
  5. Etcetera

    Etcetera Member HowtoForge Supporter

    @curiousadmin, thanks, this just helped me after a failed attempt of setting up a new server with the automated script.
    Just one addition: by creating a new file /usr/local/ispconfig/server/conf-custom/install/dovecot_custom.conf.master with just the one line
    Code:
    listen = *
    and then running
    # ispconfig_update.sh --force
    the entry in /etc/dovecot/dovecot.conf is overridden, and this survives ISPConfig updates.
     
    curiousadmin likes this.

Share This Page