SMTP Error (): Connection to server failed

I have installed Hestiacp on Debain 12.

When going to Roundcube in Hestiacp I got the following error.

I fixed it with below command.

chown -R hestiamail:hestiamail /etc/roundcube/
find /etc/roundcube/ -type f -iname "*php" -exec chmod 640 {} \;

When trying to send an e-mail from Roundcube Webmail in Hestiacp, the following error appears.

SMTP Error (): Connection to server failed.

See the screenshot

How to fix this?

Show the output of these commands:

lsof -Pn +c0 -i:25,465,587 -sTCP:LISTEN
grep localhost /etc/hosts

Also, try to connect to your local smtp server on port 587:

Note: if you don’t have telnet installed, install it: apt install telnet

telnet localhost 587

If above command doesn’t connect, try this:

telnet 587

My guess is that your localhost is pointing to ::1 but it is not able to connect over IPv6, well, show the results and will see how to fix it.



I have these problems with Debain 12

Debain 11 does not have these problems.

Edit /etc/hosts files and add this line at top: localhost

Save the file and try again, if that doesn’t work, edit again the /etc/hosts file and comment this line:

::1 localhost ip6-localhost ip6-loopback

So it will look like this:

#::1 localhost ip6-localhost ip6-loopback
1 Like

Thank you very much


‘ localhost’ After adding this I can send E-mail. E-mail is working fine now

Thank you again

1 Like

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