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.

Fix SMTP Error

 

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

Fix SMTP Error

 

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

How to Enable Plaintext Authentication in Dovecot?

How to Enable Plaintext Authentication in Dovecot? Dovecot is an IMAP or POP3 server for...

Install Apache Tomcat using EasyApache4

Install Apache Tomcat using EasyApache4 The Apache Tomcat is an Apache module that provides a...

How to Enable Extended Logging in Exim

How to Enable Extended Logging in Exim The extended Exim logs in cPanel server will help you to...

Maximum number of connections from user+IP exceeded

Maximum number of connections from user+IP exceeded If you are getting an error like ‘ Error –...

How To Set Up Remote Access Key in WHM

How To Set Up Remote Access Key in WHM Remote Access Key is a cPanel feature that allows...