How do I Blacklist/Whitelist Messages by Country/Continent?
To do this you need to set up a Blacklist or Whitelist Filtering Rule.
Blacklist Messages Based on Country
- In the Domain Level Control Panel, select Incoming - Protection Settings > Blacklist Filtering Rules.
- Click on + Add rule to create a new rule:
- If the Use advanced custom filtering rules option is activated in your User's Profile page, the Add a new advanced blacklist filtering rule dialog is displayed. If not activated, the Add a new simple blacklist filtering rule dialog is displayed.
- Give the rule a name in the Rule name field
- Specify the priority of this rule, this is the order in which this rule will be applied (lowest number = highest priority, highest number = lowest priority)
- In the Match dropdown, select Location
- You will see the Content Type box has now changed to Location Type - in this box you can specify which type of location you wish to match against and can be written using a regular expression.
- Write any further Regular Expressions you wish to include
- Add a flag if required in the Flags text box
- Give the rule a name in the Rule name field
- In the Match dropdown, select Country or Continent
- Ensure is or is not is selected from the 2nd dropdown, as needed.
- In the text field enter the country or continent
- "city"
- "continent"
- "country"
- "country_iso" (ISO 3166-1 alpha code)
- "reprisented_country"
- "registered country"
- "latitude"
- "longitude"
- Country Codes: https://datahub.io/core/country-list
- Continent Codes: https://datahub.io/core/continent-codes
- Click Save to add the rule. In the example below, all incoming messages from Spain will be blocked.
Advanced blacklist filtering rules
The advanced filtering rule dialogs provide a Cheatsheet of some useful features for use in regular expressions .
Simple blacklist filtering rules
If you are using a simple blacklist filtering rule, the country must be given in full - not the ISO country or continent code. However, if you are using an advanced blacklist filtering rule, the location type may be specified as one of the following:
You may find the ISO codes for country and continent here:
For example:
You can also choose to whitelist all incoming messages from a particular country/continent:
Select Incoming > Whitelist Filtering Rules and add a new rule in the same way as described above.
Unfortunately, the Technical Support team is unable to support any customization of the predefined Rulesets or those you build yourself.
Due to the potential complexity in building a regex pattern, we advise that only users with regex experience should attempt to create new rules or customize existing ones.