How To: Use Custom Rules to Block Specific TLDs

Why would I want to block a top-level domain (TLD)?

You may wish to block an entire top-level domain (TLD) if you find yourself receiving a large amount of spam or other unwanted mail from a specific top-level domain. For instance, the TLD for Belgium is .be.

If you find yourself receiving a lot of unwanted mail from a .be address, you do not otherwise need to do business with anyone using a .be address, and all other email blocking options have been exhausted, you may wish to block any and all mail from .be addresses.

Creating a Custom Rule to Block TLDs

By creating a Message Rule, you can dictate how mail is handled based on various conditions. In this article, we will be creating a rule to quarantine any mail from a specific top-level domain.

To create a Message Rule to block TLDs:

  1. Navigate to the Mailprotector Console at emailservice.io
  2. Navigate to the Reseller, Customer, Domain, Group, or User that you'd like to create the rule for
  3. Select the "Filtering" tab
  4. Go to the "Message Rules" section
  5. Input a descriptive rule name, select the "Incoming" rule with an "Empty" template, and click the Create button
    mceclip0.png
  6. Under the "Criteria" section input the TLD domain you'd like to block in the "Sender" field.

    NOTE: You will need to use the Regex code shown below to properly block a TLD. The format for this example is: \.be$/

    mceclip3.png
  7. Navigate to the "Actions" tab
    mceclip4.png
  8. Toggle on the option "Hold For Review." This will cause the emails caught by the Message Rule to be quarantined.
    mceclip5.png
  9. Select the back arrow in the top left-hand corner
    mceclip6.png
  10. Toggle the rule on if it is showing disabled
    mceclip7.png

NOTE: To match the criteria for all TLD's that aren't related to business within the United States, you can input the Regex below into the Sender criteria. This will result in all emails containing a TLD outside of the United States to be a match on this rule.

/\.ac$|\.ad$|\.ae$|\.af$|\.ag$|\.ai$|\.al$|\.am$|\.ao$|\.aq$|\.ar$|\.as$|\.at$|\.au$|\.aw$|\.ax$|\.az$|\.ba$|\.bb$|\.bd$|\.be$|\.bf$|\.bg$|\.bh$|\.bi$|\.bj$|\.bm$|\.bn$|\.bo$|\.br$|\.bs$|\.bt$|\.bw$|\.by$|\.bz$|\.ca$|\.cc$|\.cd$|\.cf$|\.cg$|\.ch$|\.ci$|\.ck$|\.cl$|\.cm$|\.cn$|\.co$|\.cr$|\.cu$|\.cv$|\.cw$|\.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uy$|\.uz$|\.va$|\.vc$|\.ve$|\.vg$|\.vi$|\.vn$|\.vu$|\.wf$|\.ws$|\.ye$|\.yt$|\.za$|\.zm$|\.zw$/

For Further Assistance

For further assistance, please contact Mailprotector Support.

Have more questions? Submit a request

Comments