Block account from sending mail WHM/cPanel

Rob —  March 28, 2014 — 1 Comment

There may come a time when you’d like to block an account / domain on your WHM/cPanel server from being able to send mail. Here’s how you’d get it done!

We’re going to set up a ‘blocked domain’ list. We’ll set it up once, then have the ability to go in and add or remove domains to the text file easily whenever we want afterwards.

First, ssh into your server and add the domain name to a new file called /etc/blockeddomains

(This will also create the file. You can cat the file to make sure it worked out:

Next, set the right ownership/permissions:

Next, load up a web browser, log into WHM and go to:
WHM –> Service Configuration –> EXIM Configuration Manager –> Advanced Editor

Scroll down within that box about 1/4 of the way, and you’ll see something similar to:

Click on “Add additional configuration setting” and fill it out like we have it in the picture:

Next, search for the string “ROUTERSTART”:

Add the following into it:

Now you’re all set. Next time you want to block a domain, simply add it to the /etc/blockeddomains file. If you want to unblock them, remove them from that file.

Related posts from Linux Brigade!

One response to Block account from sending mail WHM/cPanel

  1. Really hope that WHM/cPanel have a GUI for this and a plugin in WHMCS to block my customers from sending mails to penalize them for a few days or weeks for sending out spam.

Leave a Reply

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">