Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cpanel:exim:block-email-by-domain [2016-03-23 18:47:37] (current)
rory.blanchard created
Line 1: Line 1:
 +====== How to Block E-mail by Domain in cPanel ======
  
 +To block a domain from being able to send or receive mail, use the following steps.
 +
 +Log into SSH and run the following commands:
 +
 +<note tip>
 +Make sure to replace example.com with the domain that you want to block
 +</note>
 +
 +<code>
 +touch /etc/blockeddomains
 +echo "example.com" >> /etc/blockeddomains
 +</code>
 +
 +Log into **WHM**, then go to Service Configuration > Exim Configuration Editor > Advanced Editor. In the topmostbox add the following:
 +
 +<code>
 +domainlist blocked_domains = lsearch;/etc/blockeddomains
 +</code>
 +
 +In the **ROUTER CONFIGURATION** section after the following lines:
 +
 +<code>
 +democheck:
 +driver = redirect
 +require_files = "+/etc/demouids"
 +condition = "${if eq {${lookup {$originator_uid} lsearch {/etc/demouids} {$value}}}{}{false}{true}}"
 +allow_fail
 +data = :fail: demo accounts are not permitted to relay email
 +</code>
 +
 +Add the following lines:
 +
 +<code>
 +reject_domains:
 +
 +driver = redirect
 +# RBL Blacklist incoming hosts
 +domains = blocked_domains
 +allow_fail
 +data = :fail: Connection rejected: SPAM source $domain is manually blocked.
 +</code>
 +
 +Once you have added the lines, hit **Save** at the bottom.
 +\\
 +\\
 +\\