Shawn,
That config is not the standard as from the repos. As the standard one has that line commented out signifying it is the default and the default is now:
listen = *, ::
The :: is the issue here as if there is no IPV6 stack and dovecot crashes as, as a default it expects IPV6 to be there or else!
Yes, it was obvious from the systemctl status dovecot output.
I include for your amusement.
Processing triggers for dovecot-core (1:2.3.16+dfsg1-3ubuntu2.2) ... Job for dovecot.service failed because the control process exited with error code. See "systemctl status dovecot.service" and "journalctl -xeu dovecot.service" for details. invoke-rc.d: initscript dovecot, action "restart" failed. ^[[0;1;31m×^[[0m dovecot.service - Dovecot IMAP/POP3 email server Loaded: loaded (^[]8;;file://newcloud.twhg.co.uk/lib/systemd/system/dovecot.service^G/lib/systemd/system/dovecot.service^[]8;;^G; enabled;> Active: ^[[0;1;31mfailed^[[0m (Result: exit-code) since Mon 2023-09-04 10:45:29 UTC; 9ms ago Docs: ^[]8;;man:dovecot(1)^Gman:dovecot(1)^[]8;;^G ^[]8;;https://doc.dovecot.org/^Ghttps://doc.dovecot.org/^[]8;;^G Process: 63336 ExecStart=/usr/sbin/dovecot -F ^[[0;1;31m(code=exited, status=89)^[[0m Main PID: 63336 (code=exited, status=89) CPU: 30ms
Sep 04 10:45:29 ourdomain dovecot[63336]: ^[[0;1;31m^[[0;1;39m^[[0;1;31mmaster: Error: service(imap-login): listen(::, 143) failed: A> Sep 04 10:45:29 ourdomain dovecot[63336]: Error: socket() failed: Address family not supported by protocol Sep 04 10:45:29 ourdomain dovecot[63336]: Error: service(imap-login): listen(::, 993) failed: Address family not supported by protocol Sep 04 10:45:29 ourdomain dovecot[63336]: ^[[0;1;31m^[[0;1;39m^[[0;1;31mmaster: Error: socket() failed: Address family not supported > Sep 04 10:45:29 ourdomain dovecot[63336]: ^[[0;1;31m^[[0;1;39m^[[0;1;31mmaster: Error: service(imap-login): listen(::, 993) failed: A> Sep 04 10:45:29 ourdomain dovecot[63336]: Fatal: Failed to start listeners Sep 04 10:45:29 ourdomain dovecot[63336]: ^[[0;1;31m^[[0;1;39m^[[0;1;31mmaster: Fatal: Failed to start listeners^[[0m Sep 04 10:45:29 ourdomain systemd[1]: ^[[0;1;39m^[[0;1;31m^[[0;1;39mdovecot.service: Main process exited, code=exited, status=89/n/a^> Sep 04 10:45:29 ourdomain systemd[1]: ^[[0;1;38;5;185m^[[0;1;39m^[[0;1;38;5;185mdovecot.service: Failed with result 'exit-code'.^[[0m Sep 04 10:45:29 ourdomain systemd[1]: ^[[0;1;31m^[[0;1;39m^[[0;1;31mFailed to start Dovecot IMAP/POP3 email server.^[[0m dpkg: error processing package dovecot-core (--configure):
Cheers
----- Original Message ----- From: "Shawn Heisey" elyograg@elyograg.org To: "dovecot" dovecot@dovecot.org Sent: Monday, 4 September, 2023 21:13:42 Subject: Re: DOvecot requires both IPv4 and IPV6 to start
On 9/4/23 12:36, Michael Peddemors wrote:
However, I 'get' this persons' opinion, from a developers perspective.
The system should either run, or provide a clear reason why it didn't startup (that reason could be .. You have selected * but IPv6 is not available). Doesn't really matter what the dependency is, whether a missing package, or a service not responding, there should be sane checks, and turning off IPv6 is probably a lot more popular than you think, given the increased attack vector and other observed issues.
But of course, the listen directive can easily be modified. Just harder for newbies looking for an 'out of the box' solution.
The following is in my /etc/dovecot/dovecot.conf file. Ubuntu 22, using the official dovecot APT repo:
# A comma separated list of IPs or hosts where to listen in for connections. # "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces. # If you want to specify non-default ports or anything more complex, # edit conf.d/master.conf. listen = *
My dovecot (version 2:2.3.20-3+ubuntu20.04) works just fine. I have IPv6 completely disabled on the server.
The comment in my config file indicates that * should be all available IPv4 interfaces, which contradicts what you said above. Maybe on my version the comment is right and for newer versions it isn't?
I have found a bunch of software that will refuse to run if IPv6 is disabled unless configured explicitly to use v4 and disable v6. I find this trend disturbing. In one case (atftpd) it took me a very long time to determine that the lack of an IPv6 interface was the cause for the program not starting. Once I figured that out, I just added "--ipv4" to the /etc/default/atftpd file and it started working.
Even if * really means "all interfaces" and not "all IPv4 interfaces" as the comment indicates ... if no IPv6 interfaces are found, dovecot should proceed with the interfaces it finds, not fail when none of those interfaces have IPv6 addressing.
To the OP: Was it obvious in logs that IPv6 was the problem? In a lot of cases programs that refuse to start without IPv6 being available will do so silently. It's the silently part that's the real problem with this trend.
Thanks, Shawn
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org