I can't send or receive emails after the server goes down due to a power outage

Hello everyone!

I have the following problem that started after the server went down due to a power outage.

Now exim is scanning ports 25, 465, 587 but I can’t send or receive emails.

Checking if port 25 is open, at dnschecker shows that port 25 is closed and all other ports such as 80, 21, 465, 587 are ok.

I spoke to the provider about the port and it is open at the provider.

I configured another machine for testing and confirmed that port 25 is in fact open at the provider.

see log trying to send

2025-06-19 05:48:02 1uRz7Y-0009EI-Fo H=xxxx-xx-xx.mail.protection.outlook.com [xx.xx.xx.xx] Connection refused
2025-06-19 05:48:02 1uRz7Y-0009EI-Fo H=xxxx-xx-xx.mail.protection.outlook.com [xx.xx.xx.xx] Connection refused
2025-06-19 05:48:02 1uRz7Y-0009EI-Fo H=xxxx-xx-xx.mail.protection.outlook.com [xx.xx.xx.xx] Connection refused
2025-06-19 05:48:02 1uRz7Y-0009EI-Fo H=xxxx-xx-xx.mail.protection.outlook.com [xx.xx.xx.xx] Connection refused
2025-06-19 05:48:02 1uRz7Y-0009EI-Fo == [email protected] R=dnslookup T=remote_smtp defer (111): Connection refused
2025-06-19 05:48:02 1uRz7Y-0009EI-Fo == [email protected] R=dnslookup T=remote_smtp defer (111): Connection refused
2025-06-19 05:48:02 1uRz7Y-0009EI-Fo == [email protected] R=dnslookup T=remote_smtp defer (111): Connection refused

Listening ports

root@server:~# lsof -Pn +c0 -i:25,465,587 -sTCP:LISTEN
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
exim4 196812 Debian-exim 4u IPv4 584574 0t0 TCP *:465 (LISTEN)
exim4 196812 Debian-exim 5u IPv4 584575 0t0 TCP *:587 (LISTEN)
exim4 196812 Debian-exim 6u IPv4 584576 0t0 TCP *:25 (LISTEN)

And more interesting is that even on the intranet testing with telnet on another server on the same network as the connection refused on port 25 and port 465 shows connected.

root@cloud:~# telnet 172.20.168.57 25
Trying 172.20.168.57...
telnet: Unable to connect to remote host: Connection refused

root@cloud:~# telnet 172.20.168.57 465
Trying 172.20.168.57...
Connected to 172.20.168.57.
Escape character is '^]'.
quit

Connection closed by foreign host.

Even with the firewall stopped, I can’t connect to port 25 even though I’m on the same intranet.
The site is accessible externally and locally, I can ping it, but the email has this problem.

Has anyone ever encountered this type of problem?

172.20.168.57 is a local ip adress.. So that explain why it doesn’t work

Hello @eris

This IP shown is local, the tests on the external IP show the same thing and it is rejected. I just highlighted the local IP because it is an internal network, but it is still rejected by the hestiacp server.

Hi @marcelomt

Would you mind sharing your server’s public IP so we can test it? If you don’t want to share it publicly, send me a private message.

Maybe some data or file system got corrupted after the power outage.

Show the output of these commands:

iptables -S
systemctl status exim4 --no-pager -l
systemctl restart exim4
systemctl status exim4 --no-pager -l
tail -n20 /var/log/exim4/mainlog
tail -n20 /var/log/exim4/paniclog
1 Like

@sas friend, how are you?

root@server:~# iptables -S
-P INPUT DROP
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-N fail2ban-HESTIA
-N fail2ban-MAIL
-N fail2ban-RECIDIVE
-N fail2ban-SSH
-N fail2ban-WEB
-N hesitate
-A INPUT -p tcp -m tcp --dport 2031 -j fail2ban-HESTIA
-A INPUT -p tcp -m multiport --dports 25,465,587,110,995,143,993 -j fail2ban-MAIL
-A INPUT -p tcp -m tcp --dport 22 -j fail2ban-SSH
-A INPUT -p tcp -m multiport --dports 1:65535 -j fail2ban-RECIDIVE
-A INPUT -p tcp -m multiport --dports 80,443 -j fail2ban-WEB
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -s 172.20.168.57/32 -j ACCEPT
-A INPUT -s 127.0.0.1/32 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 21 -m conntrack --ctstate NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 4190 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 2322 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 80,443 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 12000:12100 -j ACCEPT
-A INPUT -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 25,2525,465,587 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 110,995 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 143,993 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 2031 -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A fail2ban-HESTIA -j RETURN
-A fail2ban-MAIL -j RETURN
-A fail2ban-RECIDIVE -j RETURN
-A fail2ban-SSH -j RETURN
-A fail2ban-WEB -j RETURN
root@server:~# systemctl status exim4 --no-pager -l
● exim4.service - LSB: exim Mail Transport Agent 
Loaded: loaded (/etc/init.d/exim4; generated) 
Active: active (running) since Thu 2025-06-19 09:01:04 -04; 19min ago 
Docs: man:systemd-sysv-generator(8) 
Process: 214575 ExecStart=/etc/init.d/exim4 start (code=exited, status=0/SUCCESS) 
Tasks: 1 (limit: 36008) 
Memory: 17.6M 
CPU: 645ms 
CGroup: /system.slice/exim4.service 
└─214826 /usr/sbin/exim4 -bd -q30m

