posted Jan 11, 2010, 4:00 PM by Chris Franklin
requires the fallowing modules:
Cache::FileCache (only if you want to use caching)

Using the Client data from xmail. countrycode_reject looks up the clients
country code and if it either listed as a hated and Or not the same as your.
It can reject or log based on your options.

1. Download to /var/MailRoot/filters/
2. Add something his to your (those NEED to be tabs between the quoted fields)

"!aex" "/var/MailRoot/filters/" "-l" "/var/MailRoot/logs/country_code_rejects.log" "-m" "us" "-g" "-d" "@@FILE" "-c"

Options for
-f : List of hated country codes (seperated by : (example: JP:TW:BR) )
-m : Your Countrys code
-i : remote ipaddress (can NOT be used with -d)
-l : log to this file
-r : Exit code 3 (aka reject for xmail)
-g : log good countries too
-d : File to get to get remote domain from (can NOT be used with -i)
-b : From address
-c : Use Caching (requires Cache::FileCache module)


Rejected only hated countries (in this case japan and Taiwan)& use caching & logging (both rejected and accepted):
"!aex" "/var/MailRoot/filters/" "-l" "/var/MailRoot/logs/country_code_rejects.log" "-f" "JP:TW" "-g" "-d" "@@FILE" "-c" "-r"

Rejected only hated countries (in this case japan and Taiwan):
"!aex" "/var/MailRoot/filters/" "-f" "JP:TW" "-r" "-d" "@@FILE"

Rejecting everything but your country:
"!aex" "/var/MailRoot/filters/" "-m" "us" "-r" "-d" "@@FILE"

Rejecting everything but your country based on incoming IP:
"!aex" "/var/MailRoot/filters/" "-m" "us" "-r" "-i" "@@REMOTEADDR"
Chris Franklin,
Jan 11, 2010, 4:01 PM