[solved] MAIL HOSTING : Dovecot won't start, all ports reacheable but 993

issue & solution. I spent 2h30 on that ( rare enough, not such a big issue, but still ), I thought it was worth documenting it, and since I did, I’ll share it here.
Maybe it can help somoene.

YunoHost server

Hardware: Proxmox 8.1.4 in a cluster of intel N100 (or alike) machines.
YunoHost version: 11.2.10.1
I have access to my server : ** through the yunohost & proxmox webadmin console (terminal), but I can setup ssh if required
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : yes

If yes, please explain:

  1. Yunohost is behind an nginx-proxy-manager

  2. I host my own little service side by side with yunohost. Only impact : i have a python venv & sshd config adaptation.

  3. Yunohost tourne derrière un nginx-proxy-manager .
    2.Je fais tourner un petit service sur le serveur yunohost. Conséquence : j’ai un venv python & j’ai adapté la config sshd à mon besoin.

Description of my issue

english

Running diagnostic I would see :

  1. Dovecot would not start.
  2. Ports 993 is not accessible “from outside”, but with similar config, all other ports where accessible.

I would then head to the host and run : telnet 127.0.0.1 993
Just to see that nothing there was listening on port 993 (could not connect locally on that port).

This rules out the “network” issue.
Problem is on the localhost itself.

I then went to see the dovecot logs. Why would not it start ?

Here is the important log extract concerned

... connect(/var/run/dovecot/auth-master)  failed: No such file or directory

french

En effectuant un diagnostic, je constaterais :

  1. Dovecot ne démarre pas.
  2. Le port 993 n’est pas accessible “de l’extérieur”, mais avec une configuration similaire, tous les autres ports étaient accessibles.

Je me dirigerais ensuite vers l’hôte et exécuterais : telnet 127.0.0.1 993
Juste pour constater qu’il n’y avait rien à l’écoute sur le port 993 (impossible de se connecter localement à ce port).

Cela élimine le problème de “réseau”.
Le problème se situe sur le localhost lui-même.

Je suis ensuite allé voir les logs de Dovecot. Pourquoi ne démarrait-il pas ?

Voici l’extrait important du log concerné

... connect(/var/run/dovecot/auth-master) failed: No such file or directory

Solution

english

If you don’t know of that file like me, quickwin is to look into your dovecot.conf file. Quick win : it’s just a socket.

protocol lda {
  auth_socket_path = /var/run/dovecot/auth-master
  mail_plugins = quota sieve
  postmaster_address = postmaster@thome.mydomain.com
}

Checked, for its presence : ls -l /var/run/dovecod/auth-master. Indeed it was not there.
So okey, let’s create it , but I need to see what user needs it.
Back to the dotecove.conf file and voilà, here is the answer

service auth {
  ...
  unix_listener auth-master {
    group = mail
    mode = 0660
    user = vmail
  }
}

Let’s create it then :

root@yunohost:/var/run/dovecot# sudo ls -l /var/run/dovecot/auth-master
-rw-r--r-- 1 root dovenull 0 Feb 24 13:14 /var/run/dovecot/auth-master
root@yunohost:/var/run/dovecot# sudo chown vmail:mail auth-master
root@yunohost:/var/run/dovecot# chmod 600 auth-master
root@yunohost:/var/run/dovecot# sudo ls -l /var/run/dovecot/auth-master
-rw------- 1 vmail mail 0 Feb 24 13:14 /var/run/dovecot/auth-master

Great, now I can restart my dovecot service, right ? Not so fast… We still did not solve the port 993 issue !
But… you know what, let’s try and see if we get more insight.

Feb 24 13:37:10 systemd[1]: Starting Dovecot IMAP/POP3 email server...
Feb 24 13:37:10 dovecot[5048]: Fatal: service(pop3) access(/usr/lib/dovecot/pop3) failed: No such file or directory
Feb 24 13:37:10 dovecot[5048]: master: Fatal: service(pop3) access(/usr/lib/dovecot/pop3) failed: No such file or directory
Feb 24 13:37:10 systemd[1]: dovecot.service: Main process exited, code=exited, status=89/n/a
Feb 24 13:37:10 systemd[1]: dovecot.service: Failed with result 'exit-code'.
Feb 24 13:37:10 systemd[1]: Failed to start Dovecot IMAP/POP3 email server.

Actually yes, I was getting to that point, but the log is a good hint : pop3 failed…
A quick seach would have revealed to anyone that port 993 is used for pop3.
The fact it was not up and listening on my localhost was another obvious clue, right ?
And that log tells us that service pop3 is not launched properly.

Reading the log, and knowing the above, it’s likely that something went wrong during installation of dovecot (incomplete ? corrupted ?), and because I just did not temper with it in this container’s prior life, I’ll just try to reinstall.
That’s quite blunt, but i looked for the pop3d files, and could not find them (quick search on internet you can find the info).

So I carried on with this part of my solution, reinstalling the service dovecot-pop3d.

sudo apt-get install --reinstall dovecot-pop3d

