Debian – Netstat display wrong process associated to listening port

debiannetstat

When I do netstat -tanup as root on my Debian host, process 1/init is displayed for port 993. How is this possible ? I never saw such behavior.

The command systemctl list-sockets shows the correct service dovecot associated to port 993.

EDIT: I noticed another strange thing: Sytemd reports that davecot is listening on port 143 (imap) and dovecot is configured to not listen on port 143. I get a warning in the logs about that: dovecot: master: Error: systemd listens on port 143, but it's not configured in Dovecot. Closing.: 2 Time(s)

Best Answer

By default dovecot run pop , imap , pop3 and imaps on the following ports:

110: pop
143: imap
995: pop3s
993: imaps

install dovecot-pop3d then copy dovecot.socket to /etc/systemd

sudo cp /lib/systemd/system/dovecot.socket /etc/systemd/system/
sudo systemctl reenable dovecot.socket

Modify dovecot.socket:

sudo sed -i '/:143$/s/^/#/' /etc/systemd/system/dovecot.socket

Restart the service:

sudo systemctl stop dovecot.service
sudo systemctl start dovecot.socket
sudo systemctl daemon-reload

Check the status:

sudo systemctl status dovecot.socket
Related Question