Block xz file extensions

Discuss the ConfigServer MailScanner Front-End script
2 posts Page 1 of 1
Junior Member
Posts: 2
Joined: 04 Mar 2019, 11:46


Can anyone suggest me how to block .xz file extensions? I already edited filename.rules.conf with this new line

deny \.xz$ - -

but still not working. Can anyone please help? Thanks!
Junior Member
Posts: 1373
Joined: 12 Dec 2006, 14:56

Do the following:

1. Go to /etc/mail/spamassassin/
2. Create a file with the name

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.
2 posts Page 1 of 1