Do the following:
1. Go to /etc/mail/spamassassin/
2. Create a file with the name blackTLDs.cf
3. In that file write the following rule:
Code: Select all
header BLOCK_TLDS From =~ /\.(icu|ninja|xyz)[>]?\n/i
describe BLOCK_TLDS blackTLDs rule
score BLOCK_TLDS 22
4. Save your file and that's it, MailControl will start to block all the emails that the from domain ends with any of the words writen, in this example it will block any of the following:
Modify the header line to suit your needs, in my example I am blocking all the domains that ends with .icu, .ninja and .xyz.
If you only need to block one TLD, then set that line to:
header BLOCK_TLDS From =~ /\.xyz[>]?\n/i
Use it with caution, it will not harm your server but you could block any domain name ending on what you set.
So, after you set the rule in production, go to you WHM / ConfigServer MailScanner FE and watch what domains are blocked.
By the way, if there is customer of yours that wants to receive any of the blocked TLDs, ask him to write a rule in MailScanner inside cPanel under Black / White List Settings.
PS: I am not in any away responsible of any wrong doing of the above rule, use it at your own risk. If you don't know what the rule is about, don't add it at your server. The rule only has been tested in a cPanel/WHM server.