requires the fallowing modules: Net::SenderBase Getopt::Std 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.
INSTALL 1. Download country_code_rejects.pl to /var/MailRoot/filters/country_code_rejects.pl 2. Add something his to your filter.pre-data.tab (those NEED to be tabs between the quoted fields)
"!aex" "/var/MailRoot/filters/country_code_rejects.pl" "-l" "/var/MailRoot/logs/country_code_rejects.log" "-m" "us" "-g" "-d" "@@FILE" "-c"
Options for country_code_rejects.pl -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)
Examples
Rejected only hated countries (in this case japan and Taiwan)& use caching & logging (both rejected and accepted): "!aex" "/var/MailRoot/filters/country_code_rejects.pl" "-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/country_code_rejects.pl" "-f" "JP:TW" "-r" "-d" "@@FILE"
Rejecting everything but your country: "!aex" "/var/MailRoot/filters/country_code_rejects.pl" "-m" "us" "-r" "-d" "@@FILE"
Rejecting everything but your country based on incoming IP: "!aex" "/var/MailRoot/filters/country_code_rejects.pl" "-m" "us" "-r" "-i" "@@REMOTEADDR"
|