Using PEP to block email by country or charset | Islandnet Blog
Please consider switching to our new and improved hosting service: Islandhosting.com
For support call:     778-410-2454

Using PEP to block email by country or charset

PEP is really powerful and you can write custom commands and put them in the Custom Rules sections of the PEP Mailrule Wizard.

Some subject or from address lines are in a foreign character set using a technique called Character Encoding and generally these begin with =? followed by a string of charecters and then ending with ?= which tells the system the character set to use and what to encode, eg:

=?ISO-8859-2?Q?Grzegorz_=A6lusarek?=

To Filter out these you can use:

delete if from contains "=?"
delete if subject contains "=?"

or you can amalgamate the test using...:

delete if from,subject contains "=?"

The likelihood that either of these would contain a =? in any other context is unlikely so you should not end up filtering other email but if you do we have the Email Archive from which you can restore your mail going back months and months.

You can also test content-type of an email,  eg:

delete if content-type contains "koi8-r"

koi8-r is the following char set http://en.wikipedia.org/wiki/KOI8-R

Another one that is useful to add to Custom Rules in the

delete if content-type contains "ISO-2022-JP"

Read more about this one at: http://en.wikipedia.org/wiki/ISO/IEC_2022

You can also delete by GeoIP like so:

delete if X-GeoIP-Code is "PL"
delete if X-GeoIP-Code is "LT"
delete if X-GeoIP-Code is "VN"
delete if X-GeoIP-Code is "EG"
delete if X-GeoIP-Code is "KR"
delete if X-GeoIP-Code is "TR"
delete if X-GeoIP-Code is "SA"
delete if X-GeoIP-Code is "RU"
delete if X-GeoIP-Code is "KG"
delete if X-GeoIP-Code is "RO"
delete if X-GeoIP-Code is "BR"
delete if X-GeoIP-Code is "IN"

For a list of GeoIP county codes see: https://helpdesk.islandnet.com/help/iso3166.txt

Read more about PEP in https://hd.islandnet.com/view-knowledgebase/3-email