How to Configure CSF to Allow Outbound SMTP?

By on October 24th, 2018

How to Configure CSF to Allow Outbound SMTP?

When we enabled CSF on the server, most of the WordPress users are having issues with sending emails. After disabling the CSF, the sender will be able to send the emails. To fix this issue, you would need to allow the SMTP on server firewall. For more information about how to do this, please follow the below steps.

1) Login to WHM.

2) Navigate to the “Plugins” section.

Outbound SMTP


3) Click on “ConfigServer Security & Firewall” to allow the outgoing SMTP on the cPanel server. CSF is a firewall to Login/Intrusion Detection for applications like SSH, SMTP, IMAP, Pop3 etc.  It also checks for login authentication failures on mail servers.

Configure CSF


4) Open “Firewall Configuration” to edit the configuration file for the csf firewall and lfd.

Configure CSF


5) Search for SMTP_BLCOK in CSF configuration file and make sure that it is disabled there. If you enable SMTP_BLOCK it will block outgoing SMTP except for root, exim, and mailman (forces scripts/users to use the exim/Sendmail binary instead of sockets access). This replaces the protection as WHM > Tweak Settings > SMTP Tweaks.

Configure CSF


After disabling the SMTP_BLOCK, please restart the Csf to reflect the changes.

You can also do the same steps via command Line.

1) Login to the server via SSH as a root user.

# ssh root@<server ip>

2) Open ConfigServer Security & Firewall configuration file by using the below command.

# vi /etc/csf/csf.conf

Search for SMTP_BLCOK and set it to 0


Then restart the CSF using the command

# csf -r


If you need any further assistance please contact our support department.



3 Responses to “How to Configure CSF to Allow Outbound SMTP?”

  1. Marc Magi says:

    If SMTP_BLOCK is enabled but you want to allow local connections to port 25
    on the server (e.g. for webmail or web scripts) then enable this option to
    allow outgoing SMTP connections to the loopback device


  2. Carlos says:

    Hello! In CSF I added the userneme of the account in the field “SMTP_ALLOWUSER” without activate the the option SMTP_BLOCK and works!

  3. Sunil says:

    I would like to block port 25/587/465/2525 ( SMTP ports ) from everywhere except my country ( India ) ?

    NOTE – PORT 80 & 443 from everywhere.

Leave a Reply