2

Attempting to start dovecot gives me this:

Apr 28 13:37:00 master: Error: service(pop3-login): listen(*, 110) failed: Address already in use
Apr 28 13:37:00 master: Error: service(pop3-login): listen(*, 995) failed: Address already in use
Apr 28 13:37:00 master: Error: service(imap-login): listen(*, 143) failed: Address already in use
Apr 28 13:37:00 master: Error: service(imap-login): listen(*, 993) failed: Address already in use

And 'netstat -tulpn' displays this:

tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN      3369/master
tcp        0      0 0.0.0.0:52125               0.0.0.0:*                   LISTEN      2396/rpc.statd
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      3244/mysqld
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      2375/rpcbind
tcp        0      0 :::22                       :::*                        LISTEN      2562/sshd
tcp        0      0 :::25                       :::*                        LISTEN      3369/master
tcp        0      0 :::443                      :::*                        LISTEN      3390/httpd
tcp        0      0 :::39631                    :::*                        LISTEN      2396/rpc.statd
tcp        0      0 :::111                      :::*                        LISTEN      2375/rpcbind
tcp        0      0 :::80                       :::*                        LISTEN      3390/httpd
udp        0      0 0.0.0.0:68                  0.0.0.0:*                               2236/dhclient
udp        0      0 0.0.0.0:111                 0.0.0.0:*                               2375/rpcbind
udp        0      0 10.0.82.190:123             0.0.0.0:*                               2589/ntpd
udp        0      0 127.0.0.1:123               0.0.0.0:*                               2589/ntpd
udp        0      0 0.0.0.0:123                 0.0.0.0:*                               2589/ntpd
udp        0      0 0.0.0.0:43243               0.0.0.0:*                               2396/rpc.statd
udp        0      0 0.0.0.0:854                 0.0.0.0:*                               2375/rpcbind
udp        0      0 127.0.0.1:876               0.0.0.0:*                               2396/rpc.statd
udp        0      0 :::111                      :::*                                    2375/rpcbind
udp        0      0 :::854                      :::*                                    2375/rpcbind
udp        0      0 :::54504                    :::*                                    2396/rpc.statd

Any idea what I'm missing here?

UPDATE:

selinux is disabled, and the distro is AWX Linux:

$ getenforce
Disabled

$ uname -a
Linux ip-10-0-82-190 4.14.268-139.500.amzn1.x86_64 #1 SMP Wed Mar 2 18:48:10 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
6
  • 1
    Is dovecot binding to the ports as root? Only root can bind to ports below 1024. Commented Apr 29, 2022 at 16:52
  • I am running dovecot as root. Also, as stated the dovecot log says the ports are in use.
    – user646372
    Commented Apr 29, 2022 at 16:56
  • What distribution are you using? Selinux could also prevent it. Commented Apr 29, 2022 at 17:25
  • 2
    Check the effective configuration (after parsing dovecot.conf and all includes) with dovecot -n and maybe see: serverfault.com/a/1017158/960939
    – Rob
    Commented May 3, 2022 at 6:26
  • 1
    It was portreserve! What a shifty piece of crap! Repost as an answer and I'll award the bounty.
    – user646372
    Commented May 3, 2022 at 13:52

1 Answer 1

3
+50

dovecot would appear to not be aware of (compatible with) portreserve.

Check /etc/portreserve for configuration files that are reserving ports you need and remove them from scope (e.g. rename them with ~). Alternatively you can add portrelease to your dovecot init scripts to release the necessary ports just prior to starting dovecot.

It's worth noting this errata (https://access.redhat.com/errata/RHSA-2020:1062) which leads to this bug report ("Dovecot should use portrelease to avoid port conflicts with NFSv4 mounts" https://bugzilla.redhat.com/show_bug.cgi?id=1570283). These would appear to tie it closer to a portreseve defect which is antagonized by NFSv4. It is not clear to me that the errata actually fixes the problem as the bug report only provides some context and perhaps a workaround.

I don't think this can be fixed on dovecot side - and fixing portreserve should fix this. SUNRPC has known disadvantage of randomly assigning rpc ports 665-1023 (well - not completely randomly - it is something like 6XX+pid which results in regular issues with 993/995 ports on certain systems) - thus when NFSv4 is in-place and it has not static ports assigned, it can consume randomly 993/995 port.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .