CyberPanel Community

ClosedCannot login to mail

Cr
Craig #1

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

20 replies
jo
josephgodwinke #2

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
Cr
Craig #3

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’.

jo
josephgodwinke #4

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

Cr
Craig #5

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

jo
josephgodwinke #6

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
Cr
Craig #7

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

jo
josephgodwinke #8

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
Cr
Craig #9

that has run through and issue a lets encrypt cert

jo
josephgodwinke #10

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

Cr
Craig #11

[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

Cr
Craig #13

no it is still with the same error

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

jo
josephgodwinke #14

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

Cr
Craig #15

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#

Cr
Craig #17

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’.

jo
josephgodwinke #18

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

Cr
Craig #19

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

jo
josephgodwinke #20

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

Cr
Craig #21

ct 30 00:06:07 vmi1056718 postfix/qmgr[451730]: D3B341BA154B: from=maryp4615@mail.maryportcomputers.website, size=1117, nrcpt=1 (queue active)
Oct 30 00:06:37 vmi1056718 postfix/smtp[453603]: connect to test.com[67.225.146.248]:25: Connection timed out
Oct 30 00:06:37 vmi1056718 postfix/smtp[453603]: D3B341BA154B: to=test@test.com, relay=none, delay=131348, delays=131318/0.05/30/0, dsn=4.4.1, status=>
Oct 30 00:10:45 vmi1056718 dovecot: imap-login: Login: user=info@maryportcomputers.website, method=PLAIN, rip=80.229.11.144, lip=149.102.135.239, mpid>
Oct 30 00:10:46 vmi1056718 dovecot: imap(info@maryportcomputers.website)<454207>: Connection closed (SELECT finished 0.108 secs ago) i>
Oct 30 00:11:07 vmi1056718 postfix/qmgr[451730]: 4D98B1BA152B: from=maryp4615@Mail.maryportcomputers.co.uk, size=1133, nrcpt=1 (queue active)
Oct 30 00:11:37 vmi1056718 postfix/smtp[454212]: connect to test.com[67.225.146.248]:25: Connection timed out
Oct 30 00:11:37 vmi1056718 postfix/smtp[454212]: 4D98B1BA152B: to=test@test.com, relay=none, delay=214841, delays=214811/0.04/30/0, dsn=4.4.1, status=>
Oct 30 00:14:02 vmi1056718 postfix/submission/smtpd[454305]: connect from unknown[93.177.75.42]
Oct 30 00:14:12 vmi1056718 postfix/submission/smtpd[454305]: warning: unknown[93.177.75.42]: SASL PLAIN authentication failed:
Oct 30 00:14:12 vmi1056718 postfix/submission/smtpd[454305]: disconnect from unknown[93.177.75.42] ehlo=2 starttls=1 auth=0/1 quit=1 commands=4/5
Oct 30 00:17:32 vmi1056718 postfix/anvil[454307]: statistics: max connection rate 1/60s for (submission:93.177.75.42) at Oct 30 00:14:02
Oct 30 00:17:32 vmi1056718 postfix/anvil[454307]: statistics: max connection count 1 for (submission:93.177.75.42) at Oct 30 00:14:02
Oct 30 00:17:32 vmi1056718 postfix/anvil[454307]: statistics: max cache size 1 at Oct 30 00:14:02
Oct 30 00:25:45 vmi1056718 dovecot: imap-login: Login: user=info@maryportcomputers.website, method=PLAIN, rip=80.229.11.144, lip=149.102.135.239, mpid>
Oct 30 00:25:46 vmi1056718 dovecot: imap(info@maryportcomputers.website)<454674>: Connection closed (SELECT finished 0.100 secs ago) i>
Oct 30 00:29:03 vmi1056718 postfix/submission/smtpd[454754]: connect from unknown[193.37.255.146]
Oct 30 00:29:05 vmi1056718 postfix/submission/smtpd[454754]: warning: unknown[193.37.255.146]: SASL PLAIN authentication failed:
Oct 30 00:29:05 vmi1056718 postfix/submission/smtpd[454754]: disconnect from unknown[193.37.255.146] ehlo=2 starttls=1 auth=0/1 quit=1 commands=4/5
Oct 30 00:32:25 vmi1056718 postfix/anvil[454756]: statistics: max connection rate 1/60s for (submission:193.37.255.146) at Oct 30 00:29:03
Oct 30 00:32:25 vmi1056718 postfix/anvil[454756]: statistics: max connection count 1 for (submission:193.37.255.146) at Oct 30 00:29:03
Oct 30 00:32:25 vmi1056718 postfix/anvil[454756]: statistics: max cache size 1 at Oct 30 00:29:03
Oct 30 00:36:24 vmi1056718 postfix/smtpd[454989]: connect from unknown[193.239.164.104]
Oct 30 00:36:24 vmi1056718 postfix/smtpd[454989]: warning: unknown[193.239.164.104]: SASL LOGIN authentication failed: Invalid authentication mechanism
Oct 30 00:36:24 vmi1056718 postfix/smtpd[454989]: disconnect from unknown[193.239.164.104] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
Oct 30 00:39:44 vmi1056718 postfix/anvil[454991]: statistics: max connection rate 1/60s for (smtp:193.239.164.104) at Oct 30 00:36:24
Oct 30 00:39:44 vmi1056718 postfix/anvil[454991]: statistics: max connection count 1 for (smtp:193.239.164.104) at Oct 30 00:36:24
Oct 30 00:39:44 vmi1056718 postfix/anvil[454991]: statistics: max cache size 1 at Oct 30 00:36:24
Oct 30 00:40:03 vmi1056718 postfix/submission/smtpd[455232]: connect from unknown[89.249.73.162]
Oct 30 00:40:06 vmi1056718 postfix/submission/smtpd[455232]: warning: unknown[89.249.73.162]: SASL PLAIN authentication failed:
Oct 30 00:40:06 vmi1056718 postfix/submission/smtpd[455232]: disconnect from unknown[89.249.73.162] ehlo=2 starttls=1 auth=0/1 quit=1 commands=4/5
Oct 30 00:40:57 vmi1056718 dovecot: imap-login: Login: user=info@maryportcomputers.website, method=PLAIN, rip=80.229.11.144, lip=149.102.135.239, mpid>
Oct 30 00:40:57 vmi1056718 dovecot: imap(info@maryportcomputers.website)<455263>: Connection closed (SELECT finished 0.100 secs ago) i>
Oct 30 00:42:10 vmi1056718 dovecot: pop3-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=222.100.80.182, lip=149.102.135.239, TLS handsha>
Oct 30 00:42:25 vmi1056718 dovecot: pop3-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=222.100.80.182, lip=149.102.135.239, TLS handsha>
Oct 30 00:43:26 vmi1056718 postfix/anvil[455234]: statistics: max connection rate 1/60s for (submission:89.249.73.162) at Oct 30 00:40:03
Oct 30 00:43:26 vmi1056718 postfix/anvil[455234]: statistics: max connection count 1 for (submission:89.249.73.162) at Oct 30 00:40:03
Oct 30 00:43:26 vmi1056718 postfix/anvil[455234]: statistics: max cache size 1 at Oct 30 00:40:03

Sign in to reply