How to fix SMTP Error (-1): Connection to server failed in RoundCube?

There should be so many reasons if you get the error Error (-1): Connection to server failed while trying to send the emails from the cPanel.

We can fix this error by performing the following steps.

Method 1

Before starting the troubleshooting of this error, we need to make sure the exim is running. To check it, connect your VPS with SSH using the root user and execute the following command in your terminal.

# service exim status

1. If the exim status is disabled, you will see the below error.

Exim Status Disabled

2. Start the exim service by entering the below command.

# service exim start

3. Exim should run fine now.

Exim is running

Method 2

If exim is running and still you are getting the same error, then please follow the below steps.

1. Open CSF firewall in vi editor.

# vi /etc/csf/csf.conf

2. Commonly, the issue should be with the following code.


3. Change the value in SMTP_ALLOWLOCAL to 1 and restart the CSF firewall.

Restart the CSF firewall

4. Enter the below command to restart the CSF.

# csf -r

Restart CSF

This is now the exim mail server should be working, and you will be able to send the emails from the RoundCube.

Was this answer helpful?

« Back


/* */