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)


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
  • Why do you tell me to install dovecot-pop3d if I only need and use imaps ? Does the sed line simply comment out lines with port 143 ? – chmike Oct 27 '16 at 12:27
  • Yes it will comment out lines with port 143 – GAD3R Oct 27 '16 at 12:29
  • I have test it on my debian jessie . Can you try it ? – GAD3R Oct 27 '16 at 12:31
  • 1
    I'll try it. It seam more appropriate to create a symbolic link ln -s /lib/systemd/system/dovecot.socket /etc/systemd/system as this is what has been done for ssh I see. – chmike Oct 27 '16 at 12:37
  • 1
    Ok. It works. I overwrote the /lib/systemd/system/dovecot.socket file with the commented out lines with 143 ports. Then the reeanable was required because it doesn't simply create a link. Apparently systemd updates its state. After that netstat showed dovecot instead of init. Don't know if the systemctl daemon-reload is required. – chmike Oct 27 '16 at 13:39

Without modifying files:

sudo systemctl stop dovecot.service
sudo systemctl stop dovecot.socket
sudo systemctl mask dovecot.socket
sudo systemctl start dovecot.service

and enjoy netstat -tanup ouput...

  • Do you mind explaining this magic. What does mask dovecot.socket do ? Why stopping socket and not start socket ? – chmike Mar 9 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.