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.
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
- If the exim status is disabled, you will see the below error.
- Start the exim service by entering below command.
# service exim start
- Exim should run fine now.
If exim is running and still you are getting the same error then please follow the below steps.
- Open CSF firewall in vi editor.
# vi /etc/csf/csf.conf
- Commonly the issue should be with the following code.
SMTP_BLOCK = 1
SMTP_ALLOWLOCAL = 0
- Change the value in SMTP_ALLOWLOCAL to 1 and restart the CSF firewall.
- 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.