Jun 19 09:01:03 server.qosinfo.net.br systemd[1]: Starting LSB: exim Mail Transport Agent...
Jun 19 09:01:03 server.qosinfo.net.br exim4[214575]: * Starting MTA
Jun 19 09:01:04 server.qosinfo.net.br exim4[214575]: ...done.
Jun 19 09:01:04 server.qosinfo.net.br systemd[1]: Started LSB: exim Mail Transport Agent.
root@server:~# systemctl restart exim4
root@server:~# systemctl status exim4 --no-pager -l
● exim4.service - LSB: exim Mail Transport Agent 
Loaded: loaded (/etc/init.d/exim4; generated) 
Active: active (running) since Thu 2025-06-19 09:21:45 -04; 8s ago 
Docs: man:systemd-sysv-generator(8) 
Process: 217199 ExecStart=/etc/init.d/exim4 start (code=exited, status=0/SUCCESS) 
Tasks: 1 (limit: 36008) 
Memory: 17.9M 
CPU: 559ms 
CGroup: /system.slice/exim4.service 
└─217450 /usr/sbin/exim4 -bd -q30m

Jun 19 09:21:45 server.qosinfo.net.br systemd[1]: Starting LSB: exim Mail Transport Agent...
Jun 19 09:21:45 server.qosinfo.net.br exim4[217199]: * Starting MTA
Jun 19 09:21:45 server.qosinfo.net.br exim4[217199]: ...done.
Jun 19 09:21:45 server.qosinfo.net.br systemd[1]: Started LSB: exim Mail Transport Agent.
root@server:~# tail -n20 /var/log/exim4/mainlog
2025-06-19 09:01:07 1uRz7Y-0009EI-Fo == [email protected] R=dnslookup T=remote_smtp defer (111): Connection refused
2025-06-19 09:01:08 1uRzJY-0009Zx-Uw H=xxxx.xx.xx.mail.protection.outlook.com [xx.xx.xx.xx] Connection refused
2025-06-19 09:01:09 1uRzJY-0009Zx-Uw H=xxxx.xx.xx.mail.protection.outlook.com [xx.xx.xx.xx] Connection refused
2025-06-19 09:01:10 1uRzJY-0009Zx-Uw H=xxxx.xx.xx.mail.protection.outlook.com [xx.xx.xx.xx] Connection refused
2025-06-19 09:01:11 1uRzJY-0009Zx-Uw H=xxxx.xx.xx.mail.protection.outlook.com [xx.xx.xx.xx] Connection refused
2025-06-19 09:01:11 1uRzJY-0009Zx-Uw == [email protected] R=dnslookup T=remote_smtp defer (111): Connection refused
2025-06-19 09:07:04 dovecot_plain authenticator failed for c-73-144-27-228.hsd1.mi.comcast.net (heidese) [xx.xx.xx.xx]: 535 Incorrect authentication data ([email protected])
2025-06-19 09:21:45 exim 4.95 daemon started: pid=217450, -q30m, listening for SMTP on port 587 (IPv4) port 25 (IPv4) port 2525 (IPv4) and for SMTPS on port 465 (IPv4)
2025-06-19 09:21:46 1uRz7Y-0009EI-Fo H=xxxx.xx.xx.mail.protection.outlook.com [xx.xx.xx.xx] Connection refused
2025-06-19 09:21:46 1uRz7Y-0009EI-Fo H=xxxx.xx.xx.mail.protection.outlook.com [xx.xx.xx.xx] Connection refused
2025-06-19 09:21:46 1uRz7Y-0009EI-Fo H=xxxx.xx.xx.mail.protection.outlook.com [xx.xx.xx.xx] Connection refused
2025-06-19 09:21:46 1uRz7Y-0009EI-Fo H=xxxx.xx.xx.mail.protection.outlook.com [xx.xx.xx.xx] Connection refused
2025-06-19 09:21:46 1uRz7Y-0009EI-Fo == [email protected] R=dnslookup T=remote_smtp defer (111): Connection refused
2025-06-19 09:21:46 1uRz7Y-0009EI-Fo == [email protected] R=dnslookup T=remote_smtp defer (111): Connection refused
2025-06-19 09:21:46 1uRz7Y-0009EI-Fo == [email protected] R=dnslookup T=remote_smtp defer (111): Connection refused
2025-06-19 09:21:47 1uRzJY-0009Zx-Uw H=xxxx.xx.xx.mail.protection.outlook.com [xx.xx.xx.xx] Connection refused
2025-06-19 09:21:47 1uRzJY-0009Zx-Uw H=xxxx.xx.xx.mail.protection.outlook.com [xx.xx.xx.xx] Connection refused
2025-06-19 09:21:47 1uRzJY-0009Zx-Uw H=xxxx.xx.xx.mail.protection.outlook.com [xx.xx.xx.xx] Connection refused
2025-06-19 09:21:48 1uRzJY-0009Zx-Uw H=xxxx.xx.xx.mail.protection.outlook.com [xx.xx.xx.xx] Connection refused
2025-06-19 09:21:48 1uRzJY-0009Zx-Uw == [email protected] R=dnslookup T=remote_smtp defer (111): Connection refused
root@server:~# tail -n20 /var/log/exim4/paniclog
root@server:~# 
1 Like

I would like to say that port 25 did not stop working due to a power outage, because it would be very strange for a whole system to have a problem with just one port among so many others that are open.

Well, the fact is that the port miraculously started working again yesterday.

I believe it was a problem with my provider.

I would like to especially thank @sahsanu who offered to help solve the problem.

Thanks, friend.

2 Likes