And well, since I’m lazy, tried to restart dovecot service.
And it works.

Now I’ll make this a “milestone”, since I need to be able to use that email service, and make a backup (that’s when I get to LOVE using proxmox, seriously).

french

Si vous ne connaissez pas ce fichier, comme moi, une solution rapide est de consulter votre fichier dovecot.conf. Indice : c’est un socket.

protocol lda {
  auth_socket_path = /var/run/dovecot/auth-master
  mail_plugins = quota sieve
  postmaster_address = postmaster@thome.mydomain.com
}

Vérifions sa présence : ls -l /var/run/dovecot/auth-master.
En effet, le fichier n’est pas là.
Pour le créer, j’ai besoin de savoir quel utilisateur en a besoin.
Retour au fichier dovecot.conf :

service auth {
  ...
  unix_listener auth-master {
    group = mail
    mode = 0660
    user = vmail
  }
}

Bah alors allons-y :

root@yunohost:/var/run/dovecot# sudo ls -l /var/run/dovecot/auth-master
-rw-r--r-- 1 root dovenull 0 24 févr. 13:14 /var/run/dovecot/auth-master
root@yunohost:/var/run/dovecot# sudo chown vmail:mail auth-master
root@yunohost:/var/run/dovecot# chmod 600 auth-master
root@yunohost:/var/run/dovecot# sudo ls -l /var/run/dovecot/auth-master
-rw------- 1 vmail mail 0 24 févr. 13:14 /var/run/dovecot/auth-master

Super, maintenant je peux redémarrer mon service dovecot, n’est-ce pas ?
Pas si vite… Nous n’avons toujours pas résolu le problème du port 993 !
Mais… vous savez quoi, essayons de voir si nous obtenons plus de détails.

24 févr. 13:37:10 systemd[1]: Starting Dovecot IMAP/POP3 email server...
24 févr. 13:37:10 dovecot[5048]: Fatal: service(pop3) access(/usr/lib/dovecot/pop3) failed: No such file or directory
24 févr. 13:37:10 dovecot[5048]: master: Fatal: service(pop3) access(/usr/lib/dovecot/pop3) failed: No such file or directory
24 févr. 13:37:10 systemd[1]: dovecot.service: Main process exited, code=exited, status=89/n/a
24 févr. 13:37:10 systemd[1]: dovecot.service: Failed with result 'exit-code'.
24 févr. 13:37:10 systemd[1]: Failed to start Dovecot IMAP/POP3 email server.

En fait oui, j’allais en venir à ce point, mais le log est un bon indice : échec de pop3…
Une recherche rapide aurait révélé à quiconque que le port 993 est utilisé pour pop3.
Et ce log nous dit que le service pop3 n’est pas lancé correctement.

En lisant le log, et sachant ce qui précède, il est probable que quelque chose s’est mal passé lors de l’installation de dovecot (installation incomplète ? corrompue ?). Donc, je vais juste essayer de réinstaller. C’est assez radical, mais j’ai cherché les fichiers pop3d, et je ne les ai pas trouvés (une recherche rapide sur internet vous donnera l’info).

J’ai donc poursuivi avec cette partie de ma solution, en réinstallant le service dovecot-pop3d.

sudo apt-get install --reinstall dovecot-pop3d

Et bien, puisque je suis paresseux, j’ai essayé de redémarrer le service dovecot.
Il démarre. Reste plus qu’à tester que tout fonctionne bien… Et à configurer correctement tout le reste.

2 Likes

Solved but I don’t know how to tag it solved.

1 Like

Hi e-jambon,

Welcome to the forums!

Thanks for posting back that you got it solved. To mark it solved, reply to your post with just your solution of reinstalling dovecot-pop3d, and mark that post as solution.

Solution

english

If you don’t know of that file like me, quickwin is to look into your dovecot.conf file. Quick win : it’s just a socket.

protocol lda {
  auth_socket_path = /var/run/dovecot/auth-master
  mail_plugins = quota sieve
  postmaster_address = postmaster@thome.mydomain.com
}

Checked, for its presence : ls -l /var/run/dovecod/auth-master. Indeed it was not there.
So okey, let’s create it , but I need to see what user needs it.
Back to the dotecove.conf file and voilà, here is the answer

service auth {
  ...
  unix_listener auth-master {
    group = mail
    mode = 0660
    user = vmail
  }
}

Let’s create it then :

root@yunohost:/var/run/dovecot# sudo ls -l /var/run/dovecot/auth-master
-rw-r--r-- 1 root dovenull 0 Feb 24 13:14 /var/run/dovecot/auth-master
root@yunohost:/var/run/dovecot# sudo chown vmail:mail auth-master
root@yunohost:/var/run/dovecot# chmod 600 auth-master
root@yunohost:/var/run/dovecot# sudo ls -l /var/run/dovecot/auth-master
-rw------- 1 vmail mail 0 Feb 24 13:14 /var/run/dovecot/auth-master

Great, now I can restart my dovecot service, right ? Not so fast… We still did not solve the port 993 issue !
But… you know what, let’s try and see if we get more insight.

