Mail is not working SnappyMail

Server message: Can't connect to host "tcp://localhost:143"

then I executed the command

systemctl status dovecot -l

Unit dovecot.service could not be found.

the etc/dovecot folder is not on the server
what to do next?

Hello @a159cm Happy you are here

Looks like dovecot is not properly installed.

Try the following:

  1. Email Login Problem with Rainloop/Dovecot - Docs - CyberPanel Community
  2. Post the contents of journalctl -f | grep dovecot
  3. Resissue the Mailserver SSL 2 - SSL For PostFix/Dovecot - Docs - CyberPanel Community

the command is not executed yum remove yum-plugin-priorities -y
there is no such folder /etc/yum/

what to do next?

Are you using CyberPanel version v1.8.5

Current Version:

2.3

Build:

2

Current Commit:

7f428335df1180e434f1be406057c9789d8640ce

what to do next???

First of all i dont recommend CentOs 7 and I believe it should be removed from os that CyberPanel supports because of the number of issues you can come across where simple debugging compared to Ubuntu should take far less time or never happen.

As for your issue we can establish:

  1. Dovecot is not running
  2. You have mail server ssl issue

Looks like dovecot is corrupted if in all circumstances you cannot start the service. In this case the only option is to reinstall dovecot manually and god knows what issues will come up. And for dovecot to be corrupted something must have happened either an update on your server or you tinkered with configurations.

As for the mail server ssl issue here is a solution:

  1. Run rm -rf /etc/letsencrypt/live/mail.mydomain.com to remove all mail certificates
  2. Run vi /etc/dovecot/dovecot.conf to remove mail certificate directive
local_name mail.mydomain.com {
        ssl_cert = </etc/letsencrypt/live/mail.mydomain.com/fullchain.pem
        ssl_key = </etc/letsencrypt/live/mail.mydomain.com/privkey.pem
}

Then run service dovecot start && service dovecot status

I am using ubuntu 20, what you have just written above does not work

These commands are for RHEL based distro. With your reaction I can assume you not very conversant with the differences I wish you said this before.

As for the mail server ssl issue here is a solution:

  1. Run rm -rf /etc/letsencrypt/live/mail.mydomain.com to remove all mail certificates
  2. Run nano /etc/dovecot/dovecot.conf to remove mail certificate directive
local_name mail.mydomain.com {
        ssl_cert = </etc/letsencrypt/live/mail.mydomain.com/fullchain.pem
        ssl_key = </etc/letsencrypt/live/mail.mydomain.com/privkey.pem
}

Then run systemctl restart dovecot && systemctl status dovecot