{"id":20360,"date":"2026-11-22T08:47:03","date_gmt":"2026-11-22T05:47:03","guid":{"rendered":"https:\/\/www.hyyat.com\/knowledgebase\/csf-smtp-block-allow-outgoing-smtp\/"},"modified":"2026-11-22T08:47:17","modified_gmt":"2026-11-22T05:47:17","password":"","slug":"csf-smtp-block-allow-outgoing-smtp","status":"publish","type":"docs","link":"https:\/\/www.hyyat.com\/en\/knowledgebase\/csf-smtp-block-allow-outgoing-smtp\/","title":{"rendered":"Sites Stopped Sending Email After Enabling CSF? Setting SMTP_BLOCK and Allowing Outgoing SMTP"},"content":{"rendered":"<div class=\"hkb\" dir=\"ltr\">\n<div class=\"hkb-tldr\"><b>In short<\/b>The <b>SMTP_BLOCK<\/b> option in CSF stops programs from connecting directly to external mail servers, so SMTP plugins on sites fail. The better fix: make sites send through the local mail server with authentication. If you need external connections, add the user to <b>SMTP_ALLOWUSER<\/b>, or set <b>SMTP_BLOCK = 0<\/b> in <b>WHM, Plugins, ConfigServer Security &amp; Firewall, Firewall Configuration<\/b>.<\/div>\n<figure class=\"hkb-fig\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.hyyat.com\/zasogooh\/2026\/11\/hkb-tr-13413-en.webp\" alt=\"Sites Stopped Sending Email After Enabling CSF? Setting SMTP_BLOCK and Allowing Outgoing SMTP\" width=\"1200\" height=\"630\" loading=\"lazy\" \/><\/figure>\n<div class=\"hkb-note\"><b>This guide is for server owners<\/b> if you have a VPS or dedicated server with WHM. If you would rather not manage the server yourself, our <a href=\"https:\/\/www.hyyat.com\/en\/server-management\/\">server management<\/a> service can do it for you.<\/div>\n<p>After enabling the CSF firewall, some sites may stop sending email, especially those using an SMTP plugin to send through Gmail or another external service. The cause is usually <b>SMTP_BLOCK<\/b>, which stops anything other than the mail server from connecting to external SMTP ports. The option is useful because it stops hacked scripts from sending spam.<\/p>\n<h2>The better fix: keep the protection<\/h2>\n<p>Make sites send through the mail server on the same machine: host <code>localhost<\/code> or <code>mail.domain<\/code>, port 587 or 465, with a real mailbox and password. SMTP_BLOCK stays on, and mail is DKIM-signed for your domain.<\/p>\n<h2>If you need to reach an external server<\/h2>\n<ol class=\"hkb-steps\">\n<li><b>Log in to WHM<\/b> in your browser at <code>https:\/\/server-IP:2087<\/code> or <code>https:\/\/server-hostname:2087<\/code> as root.<\/li>\n<li><b>Open Plugins,<\/b> then <b>ConfigServer Security &amp; Firewall<\/b>.<\/li>\n<li><b>Click Firewall Configuration<\/b> to open the settings file.<\/li>\n<li><b>Find SMTP_ALLOWUSER<\/b> and add the cPanel username that needs external access. This is better than turning the protection off for everyone.<\/li>\n<li><b>Or set SMTP_BLOCK = 0<\/b> to turn the block off for all accounts, if you accept that.<\/li>\n<li><b>Save and restart CSF<\/b> with <b>Change<\/b>, then <b>Restart csf+lfd<\/b>.<\/li>\n<\/ol>\n<figure class=\"hkb-fig hkb-shot\"><img decoding=\"async\" src=\"https:\/\/www.hyyat.com\/zasogooh\/2019\/03\/Configure-CSF1.png\" alt=\"The Plugins section in WHM\" loading=\"lazy\" \/><\/figure>\n<figure class=\"hkb-fig hkb-shot\"><img decoding=\"async\" src=\"https:\/\/www.hyyat.com\/zasogooh\/2019\/03\/Configure-CSF2.png\" alt=\"Opening ConfigServer Security &amp; Firewall\" loading=\"lazy\" \/><\/figure>\n<figure class=\"hkb-fig hkb-shot\"><img decoding=\"async\" src=\"https:\/\/www.hyyat.com\/zasogooh\/2019\/03\/Configure-CSF3.png\" alt=\"The Firewall Configuration button in CSF\" loading=\"lazy\" \/><\/figure>\n<figure class=\"hkb-fig hkb-shot\"><img decoding=\"async\" src=\"https:\/\/www.hyyat.com\/zasogooh\/2019\/03\/Configure-CSF4-1024x432.png\" alt=\"The SMTP_BLOCK option in CSF settings\" loading=\"lazy\" \/><\/figure>\n<div class=\"hkb-note\"><b>Careful:<\/b> WHM has a similar option, <b>SMTP Restrictions<\/b> in the Security Center. Do not enable it together with SMTP_BLOCK; use one or the other.<\/div>\n<div class=\"hkb-hh\">\n<h2>Summary<\/h2>\n<ul>\n<li>SMTP_BLOCK stops direct connections to external mail servers.<\/li>\n<li>Sending through the local mail server with authentication is better.<\/li>\n<li>For exceptions, use SMTP_ALLOWUSER instead of turning protection off.<\/li>\n<\/ul>\n<p style=\"margin:10px 0 0\">Need a server with cPanel and WHM? See <a href=\"https:\/\/www.hyyat.com\/en\/vps-hosting\/\">VPS servers<\/a> and <a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/cpanel-whm-on-vps\/\">the cPanel and WHM on VPS guide<\/a>.<\/p>\n<\/div>\n<h2>Frequently asked questions<\/h2>\n<div class=\"hkb-faq\">\n<details>\n<summary>Why does my site not send email after enabling CSF?<\/summary>\n<p>Usually SMTP_BLOCK is stopping an SMTP plugin from connecting to an external mail server.<\/p>\n<\/details>\n<details>\n<summary>Should I turn SMTP_BLOCK off?<\/summary>\n<p>Preferably not. Send through the local mail server, or exempt the specific user with SMTP_ALLOWUSER.<\/p>\n<\/details>\n<\/div>\n<div class=\"hkb-rel\"><b>Related guides<\/b><\/p>\n<ul>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/vps-server-security\/\">VPS Server Security: The Essential Steps After You Get Your Server<\/a><\/li>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/enable-spf-dkim-cpanel\/\">How to Enable SPF and DKIM in cPanel<\/a><\/li>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/cpanel-whm-on-vps\/\">cPanel and WHM on a VPS \u2014 The Complete 2026 Guide: What They Are, Licensing, and When to Choose Them<\/a><\/li>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/install-cpanel-whm\/\">How to Install cPanel and WHM on Your Server<\/a><\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.hyyat.com\/en\/kb\/whm-cpanel-control-panels\/\">All guides in this section \u2192<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In shortThe SMTP_BLOCK option in CSF stops programs from connecting directly to external mail servers, so SMTP plugins on sites fail. The better fix: make sites send through the local mail server with authentication. If you need external connections, add the user to SMTP_ALLOWUSER, or set SMTP_BLOCK = 0 in WHM, Plugins, ConfigServer Security &amp; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":20334,"comment_status":"open","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"_templately_pack_id":"","_templately_imported_at":"","_templately_source":"","_templately_import_session_id":"","footnotes":""},"doc_category":[2734],"doc_tag":[],"class_list":["post-20360","docs","type-docs","status-publish","has-post-thumbnail","hentry","doc_category-whm-cpanel-control-panels"],"year_month":"2026-11","word_count":444,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"admin","author_nicename":"admin","author_url":"https:\/\/www.hyyat.com\/en\/author\/admin\/"},"doc_category_info":[{"term_name":"WHM\/cPanel","term_url":"https:\/\/www.hyyat.com\/en\/kb\/whm-cpanel-control-panels\/"}],"doc_tag_info":[],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs\/20360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/comments?post=20360"}],"version-history":[{"count":0,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs\/20360\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/media\/20334"}],"wp:attachment":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/media?parent=20360"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/doc_category?post=20360"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/doc_tag?post=20360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}