> Wow this could prove quite useful; however, are there instances where an
> IP could be in the US but uses a non standard TLD?

TLD matching only happens when a TLD is detected. Therefore if the sender
is a .com or .biz .etc nothing is matched.

I thought about also using TLD's as a failover if geoip didn't work but
geoip with the latest maxmind db is 98% accurate they claim and it seems
to work great for me.

I have a very harsh country scoring setup too because we use white listing.

## GeoIP settings
@geoip_score = (
#ISO-3166 COUNTRY CODE, NO MATCH,     MATCH,   LOG NAME
 "AF",                  0,              10,      "AFGHANISTAN",
 "AX",                  0,              10,      "ALAND ISLANDS",
 "AL",                  0,              10,      "ALBANIA",
 "DZ",                  0,              10,      "ALGERIA",
 "AS",                  0,              10,      "AMERICAN SAMOA",
 "AD",                  0,              10,      "ANDORRA",
 "AO",                  0,              10,      "ANGOLA",
 "AI",                  0,              10,      "ANGUILLA",
 "AQ",                  0,              10,      "ANTARCTICA",
 "AG",                  0,              10,      "ANTIGUA AND BARBUDA",
 "AR",                  0,              10,      "ARGENTINA",
 "AM",                  0,              10,      "ARMENIA",
 "AW",                  0,              10,      "ARUBA",
 "AU",                  0,              2,      "AUSTRALIA",
 "AT",                  0,              2,      "AUSTRIA",
 "AZ",                  0,              10,      "AZERBAIJAN",
 "BS",                  0,              10,      "BAHAMAS",
 "BH",                  0,              10,      "BAHRAIN",
 "BD",                  0,              10,      "BANGLADESH",
 "BB",                  0,              10,      "BARBADOS",
 "BY",                  0,              10,      "BELARUS",
 "BE",                  0,              0,      "BELGIUM",
 "BZ",                  0,              10,      "BELIZE",
 "BJ",                  0,              10,      "BENIN",
 "BM",                  0,              10,      "BERMUDA",
 "BT",                  0,              10,      "BHUTAN",
 "BO",                  0,              10,      "BOLIVIA",
 "BA",                  0,              6,      "BOSNIA AND HERZEGOVINA",
 "BW",                  0,              10,      "BOTSWANA",
 "BV",                  0,              10,      "BOUVET ISLAND",
 "BR",                  0,              10,      "BRAZIL",
 "IO",                  0,              10,      "BRITISH INDIAN OCEAN
TERRITORY",
 "BN",                  0,              10,      "BRUNEI DARUSSALAM",
 "BG",                  0,              6,      "BULGARIA",
 "BF",                  0,              10,      "BURKINA FASO",
 "BI",                  0,              10,      "BURUNDI",
 "KH",                  0,              10,      "CAMBODIA",
 "CM",                  0,              10,      "CAMEROON",
 "CA",                  0,              0,      "CANADA",
 "CV",                  0,              10,      "CAPE VERDE",
 "KY",                  0,              10,      "CAYMAN ISLANDS",
 "CF",                  0,              10,      "CENTRAL AFRICAN REPUBLIC",
 "TD",                  0,              10,      "CHAD",
 "CL",                  0,              10,      "CHILE",
 "CN",                  0,              7,      "CHINA",
 "CX",                  0,              10,      "CHRISTMAS ISLAND",
 "CC",                  0,              10,      "COCOS KEELING ISLANDS",
 "CO",                  0,              10,      "COLOMBIA",
 "KM",                  0,              10,      "COMOROS",
 "CG",                  0,              10,      "CONGO",
 "CD",                  0,              10,      "CONGO THE DEMOCRATIC
REPUBLIC OF THE",
 "CK",                  0,              10,      "COOK ISLANDS",
 "CR",                  0,              10,      "COSTA RICA",
 "CI",                  0,              10,      "COTE DIVOIRE",
 "HR",                  0,              0,      "CROATIA",
 "CU",                  0,              0,      "CUBA",
 "CY",                  0,              2,      "CYPRUS",
 "CZ",                  0,              0,      "CZECH REPUBLIC",
 "DK",                  0,              0,      "DENMARK",
 "DJ",                  0,              10,      "DJIBOUTI",
 "DM",                  0,              10,      "DOMINICA",
 "DO",                  0,              10,      "DOMINICAN REPUBLIC",
 "EC",                  0,              10,      "ECUADOR",
 "EG",                  0,              10,      "EGYPT",
 "SV",                  0,              10,      "EL SALVADOR",
 "GQ",                  0,              10,      "EQUATORIAL GUINEA",
 "ER",                  0,              10,      "ERITREA",
 "EE",                  0,              10,      "ESTONIA",
 "ET",                  0,              10,      "ETHIOPIA",
 "FK",                  0,              10,      "FALKLAND ISLANDS MALVINAS",
 "FO",                  0,              10,      "FAROE ISLANDS",
 "FJ",                  0,              10,      "FIJI",
 "FI",                  0,              2,      "FINLAND",
 "FR",                  0,              2,      "FRANCE",
 "GF",                  0,              10,      "FRENCH GUIANA",
 "PF",                  0,              10,      "FRENCH POLYNESIA",
 "TF",                  0,              10,      "FRENCH SOUTHERN
TERRITORIES",
 "GA",                  0,              10,      "GABON",
 "GM",                  0,              10,      "GAMBIA",
 "GE",                  0,              10,      "GEORGIA",
 "DE",                  0,              2,      "GERMANY",
 "GH",                  0,              10,      "GHANA",
 "GI",                  0,              0,      "GIBRALTAR",
 "GR",                  0,              4,      "GREECE",
 "GL",                  0,              10,      "GREENLAND",
 "GD",                  0,              10,      "GRENADA",
 "GP",                  0,              10,      "GUADELOUPE",
 "GU",                  0,              10,      "GUAM",
 "GT",                  0,              10,      "GUATEMALA",
 "GG",                  0,              0,      "GUERNSEY",
 "GN",                  0,              10,      "GUINEA",
 "GW",                  0,              10,      "GUINEABISSAU",
 "GY",                  0,              10,      "GUYANA",
 "HT",                  0,              10,      "HAITI",
 "HM",                  0,              10,      "HEARD ISLAND AND
MCDONALD ISLANDS",
 "VA",                  0,              10,      "HOLY SEE VATICAN CITY
STATE",
 "HN",                  0,              10,      "HONDURAS",
 "HK",                  0,              7,      "HONG KONG",
 "HU",                  0,              0,      "HUNGARY",
 "IS",                  0,              0,      "ICELAND",
 "IN",                  0,              4,      "INDIA",
 "ID",                  0,              10,      "INDONESIA",
 "IR",                  0,              10,      "IRAN ISLAMIC REPUBLIC OF",
 "IQ",                  0,              10,      "IRAQ",
 "IE",                  0,              0,      "IRELAND",
 "IM",                  0,              0,      "ISLE OF MAN",
 "IL",                  0,              3,      "ISRAEL",
 "IT",                  0,              4,      "ITALY",
 "JM",                  0,              10,      "JAMAICA",
 "JP",                  0,              7,      "JAPAN",
 "JE",                  0,              0,      "JERSEY",
 "JO",                  0,              10,      "JORDAN",
 "KZ",                  0,              10,      "KAZAKHSTAN",
 "KE",                  0,              10,      "KENYA",
 "KI",                  0,              6,      "KIRIBATI",
 "KP",                  0,              7,      "KOREA, DEMOCRATIC PEOPLES
REPUBLIC OF",
 "KR",                  0,              7,      "KOREA, REPUBLIC OF",
 "KW",                  0,              10,      "KUWAIT",
 "KG",                  0,              10,      "KYRGYZSTAN",
 "LA",                  0,              10,      "LAO PEOPLES DEMOCRATIC
REPUBLIC",
 "LV",                  0,              5,      "LATVIA",
 "LB",                  0,              10,      "LEBANON",
 "LS",                  0,              10,      "LESOTHO",
 "LR",                  0,              10,      "LIBERIA",
 "LY",                  0,              10,      "LIBYAN ARAB JAMAHIRIYA",
 "LI",                  0,              5,      "LIECHTENSTEIN",
 "LT",                  0,              10,      "LITHUANIA",
 "LU",                  0,              3,      "LUXEMBOURG",
 "MO",                  0,              10,      "MACAO",
 "MK",                  0,              6,      "MACEDONIA",
 "MG",                  0,              10,      "MADAGASCAR",
 "MW",                  0,              10,      "MALAWI",
 "MY",                  0,              10,      "MALAYSIA",
 "MV",                  0,              10,      "MALDIVES",
 "ML",                  0,              10,      "MALI",
 "MT",                  0,              10,      "MALTA",
 "MH",                  0,              10,      "MARSHALL ISLANDS",
 "MQ",                  0,              10,      "MARTINIQUE",
 "MR",                  0,              10,      "MAURITANIA",
 "MU",                  0,              10,      "MAURITIUS",
 "YT",                  0,              10,      "MAYOTTE",
 "MX",                  0,              10,      "MEXICO",
 "FM",                  0,              10,      "MICRONESIA, FEDERATED
STATES OF",
 "MD",                  0,              6,      "MOLDOVA",
 "MC",                  0,              3,      "MONACO",
 "MN",                  0,              10,      "MONGOLIA",
 "ME",                  0,              10,      "MONTENEGRO",
 "MS",                  0,              0,      "MONTSERRAT",
 "MA",                  0,              10,      "MOROCCO",
 "MZ",                  0,              10,      "MOZAMBIQUE",
 "MM",                  0,              10,      "MYANMAR",
 "NA",                  0,              10,      "NAMIBIA",
 "NR",                  0,              10,      "NAURU",
 "NP",                  0,              10,      "NEPAL",
 "NL",                  0,              2,      "NETHERLANDS",
 "AN",                  0,              10,      "NETHERLANDS ANTILLES",
 "NC",                  0,              1,      "NEW CALEDONIA",
 "NZ",                  0,              5,      "NEW ZEALAND",
 "NI",                  0,              10,      "NICARAGUA",
 "NE",                  0,              10,      "NIGER",
 "NG",                  0,              10,      "NIGERIA",
 "NU",                  0,              10,      "NIUE",
 "NF",                  0,              10,      "NORFOLK ISLAND",
 "MP",                  0,              10,      "NORTHERN MARIANA ISLANDS",
 "NO",                  0,              3,      "NORWAY",
 "OM",                  0,              10,      "OMAN",
 "PK",                  0,              10,      "PAKISTAN",
 "PW",                  0,              10,      "PALAU",
 "PS",                  0,              10,      "PALESTINIAN TERRITORY
OCCUPIED",
 "PA",                  0,              10,      "PANAMA",
 "PG",                  0,              10,      "PAPUA NEW GUINEA",
 "PY",                  0,              10,      "PARAGUAY",
 "PE",                  0,              10,      "PERU",
 "PH",                  0,              10,      "PHILIPPINES",
 "PN",                  0,              10,      "PITCAIRN",
 "PL",                  0,              6,      "POLAND",
 "PT",                  0,              3,      "PORTUGAL",
 "PR",                  0,              10,      "PUERTO RICO",
 "QA",                  0,              10,      "QATAR",
 "RE",                  0,              10,      "RfUNION",
 "RO",                  0,              6,      "ROMANIA",
 "RU",                  0,              6,      "RUSSIAN FEDERATION",
 "RW",                  0,              10,      "RWANDA",
 "SH",                  0,              10,      "SAINT HELENA",
 "KN",                  0,              10,      "SAINT KITTS AND NEVIS",
 "LC",                  0,              10,      "SAINT LUCIA",
 "PM",                  0,              10,      "SAINT PIERRE AND MIQUELON",
 "VC",                  0,              10,      "SAINT VINCENT AND THE
GRENADINES",
 "WS",                  0,              10,      "SAMOA",
 "SM",                  0,              10,      "SAN MARINO",
 "ST",                  0,              10,      "SAO TOME AND PRINCIPE",
 "SA",                  0,              10,      "SAUDI ARABIA",
 "SN",                  0,              10,      "SENEGAL",
 "RS",                  0,              6,      "SERBIA",
 "SC",                  0,              10,      "SEYCHELLES",
 "SL",                  0,              5,      "SIERRA LEONE",
 "SG",                  0,              4,      "SINGAPORE",
 "SK",                  0,              10,      "SLOVAKIA",
 "SI",                  0,              10,      "SLOVENIA",
 "SB",                  0,              10,      "SOLOMON ISLANDS",
 "SO",                  0,              10,      "SOMALIA",
 "ZA",                  0,              6,      "SOUTH AFRICA",
 "GS",                  0,              10,      "SOUTH GEORGIA AND THE
SOUTHSANDWICH ISLANDS",
 "ES",                  0,              4,      "SPAIN",
 "LK",                  0,              10,      "SRI LANKA",
 "SD",                  0,              10,      "SUDAN",
 "SR",                  0,              10,      "SURINAME",
 "SJ",                  0,              10,      "SVALBARD AND JAN MAYEN",
 "SZ",                  0,              10,      "SWAZILAND",
 "SE",                  0,              3,      "SWEDEN",
 "CH",                  0,              3,      "SWITZERLAND",
 "SY",                  0,              10,      "SYRIAN ARAB REPUBLIC",
 "TW",                  0,              10,      "TAIWAN, PROVINCE OF CHINA",
 "TJ",                  0,              10,      "TAJIKISTAN",
 "TZ",                  0,              10,      "TANZANIA UNITED REPUBLIC
OF",
 "TH",                  0,              10,      "THAILAND",
 "TL",                  0,              10,      "TIMOR-LESTE",
 "TG",                  0,              10,      "TOGO",
 "TK",                  0,              10,      "TOKELAU",
 "TO",                  0,              10,      "TONGA",
 "TT",                  0,              10,      "TRINIDAD AND TOBAGO",
 "TN",                  0,              10,      "TUNISIA",
 "TR",                  0,              10,      "TURKEY",
 "TM",                  0,              10,      "TURKMENISTAN",
 "TC",                  0,              10,      "TURKS AND CAICOS ISLANDS",
 "TV",                  0,              10,      "TUVALU",
 "UG",                  0,              10,      "UGANDA",
 "UA",                  0,              10,      "UKRAINE",
 "AE",                  0,              10,      "UNITED ARAB EMIRATES",
 "GB",                  0,              0,      "UNITED KINGDOM",
 "US",                  0,              0,      "UNITED STATES",
 "UM",                  0,              0,      "UNITED STATES MINOR
OUTLYING ISLANDS",
 "UY",                  0,              0,      "URUGUAY",
 "UZ",                  0,              10,      "UZBEKISTAN",
 "VU",                  0,              10,      "VANUATU",
 "VE",                  0,              10,      "VENEZUELA",
 "VN",                  0,              10,      "VIETNAM",
 "VG",                  0,              10,      "VIRGIN ISLANDS, BRITISH",
 "VI",                  0,              10,      "VIRGIN ISLANDS US",
 "WF",                  0,              10,      "WALLIS AND FUTUNA",
 "EH",                  0,              10,      "WESTERN SAHARA",
 "YE",                  0,              10,      "YEMEN",
 "ZM",                  0,              10,      "ZAMBIA",
 "ZW",                  0,              10,      "ZIMBABWE",

# add as much as you need, adjust the score accordingly
# codes:
#http://www.iso.org/iso/fr/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html
# country spam ratings
#http://www.spamshield.org/maps/spamworld-withdefault.html
);





____________________________________________________________
Policyd-weight Mailinglist - http://www.policyd-weight.org/

Reply via email to