How to Fix SMTP Error (-1): Connection to Server Failed

How to Fix SMTP Error (-1): Connection to Server Failed

When we tried to send an email from cPanel, we got an error “SMTP Error (-1): Connection to server failed”. We can fix this issue by simply following the below steps.

Method 1

First, we need to check the status of the exim service in the server and make sure the exim is running.

# service exim status

If the exim status is active, then you can follow Method 2. Else you got an error shown below, then please follow the below command.

# service exim status

exim dead but subsys locked

If you see this error search the file /etc/eximdisable. If you found the file, then do the following steps.

# mv eximdisable eximdisable.bak

# service exim restart

 

Method 2

If the Exim status is okay, then please follow the below steps.

1) You need to edit the CSF firewall with the following code. open CSF file

# vi /etc/csf/csf.conf

most probably the issue was with the following code.

SMTP_BLOCK = 1

SMTP_ALLOWLOCAL = 0

You would need to change SMTP_ALLOWLOCAL to 1 to enable Webmail to function.

 

2) Last restart csf using the following command to enable all changes.

# csf -r

 

You can also edit the CSF configuration file using WHM.

1) Login to WHM.

2) Navigate to “ConfigServer Security & Firewall” under “Plugins” section.

How to Fix SMTP Error (-1): Connection to Server Failed

 

3) Edit the configuration file by clicking “Firewall Configuration” in “ConfigServer Security & Firewall”.

How to Fix SMTP Error (-1): Connection to Server Failed

 

Then change “SMTP_ALLOWLOCAL ” off to On.

4) Finally, you need to click on “Change” button to enable the changes and restart csf.

 

Method 3

The above fixes don’t work, please try the below fix. Here we are trying to rebuild the exim.

# mv /etc/exim.conf /etc/exim.conf_bak

/scripts/rebuildeximbsd

/scripts/eximconfgen

/scripts/eximup –force

/etc/init.d/exim restart

 

Now this will fix the error.

 

If you need any further help please do reach our support department.

 

  • 0

Install Wine on Linux Distribution

Install Wine on Linux Distribution In this tutorial, we can check how to Install Wine on Linux...

Install Apache Tomcat on Ubuntu 18.04

Install Apache Tomcat on Ubuntu 18.04 The Apache Tomcat is a free, open-source Java-based web...

How to Install and Setup Angular CLI

How to Install and Setup Angular CLIAngular is an open-source framework for your web...

How to Install Jenkins on CentOS and Ubuntu Server?

How to Install Jenkins on CentOS and Ubuntu Server? Jenkins is a free and open-source automation...

Setup ILIAS LMS on Ubuntu 18.04/16.04 with Nginx

ILIAS is an Open-Source Learning Management System. ILIAS LMS offers to develop and realizing...