GICT knowledge base
How to Fix SMTP Error (-1): Connection to Server Failed
Published
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.
3) Edit the configuration file by clicking “Firewall Configuration” in “ConfigServer Security & Firewall”.
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.
Related guides
How to Install and Uninstall JetBackup for cPanel
How to Install JetBackup for cPanel. JetBackup is one of the leading backup solutions for cPanel & WHM that offers a user-friendly GUI. It provides
WHMSetup SendGrid on your cPanel VPS/Server
Setup SendGrid on your cPanel VPS/Server. SendGrid provides a cloud-based service for reliable transactional and marketing email.
WHMChange cPanel Nameserver Software to PowerDNS Carefully
Review WHM nameserver selection, resolver dependencies, cluster compatibility and DNSSEC requirements before a planned PowerDNS service change.
WHMTroubleshooting Jailed Shell on OpenVZ
cPanel/WHM providing Jailed shell environment for users, this feature giving high-level security for users when doing ssh access to their server.


