Cannot login to mail

I have 2 sites added to my cyber panel so far,
I am unable to login to emails using snappymail since attempting to repair ssl.
One of the domains kept on coming up with a self signed cert even though sslchecker was showing a lets encrypt cert, I remembered reading that after deleting a site cyberpanel does not delete the old certs/folders and i had previously setup this site and deleted it at the beginning, so i have manually gone and removed the old certs and folder from /etc/letsencrypt/live/mail.domain.co.uk

after this i have rebooted the server and now i cannot login to mail for both domains.
Snappy mail gives me this error

Can’t connect to server
Server message: Can’t connect to host “tcp://localhost:143”

Any ideas?

I have already run the cyberpanel upgrade script
I am on cyberpanel v2.3 on ubuntu 22.04

Thanks

Welcome @craig Happy you are here

  1. Have you tried to reissue the certificates to domains via CyberPanel?
  2. Run ss -ltnp as sudouser or root. Post the result here
  3. Run systemctl status dovecot -l && systemctl restart dovecot See if issue is fixed

Thank you Joseph,
Yes i have tried re issuing ssl but still the same, looking at the last error the Chambersandharrison file is the one i deleted, it was the original site i had created and deleted when i started setting up cyberpanel and i have since created it again without the capital C

This was the contents of etc/letsencrypt/live before i deleted anything so you can see what i mean

chambersandharrison.co.uk mail.chambersandharrison.co.uk mail.maryportcomputers.co.uk mail.maryportcomputers.website maryportcomputers.website ult:\ exit-code)\ since\ Tue\ 2022-11-01\ 18:54:
host.maryportcomputers.co.uk mail.Chambersandharrison.co.uk Mail.maryportcomputers.co.uk maryportcomputers.co.uk tatus=89)

root@vmi1056718:/etc/letsencrypt/live# ss -ltnp
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 100 0.0.0.0:587 0.0.0.0:* users:((“master”,pid=61034,fd=18))
LISTEN 0 511 127.0.0.1:6379 0.0.0.0:* users:((“redis-server”,pid=533,fd=6))
LISTEN 0 100 127.0.0.1:11211 0.0.0.0:* users:((“lsmcd”,pid=520,fd=22),(“lsmcd”,pid=519,fd=22),(“lsmcd”,pid=518,fd=22),(“lsmcd”,pid=517,fd=22),(“lsmcd”,pid=516,fd=22),(“lsmcd”,pid=507,fd=22))
LISTEN 0 4096 127.0.0.1:783 0.0.0.0:* users:((“spamd child”,pid=1736,fd=5),(“spamd child”,pid=1735,fd=5),(“spamd”,pid=710,fd=5))
LISTEN 0 4096 0.0.0.0:80 0.0.0.0:* users:((“litespeed”,pid=1766,fd=13),(“litespeed”,pid=1759,fd=13))
LISTEN 0 4096 0.0.0.0:80 0.0.0.0:* users:((“litespeed”,pid=1765,fd=12),(“litespeed”,pid=1759,fd=12))
LISTEN 0 4096 0.0.0.0:80 0.0.0.0:* users:((“litespeed”,pid=1764,fd=11),(“litespeed”,pid=1759,fd=11))
LISTEN 0 4096 0.0.0.0:80 0.0.0.0:* users:((“litespeed”,pid=1763,fd=10),(“litespeed”,pid=1759,fd=10))
LISTEN 0 4096 0.0.0.0:80 0.0.0.0:* users:((“litespeed”,pid=1762,fd=9),(“litespeed”,pid=1759,fd=9))
LISTEN 0 4096 0.0.0.0:80 0.0.0.0:* users:((“litespeed”,pid=1761,fd=8),(“litespeed”,pid=1759,fd=8))
LISTEN 0 100 0.0.0.0:465 0.0.0.0:* users:((“master”,pid=61034,fd=22))
LISTEN 0 128 0.0.0.0:53 0.0.0.0:* users:((“pdns_server”,pid=1723,fd=7))
LISTEN 0 9 0.0.0.0:21 0.0.0.0:* users:((“pure-ftpd-mysql”,pid=1081,fd=4))
LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:((“sshd”,pid=529,fd=3))
LISTEN 0 4096 127.0.0.1:3000 0.0.0.0:* users:((“nghttpx”,pid=512,fd=5),(“nghttpx”,pid=485,fd=5))
LISTEN 1 100 0.0.0.0:25 0.0.0.0:* users:((“master”,pid=61034,fd=13))
LISTEN 0 200 0.0.0.0:8090 0.0.0.0:* users:((“lscpd”,pid=55121,fd=6),(“lscpd”,pid=55116,fd=6))
LISTEN 0 4096 0.0.0.0:443 0.0.0.0:* users:((“litespeed”,pid=1766,fd=21),(“litespeed”,pid=1759,fd=21))
LISTEN 0 4096 0.0.0.0:443 0.0.0.0:* users:((“litespeed”,pid=1765,fd=18),(“litespeed”,pid=1759,fd=18))
LISTEN 0 4096 0.0.0.0:443 0.0.0.0:* users:((“litespeed”,pid=1764,fd=17),(“litespeed”,pid=1759,fd=17))
LISTEN 0 4096 0.0.0.0:443 0.0.0.0:* users:((“litespeed”,pid=1763,fd=16),(“litespeed”,pid=1759,fd=16))
LISTEN 0 4096 0.0.0.0:443 0.0.0.0:* users:((“litespeed”,pid=1762,fd=15),(“litespeed”,pid=1759,fd=15))
LISTEN 0 4096 0.0.0.0:443 0.0.0.0:* users:((“litespeed”,pid=1761,fd=14),(“litespeed”,pid=1759,fd=14))
LISTEN 0 4096 127.0.0.1:8891 0.0.0.0:* users:((“opendkim”,pid=553,fd=3))
LISTEN 0 4096 0.0.0.0:7080 0.0.0.0:* users:((“litespeed”,pid=1761,fd=34),(“litespeed”,pid=1759,fd=34))
LISTEN 0 80 127.0.0.1:3306 0.0.0.0:* users:((“mysqld”,pid=1107,fd=37))
LISTEN 0 100 [::]:587 [::]:* users:((“master”,pid=61034,fd=19))
LISTEN 0 100 [::]:465 [::]:* users:((“master”,pid=61034,fd=23))
LISTEN 0 128 [::]:53 [::]:* users:((“pdns_server”,pid=1723,fd=8))
LISTEN 0 9 [::]:21 [::]:* users:((“pure-ftpd-mysql”,pid=1081,fd=5))
LISTEN 0 128 [::]:22 [::]:* users:((“sshd”,pid=529,fd=4))
LISTEN 0 100 [::]:25 [::]:* users:((“master”,pid=61034,fd=14))
LISTEN 0 4096 *:443 : users:((“litespeed”,pid=1761,fd=28),(“litespeed”,pid=1759,fd=28))
LISTEN 0 4096 *:443 : users:((“litespeed”,pid=1762,fd=29),(“litespeed”,pid=1759,fd=29))
LISTEN 0 4096 *:443 : users:((“litespeed”,pid=1763,fd=30),(“litespeed”,pid=1759,fd=30))
LISTEN 0 4096 *:443 : users:((“litespeed”,pid=1764,fd=31),(“litespeed”,pid=1759,fd=31))
LISTEN 0 4096 *:443 : users:((“litespeed”,pid=1765,fd=32),(“litespeed”,pid=1759,fd=32))
LISTEN 0 4096 *:443 : users:((“litespeed”,pid=1766,fd=33),(“litespeed”,pid=1759,fd=33))

