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 this error we need to make sure the exim is running. To check it connect your VPS with SSH using root user execute the following command in your terminal.

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



  2. Start the exim service by entering below command.

    # service exim start
  3. Exim should run fine now.



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.

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



  4. Enter the below command to restart the CSF.

    # csf -r
    


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

  • 0 Users Found This Useful

Was this answer helpful?