Feb 24 13:37:10 systemd[1]: Starting Dovecot IMAP/POP3 email server...
Feb 24 13:37:10 dovecot[5048]: Fatal: service(pop3) access(/usr/lib/dovecot/pop3) failed: No such file or directory
Feb 24 13:37:10 dovecot[5048]: master: Fatal: service(pop3) access(/usr/lib/dovecot/pop3) failed: No such file or directory
Feb 24 13:37:10 systemd[1]: dovecot.service: Main process exited, code=exited, status=89/n/a
Feb 24 13:37:10 systemd[1]: dovecot.service: Failed with result 'exit-code'.
Feb 24 13:37:10 systemd[1]: Failed to start Dovecot IMAP/POP3 email server.

Actually yes, I was getting to that point, but the log is a good hint : pop3 failed…
A quick seach would have revealed to anyone that port 993 is used for pop3.
The fact it was not up and listening on my localhost was another obvious clue, right ?
And that log tells us that service pop3 is not launched properly.

Reading the log, and knowing the above, it’s likely that something went wrong during installation of dovecot (incomplete ? corrupted ?), and because I just did not temper with it in this container’s prior life, I’ll just try to reinstall.
That’s quite blunt, but i looked for the pop3d files, and could not find them (quick search on internet you can find the info).

So I carried on with this part of my solution, reinstalling the service dovecot-pop3d.

sudo apt-get install --reinstall dovecot-pop3d

And well, since I’m lazy, tried to restart dovecot service.
And it works.

Now I’ll make this a “milestone”, since I need to be able to use that email service, and make a backup (that’s when I get to LOVE using proxmox, seriously).

french

Si vous ne connaissez pas ce fichier, comme moi, une solution rapide est de consulter votre fichier dovecot.conf. Indice : c’est un socket.

protocol lda {
  auth_socket_path = /var/run/dovecot/auth-master
  mail_plugins = quota sieve
  postmaster_address = postmaster@thome.mydomain.com
}

Vérifions sa présence : ls -l /var/run/dovecot/auth-master.
En effet, le fichier n’est pas là.
Pour le créer, j’ai besoin de savoir quel utilisateur en a besoin.
Retour au fichier dovecot.conf :

service auth {
  ...
  unix_listener auth-master {
    group = mail
    mode = 0660
    user = vmail
  }
}

Bah alors allons-y :

root@yunohost:/var/run/dovecot# sudo ls -l /var/run/dovecot/auth-master
-rw-r--r-- 1 root dovenull 0 24 févr. 13:14 /var/run/dovecot/auth-master
root@yunohost:/var/run/dovecot# sudo chown vmail:mail auth-master
root@yunohost:/var/run/dovecot# chmod 600 auth-master
root@yunohost:/var/run/dovecot# sudo ls -l /var/run/dovecot/auth-master
-rw------- 1 vmail mail 0 24 févr. 13:14 /var/run/dovecot/auth-master

Super, maintenant je peux redémarrer mon service dovecot, n’est-ce pas ?
Pas si vite… Nous n’avons toujours pas résolu le problème du port 993 !
Mais… vous savez quoi, essayons de voir si nous obtenons plus de détails.

24 févr. 13:37:10 systemd[1]: Starting Dovecot IMAP/POP3 email server...
24 févr. 13:37:10 dovecot[5048]: Fatal: service(pop3) access(/usr/lib/dovecot/pop3) failed: No such file or directory
24 févr. 13:37:10 dovecot[5048]: master: Fatal: service(pop3) access(/usr/lib/dovecot/pop3) failed: No such file or directory
24 févr. 13:37:10 systemd[1]: dovecot.service: Main process exited, code=exited, status=89/n/a
24 févr. 13:37:10 systemd[1]: dovecot.service: Failed with result 'exit-code'.
24 févr. 13:37:10 systemd[1]: Failed to start Dovecot IMAP/POP3 email server.

En fait oui, j’allais en venir à ce point, mais le log est un bon indice : échec de pop3…
Une recherche rapide aurait révélé à quiconque que le port 993 est utilisé pour pop3.
Et ce log nous dit que le service pop3 n’est pas lancé correctement.

En lisant le log, et sachant ce qui précède, il est probable que quelque chose s’est mal passé lors de l’installation de dovecot (installation incomplète ? corrompue ?). Donc, je vais juste essayer de réinstaller. C’est assez radical, mais j’ai cherché les fichiers pop3d, et je ne les ai pas trouvés (une recherche rapide sur internet vous donnera l’info).

J’ai donc poursuivi avec cette partie de ma solution, en réinstallant le service dovecot-pop3d.

sudo apt-get install --reinstall dovecot-pop3d

Et bien, puisque je suis paresseux, j’ai essayé de redémarrer le service dovecot.
Il démarre. Reste plus qu’à tester que tout fonctionne bien… Et à configurer correctement tout le reste.

1 Like

(and by test went OK but for SoGo itself, but snapmail is just great for my usage )

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.