● dovecot.service - Dovecot IMAP/POP3 email server
Loaded: loaded (/lib/systemd/system/dovecot.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2022-11-01 18:54:08 GMT; 35s ago
Docs: man:dovecot(1)
http://wiki2.dovecot.org/
Process: 61169 ExecStart=/usr/sbin/dovecot -F (code=exited, status=89)
Main PID: 61169 (code=exited, status=89)

Nov 01 18:54:08 vmi1056718.contaboserver.net systemd[1]: Started Dovecot IMAP/POP3 email server.
Nov 01 18:54:08 vmi1056718.contaboserver.net dovecot[61169]: doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf line 96: ssl_cert: Can’t open file /etc/letsencrypt/live/mail.Chambersandharrison.co.uk/fu>
Nov 01 18:54:08 vmi1056718.contaboserver.net systemd[1]: dovecot.service: Main process exited, code=exited, status=89/n/a
Nov 01 18:54:08 vmi1056718.contaboserver.net systemd[1]: dovecot.service: Failed with result ‘exit-code’.

Run rm -rf /etc/letsencrypt/live/mail.Chambersandharrison.co.uk and any certificates with same domain also delete the website/domain if it exists

done that already, i am guessing i need to remove these lines?

file /etc/dovecot/dovecot.conf line 96: ssl_cert: Can’t open file

I dont recommend removing it directly. The direction you are going is editing

local_name mail.Chambersandharrison.co.uk {
        ssl_cert = </etc/letsencrypt/live/mail.Chambersandharrison.co.uk/fullchain.pem
        ssl_key = </etc/letsencrypt/live/mail.Chambersandharrison.co.uk/privkey.pem
}

Do it the clean way file by file:

$ sudo su -  # if not sudouser
$ rm -f /etc/letsencrypt/live/mail.Chambersandharrison.co.uk/privkey.pem && rm -f /etc/letsencrypt/live/mail.Chambersandharrison.co.uk/fullchain.pem
$ /root/.acme.sh/acme.sh --issue -d chambersandharrison.co.uk -d www.chambersandharrison.co.uk --cert-file
$ /etc/letsencrypt/live/chambersandharrison.co.uk/cert.pem --key-file 
$ /etc/letsencrypt/live/chambersandharrison.co.uk/privkey.pem --fullchain-file 
$ /etc/letsencrypt/live/chambersandharrison.co.uk/fullchain.pem -w /usr/local/lsws/Example/html --force --debug

i have done the rm command from above, here is the output for the other commands

root@vmi1056718:~# /root/.acme.sh/acme.sh --issue -d chambersandharrison.co.uk -d www.chambersandharrison.co.uk --cert-file
/etc/letsencrypt/live/chambersandharrison.co.uk/fullchain.pem -w
/home/chambersandharrison.co.uk/public_html --forcePlease specify at least one validation method: ‘–webroot’, ‘–standalone’, ‘–apache’, ‘–nginx’ or ‘–dns’ etc.
root@vmi1056718:~# /etc/letsencrypt/live/chambersandharrison.co.uk/cert.pem --key-file
-bash: /etc/letsencrypt/live/chambersandharrison.co.uk/cert.pem: Permission denied
root@vmi1056718:~# /etc/letsencrypt/live/chambersandharrison.co.uk/privkey.pem --fullchain-file
-bash: /etc/letsencrypt/live/chambersandharrison.co.uk/privkey.pem: Permission denied
root@vmi1056718:~# /etc/letsencrypt/live/chambersandharrison.co.uk/fullchain.pem -w
-bash: /etc/letsencrypt/live/chambersandharrison.co.uk/fullchain.pem: Permission denied
root@vmi1056718:~# /home/chambersandharrison.co.uk/public_html --force

Run this

$ /root/.acme.sh/acme.sh --issue -d chambersandharrison.co.uk --cert-file /etc/letsencrypt/live/chambersandharrison.co.uk/cert.pem --key-file /etc/letsencrypt/live/chambersandharrison.co.uk/privkey.pem --fullchain-file /etc/letsencrypt/live/chambersandharrison.co.uk/fullchain.pem -w /usr/local/lsws/Example/html --force --debug

that has run through and issue a lets encrypt cert

Run this

$ systemctl restart lsws && systemctl restart lscpd && systemctl start dovecot && systemctl status dovecot

If any errors or it did not work, post result of cd /etc/letsencrypt/live/ && ls

[quote=“josephgodwinke, post:10, topic:37948”]
systemctl restart lsws && systemctl restart lscpd && systemctl start dovecot && systemctl status dovecot
[/quote]that has run through correctly without error

Try to access SnappyMail now

no it is still with the same error

Can’t connect to server
Server message: Can’t connect to host “tcp://localhost:143”

Run cd /etc/letsencrypt/live/ && ls post here

root@vmi1056718:/etc/letsencrypt/live# cd /etc/letsencrypt/live/ && ls
chambersandharrison.co.uk maryportcomputers.co.uk
host.maryportcomputers.co.uk maryportcomputers.website
mail.chambersandharrison.co.uk ‘tatus=89)’
mail.maryportcomputers.co.uk ‘ult: exit-code) since Tue 2022-11-01 18:54:08 GMT; 35s ago’
Mail.maryportcomputers.co.uk ‘ult: exit-code) since Tue 2022-11-01 19:08:09 GMT; 31s ago’
mail.maryportcomputers.website
root@vmi1056718:/etc/letsencrypt/live#

