{"id":3122,"date":"2017-01-09T18:16:38","date_gmt":"2017-01-09T18:16:38","guid":{"rendered":"http:\/\/blog.shineservers.com\/?p=3122"},"modified":"2017-01-09T18:16:38","modified_gmt":"2017-01-09T18:16:38","slug":"block-domain-sending-email-cpanel-server","status":"publish","type":"post","link":"https:\/\/www.shineservers.com\/2017\/01\/09\/block-domain-sending-email-cpanel-server\/","title":{"rendered":"How To Block A Domain From Sending Email From My cPanel Server"},"content":{"rendered":"<p>We face this problem many times, even we mostly get this kind of issue when&nbsp;a&nbsp;user who is getting hacked a lot and the account is sending out spam emails. In that case, If you want to disable just his account from being able to send mail at all until he can get his script updated or changed.&nbsp;So here&#8217;s how we can do it:<\/p>\n<p>First, in root SSH, run these commands:<\/p>\n<blockquote><p>touch \/etc\/blockeddomains<br \/>\necho &#8220;domain.com&#8221; &gt;&gt; \/etc\/blockeddomains<\/p><\/blockquote>\n<p>Please replace&nbsp;<b>domain.com<\/b>&nbsp;with the domain name. Do not replace the &#8220;&#8221; part as that&#8217;s required, only the domain.com part with the right domain name.<\/p>\n<p>In WHM &gt; Exim Configuration Editor &gt; Advanced Configuration Editor -&gt; Click on &#8220;Add additional configuration setting&#8221; -&gt; Add::<\/p>\n<blockquote><p>domainlist blocked_domains = lsearch;\/etc\/blockeddomains<\/p><\/blockquote>\n<p>Locate the &#8220;ROUTERS CONFIGURATION&#8221; section, and right below these lines:<\/p>\n<blockquote><p>democheck:<br \/>\ndriver = redirect<br \/>\nrequire_files = &#8220;+\/etc\/demouids&#8221;<br \/>\ncondition = &#8220;${if eq {${lookup {$originator_uid} lsearch {\/etc\/demouids} {$value}}}{}{false}{true}}&#8221;<br \/>\nallow_fail<br \/>\ndata = :fail: demo accounts are not permitted to relay email<\/p><\/blockquote>\n<p>Put the following lines:<\/p>\n<blockquote><p>reject_domains:<\/p>\n<p>driver = redirect<br \/>\n# RBL Blacklist incoming hosts<br \/>\ndomains = blocked_domains<br \/>\nallow_fail<br \/>\ndata = :fail: Connection rejected: SPAM source $domain is manually blacklisted.<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>We face this problem many times, even we mostly get this kind of issue when&nbsp;a&nbsp;user who is getting hacked a lot and the account is sending out spam emails. In that case, If you want to disable just his account from being able to send mail at all until he can get his script updated [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":13383,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[58],"tags":[254,255,256,257,258,259],"class_list":["post-3122","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cpanel-control-panel","tag-block-domain","tag-block-domain-email","tag-block-exim","tag-block-mail-functions","tag-block-smtp","tag-cpanel-single-domain-email"],"acf":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts\/3122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/comments?post=3122"}],"version-history":[{"count":0,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts\/3122\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/media?parent=3122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/categories?post=3122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/tags?post=3122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}