DirectAdmin Knowledge Base and Support

DirectAdmin is a web panel for a simple administration of both virtual and dedicated servers. DirectAdmin is faster, safe and more powerful than any other CP. And we know how to customize and support it.

Roundcube SMTP Error (-1): Connection to server failed

| 16:58:57 20.02.2018

Should you get an error in Roundcube "SMTP Error (-1): Connection to server failed" when trying to send emails check our case as yours might be the same. Here we will suggest a solution which worked for us.

Roundcube SMTP Error (-1): Connection to server failed

In roundcube you might see errors of the following kind:

[20-Feb-2018 07:13:42 UTC] ERROR: Conexión rehusada (111)
[20-Feb-2018 07:13:42 UTC] ERROR: Failed to connect socket: Conexión rehusada ()
[20-Feb-2018 07:13:42 +0000]: <e7lt1hgd> SMTP Error: Connection failed: Failed to connect socket: Conexión rehusada in /var/www/html/roundcubemail-1.3.4/program/lib/Roundcube/rcube.php on line 1667 (POST /roundcube/?_task=mail&_unlock=loading1519110819239&_lang=undefined&_framed=1&_action=send)

If you have CSF/LFD installed you might have SMTP_BLOCK enabled in it. So let's check:

grep ^SMTP_BLOCK /etc/csf/csf.conf

If you see SMTP_BLOCK = "1" then it mean that outgoing connections to 25, 465, 587 are forbidden. Unfortunately it blocks connections from Roundcube too.

It can be fixed without disabling SMTP block, the following way. You need to add user webapps into SMTP_ALLOWUSER and restart csf/lfd. Check:

# grep ^SMTP_ /etc/csf/csf.conf
SMTP_PORTS = "25,465,587"
SMTP_ALLOWUSER = "webapps"
SMTP_ALLOWGROUP = "mail,mailman"

Now RoundCube should have permission to connect to SMTP server.

If you still face issues, please feel free to contact us for an assistance.

About Us
We are a team of professionals, and specialize in installation, configuring and managing of remote virtual and dedicated servers powered by Linux/Unix-like OS with DirectAdmin. We support various sets of software, including web-servers Apache, Nginx; internet domain name servers Bind, PowerDNS; mail-servers with POP3, IMAP and SMTP, FTP-servers, etc. After years of working through the most complex server challenges our team has gathered valuable experience and universal solutions suitable for everyday tasks. We are here to lend you a helping hand and take care of your servers in order to let you have enough time to do more of what you love.

All of the information and data on this site is for informational purposes only and is provided for the convenience of the user.
Powered by: Amiro.CMS - Free edition