Another wrong one

Post the contents of this:

$ systemctl status dovecot

root@vmi1056718:/etc/letsencrypt/live# systemctl status dovecot
● dovecot.service - Dovecot IMAP/POP3 email server
Loaded: loaded (/lib/systemd/system/dovecot.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2022-11-01 20:04:16 GMT; 59s ago
Docs: man:dovecot(1)
http://wiki2.dovecot.org/
Process: 66373 ExecStart=/usr/sbin/dovecot -F (code=exited, status=89)
Main PID: 66373 (code=exited, status=89)

Nov 01 20:04:16 vmi1056718.contaboserver.net systemd[1]: Started Dovecot IMAP/POP3 email server.
Nov 01 20:04:16 vmi1056718.contaboserver.net dovecot[66373]: doveconf: Fatal: Error in configuration fil>
Nov 01 20:04:16 vmi1056718.contaboserver.net systemd[1]: dovecot.service: Main process exited, code=exit>
Nov 01 20:04:16 vmi1056718.contaboserver.net systemd[1]: dovecot.service: Failed with result ‘exit-code’.

Previously before you raised the issue here did you change the dovecot configurations manually ?

not that i am aware of, i wouldn’t know how to change them. everything was working other than issues with ssl until i deleted that folder

Run

# see all errors
$ nano /var/log/mail.log or nano /var/log/mail.err

I dont recommend removing it directly. Run nano /etc/dovecot/dovecot.conf Find this line and change it

local_name mail.Chambersandharrison.co.uk {
        ssl_cert = </etc/letsencrypt/live/mail.Chambersandharrison.co.uk/fullchain.pem
        ssl_key = </etc/letsencrypt/live/mail.Chambersandharrison.co.uk/privkey.pem
}

Then run systemctl restart dovecot && systemctl status dovecot