<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.2clever.uk/index.php?action=history&amp;feed=atom&amp;title=SMEServer_GeoIP</id>
	<title>SMEServer GeoIP - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.2clever.uk/index.php?action=history&amp;feed=atom&amp;title=SMEServer_GeoIP"/>
	<link rel="alternate" type="text/html" href="https://wiki.2clever.uk/index.php?title=SMEServer_GeoIP&amp;action=history"/>
	<updated>2026-08-27T02:29:46Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://wiki.2clever.uk/index.php?title=SMEServer_GeoIP&amp;diff=128&amp;oldid=prev</id>
		<title>Rdswikiadmin: Created page with &quot;copied from; https://wiki.koozali.org/GeoIP (This page was last edited on 7 September 2025, at 11:37)  {{Languages}} &lt;!-- here we define the contrib name variable --&gt; &lt;!-- we get the page title, remove suffix for translated version; if needed you can define there with the value you want--&gt; {{#vardefine:contribname| {{lc: {{#titleparts:   {{BASEPAGENAME}} |1}} }} }} {{#vardefine:smecontribname| smeserver-{{lc: {{#titleparts:   {{BASEPAGENAME}} |1}} }} }} &lt;!-- we define th...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.2clever.uk/index.php?title=SMEServer_GeoIP&amp;diff=128&amp;oldid=prev"/>
		<updated>2026-08-15T11:27:01Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;copied from; https://wiki.koozali.org/GeoIP (This page was last edited on 7 September 2025, at 11:37)  {{Languages}} &amp;lt;!-- here we define the contrib name variable --&amp;gt; &amp;lt;!-- we get the page title, remove suffix for translated version; if needed you can define there with the value you want--&amp;gt; {{#vardefine:contribname| {{lc: {{#titleparts:   {{BASEPAGENAME}} |1}} }} }} {{#vardefine:smecontribname| smeserver-{{lc: {{#titleparts:   {{BASEPAGENAME}} |1}} }} }} &amp;lt;!-- we define th...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;copied from; https://wiki.koozali.org/GeoIP (This page was last edited on 7 September 2025, at 11:37)&lt;br /&gt;
&lt;br /&gt;
{{Languages}}&lt;br /&gt;
&amp;lt;!-- here we define the contrib name variable --&amp;gt;&lt;br /&gt;
&amp;lt;!-- we get the page title, remove suffix for translated version; if needed you can define there with the value you want--&amp;gt;&lt;br /&gt;
{{#vardefine:contribname| {{lc: {{#titleparts:   {{BASEPAGENAME}} |1}} }} }}&lt;br /&gt;
{{#vardefine:smecontribname| smeserver-{{lc: {{#titleparts:   {{BASEPAGENAME}} |1}} }} }}&lt;br /&gt;
&amp;lt;!-- we define the language --&amp;gt;&lt;br /&gt;
{{#vardefine:lang| {{lc:  {{#titleparts:    {{PAGENAME}} | | -1}}  }} |en }}&lt;br /&gt;
{{Infobox contribs&lt;br /&gt;
|name={{#var:contribname}}&lt;br /&gt;
|image=contribs.png&lt;br /&gt;
|description_image= {{#var:contribname}} logo&lt;br /&gt;
|maintainer= ReetP Stephdl&lt;br /&gt;
|licence= open source&lt;br /&gt;
|url= https://www.maxmind.com&lt;br /&gt;
|category= Mail&lt;br /&gt;
|tags= Filtering Security&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This product includes GeoLite2 data created by MaxMind, available from&lt;br /&gt;
https://www.maxmind.com.&lt;br /&gt;
==Maintainer==&lt;br /&gt;
[[User:ReetP|john crisp]]&lt;br /&gt;
&lt;br /&gt;
[mailto:stephdl@de-labrusse.fr stephdl] Stéphane de Labrusse AKA [[User:stephdl|Stephdl]]&amp;lt;br /&amp;gt;&lt;br /&gt;
==Version==&lt;br /&gt;
{{#smeversion: {{#var:smecontribname}} }}&lt;br /&gt;
&lt;br /&gt;
{{Warning box|From MAXMIND site :&lt;br /&gt;
&amp;quot;Due to upcoming data privacy regulations, we are making significant changes to how you access free GeoLite2 databases starting December 30, 2019. Learn more on our blog.&amp;quot; https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/&lt;br /&gt;
&lt;br /&gt;
Quote&lt;br /&gt;
Starting December 30, 2019, we will be requiring users of our GeoLite2 databases to register for a MaxMind account and obtain a license key in order to download GeoLite2 databases. We will continue to offer the GeoLite2 databases without charge, and with the ability to redistribute with proper attribution and in compliance with privacy regulations. In addition, we are introducing a new end-user license agreement to govern your use of the GeoLite2 databases. Previously, GeoLite2 databases were accessible for download to the public on our developer website and were licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.&lt;br /&gt;
&lt;br /&gt;
Starting December 30, 2019, downloads will no longer be served from our public GeoLite2 page, from geolite.maxmind.com/download/geoip/database/*, or from any other public URL.&lt;br /&gt;
End Quote&lt;br /&gt;
&lt;br /&gt;
See the section below [[GeoIP#Installation_and_Updating_of_geoip_v2_db|Installation of V2 db ]] for steps on how to migrate to the new download mechanism.}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
The GeoIP plugin for qpsmtpd lets you know where your mail server is receiving mail from. If you&amp;#039;re receiving too much spam from a particular location, this will help track it down. You can then use that info to reject connections from that place taking the load off your server.&lt;br /&gt;
&lt;br /&gt;
{{Note box|Maxmind have removed support for their legacy v1 DBs and an update to v2 DBs is required. Please see the bugtracker link to bug #9033 below for more information }}&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabs container&amp;gt;&amp;lt;tab name=&amp;quot;SME 10&amp;quot;&amp;gt;&lt;br /&gt;
 yum install smeserver-geoip --enablerepo=smecontribs&lt;br /&gt;
Then configure your update key, create a Maxmind account and retrieve an  AccountID and LicenseKey properties and keys to the geoip db config.&lt;br /&gt;
You can also leave as is and just get the update from rpms every 2 months or so...&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;tab name=&amp;quot;SME 9&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Installation of legacy geoip v1 db====&lt;br /&gt;
&lt;br /&gt;
those are still available for few time only for back compatibility purpose and to avoid a yum update mess, or if you do not trust third party repo, but be aware thos db are not updated anymore since April 2018 and were already only 80% accurate then.&lt;br /&gt;
 yum install smeserver-geoip --enablerepo=smecontribs&lt;br /&gt;
 config set UnsavedChanges no&lt;br /&gt;
 signal-event geoip-update&lt;br /&gt;
&lt;br /&gt;
====update of geoip v1 db====&lt;br /&gt;
if you have smeserver-geoip-1.1.2-7 already installed,  this will keep you on the legacy version, only change new plugin comaptible with v1 and removal of cron update.&lt;br /&gt;
 yum update --enablerepo=smecontribs&lt;br /&gt;
&lt;br /&gt;
This is not updated anymore since 2018, you do not need the update key if you want to only use this. &lt;br /&gt;
&lt;br /&gt;
====Installation and Updating of geoip v2 db====&lt;br /&gt;
&lt;br /&gt;
As a result you will now need the OpenFusion repo to install smeserver-geoip We will be syncing their mirror in due course to speed up installs and updates.&lt;br /&gt;
 yum  --enablerepo=smeaddons install smeserver-extrarepositories-openfusion &lt;br /&gt;
 signal-event yum-modify &lt;br /&gt;
 config set UnsavedChanges no&lt;br /&gt;
&lt;br /&gt;
====Updating to v2 with v1 DBs installed====&lt;br /&gt;
If you have the v1 DBs package smeserver-geoip-1.1.2-7 already installed and do not wish to update to v2 DBs you may perform updates safely, after making sure your smeserver-extrarepositories-openfusion is the latest, the following:&lt;br /&gt;
&lt;br /&gt;
To carry out an install or update of the new v2 DBs you are required to firstly remove the exclude statement from the openfusion repo db&lt;br /&gt;
 db yum_repositories delprop openfusion Exclude &lt;br /&gt;
 signal-event yum-modify&lt;br /&gt;
You may then go ahead with the following to either install or update a v2 DB package&lt;br /&gt;
 yum install smeserver-geoip2 --enablerepo=smecontribs,openfusion&lt;br /&gt;
 yum update --enablerepo=smecontribs,openfusion&lt;br /&gt;
 config set UnsavedChanges no&lt;br /&gt;
&lt;br /&gt;
A configuration db for geoip has been created as part of the install&lt;br /&gt;
 # config show geoip&lt;br /&gt;
 geoip=service&lt;br /&gt;
    status=enabled&lt;br /&gt;
&lt;br /&gt;
====Fresh Installation of geoip v2 DBs====&lt;br /&gt;
To carry out an install or update of the new v2 DBs you are required to firstly remove the exclude statement from the openfusion repo db&lt;br /&gt;
 db yum_repositories delprop openfusion Exclude &lt;br /&gt;
 signal-event yum-modify&lt;br /&gt;
&lt;br /&gt;
You may then go ahead with the following to either install or update a v2 DB package&lt;br /&gt;
&lt;br /&gt;
 yum install smeserver-geoip2 --enablerepo=smecontribs,openfusion&lt;br /&gt;
 config set UnsavedChanges no&lt;br /&gt;
&lt;br /&gt;
A configuration db for geoip has been created as part of the install&lt;br /&gt;
 # config show geoip&lt;br /&gt;
 geoip=service&lt;br /&gt;
    status=enabled&lt;br /&gt;
&lt;br /&gt;
Now add Maxmind AccountID and LicenseKey properties and keys to the geoip db config&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Maxmind account to update db ====&lt;br /&gt;
Sign up for a MaxMind account (no purchase required) https://dev.maxmind.com/geoip/geoip2/geolite2/&lt;br /&gt;
&lt;br /&gt;
Important - Note your login details and in particular your AccountID and LicenseKey&lt;br /&gt;
&lt;br /&gt;
Go to Services My Licence key and generate a licence key, carefully note the key details, multiple keys may be created.&lt;br /&gt;
&lt;br /&gt;
The following config property keys and values will be used to set the geoip config db for ongoing updates see below&lt;br /&gt;
 AccountID #######&lt;br /&gt;
 LicenseKey xxxxxxxxxxxxxxx&lt;br /&gt;
set them in db and expand the config file&lt;br /&gt;
 db configuration setprop geoip LicenseKey &amp;quot;YOUR LIC KEY&amp;quot; AccountID &amp;quot;YOUR ACCT ID&amp;quot; &lt;br /&gt;
 expand-template  /etc/GeoIP.conf&lt;br /&gt;
&lt;br /&gt;
====Update the db====&lt;br /&gt;
 signal-event geoip-update&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
{{Note box| These tests use the V1 DB which will be increasingly out of date.}}&lt;br /&gt;
&lt;br /&gt;
Now that the package and database are installed, we can test it (refer to Country Code list at end of page as required). &lt;br /&gt;
&lt;br /&gt;
 geoiplookup 216.17.211.37 &lt;br /&gt;
&lt;br /&gt;
It should return: &lt;br /&gt;
&lt;br /&gt;
 GeoIP Country Edition: US, United States&lt;br /&gt;
&lt;br /&gt;
It gives us the country code (US) and the long name (United States). Let&amp;#039;s test it again with a domain name. &lt;br /&gt;
&lt;br /&gt;
 geoiplookup contribs.org &lt;br /&gt;
&lt;br /&gt;
Same result. So we know it works with ip addresses or domain names. Let&amp;#039;s test it again around the world. &lt;br /&gt;
&lt;br /&gt;
 geoiplookup gormand.com.au &lt;br /&gt;
&lt;br /&gt;
It should return: &lt;br /&gt;
&lt;br /&gt;
 GeoIP Country Edition: AU, Australia &lt;br /&gt;
&lt;br /&gt;
One last time:&lt;br /&gt;
&lt;br /&gt;
 geoiplookup swerts-knudsen.dk &lt;br /&gt;
&lt;br /&gt;
It should return: &lt;br /&gt;
&lt;br /&gt;
 GeoIP Country Edition: DK, Denmark&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
===Tracking e-mail===&lt;br /&gt;
The qpsmtpd GeoIP plugin should now do its work. Check the qpsmtpd logs and you&amp;#039;ll see the countries from where mail is sent. &lt;br /&gt;
&lt;br /&gt;
 cat /var/log/qpsmtpd/current &lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ll use a simple shell script to do the work then we&amp;#039;ll run it. &lt;br /&gt;
&lt;br /&gt;
First, create the the script.&lt;br /&gt;
&lt;br /&gt;
 vi geoipstats.sh&lt;br /&gt;
&lt;br /&gt;
Insert the following: Code:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh &lt;br /&gt;
 # Read the qpsmtpd log file.&lt;br /&gt;
 # Read all of the countries and count them.  &lt;br /&gt;
 cat /var/log/qpsmtpd/* | \&lt;br /&gt;
 grep &amp;#039;GeoIP Country:&amp;#039; | \&lt;br /&gt;
 sed -e &amp;#039;s/^.*\(..\)$/\1/&amp;#039; | \&lt;br /&gt;
 sort | uniq -c | sort -n &lt;br /&gt;
&lt;br /&gt;
Now run the script. It will show the number of messages sent by country code. &lt;br /&gt;
&lt;br /&gt;
 sh geoipstats.sh&lt;br /&gt;
&lt;br /&gt;
See where your mail is coming from. Now ask the question, &amp;quot;why am I receiving thousands of email from RU -Russia? I don&amp;#039;t even know anyone there.&amp;quot; Good point. In addition, your server has to process all that mail, taking resources away from the server. In the next section we&amp;#039;ll block the countries that we consider bad.&lt;br /&gt;
&lt;br /&gt;
===Blocking email===&lt;br /&gt;
Add the values to the SME CADNHO db. In our case, Russia and Poland seem to causing issues. You can type in any country codes you wish.&lt;br /&gt;
 &lt;br /&gt;
 config setprop qpsmtpd BadCountries RU,PL&lt;br /&gt;
&lt;br /&gt;
Signal the email-update event.&lt;br /&gt;
&lt;br /&gt;
 signal-event email-update&lt;br /&gt;
&lt;br /&gt;
No more mail from domains ending on .ru or .pl. The beauty of this is that the SME Server lookups happen locally on the local database rather than looking up the IP address via dns. This results in very fast responses. In addition, the plugin happens before most other plugins. This means the mail is dropped before the SME Server even has to check to see if it&amp;#039;s on a blacklist or if it&amp;#039;s spam.&lt;br /&gt;
&lt;br /&gt;
===Abbreviated Country Code List===&lt;br /&gt;
&lt;br /&gt;
 A1      Anonymous Proxy&lt;br /&gt;
 A2      Satellite Provider&lt;br /&gt;
 AC      Ascension Island&lt;br /&gt;
 AD      Andorra&lt;br /&gt;
 AE      United Arab Emirates&lt;br /&gt;
 AERO    members of the air-transport industry&lt;br /&gt;
 AF      Afghanistan&lt;br /&gt;
 AG      Antigua and Barbuda&lt;br /&gt;
 AI      Anguilla&lt;br /&gt;
 AL      Albania&lt;br /&gt;
 AM      Armenia&lt;br /&gt;
 AN      Netherlands Antilles (being phased out)&lt;br /&gt;
 AO      Angola&lt;br /&gt;
 AQ      Antarctica&lt;br /&gt;
 AP      Asia/Pacific&lt;br /&gt;
 AR      Argentina&lt;br /&gt;
 AS      American Samoa&lt;br /&gt;
 ASIA    Restricted to the Pan-Asia and Asia Pacific community&lt;br /&gt;
 AT      Austria&lt;br /&gt;
 AU      Australia&lt;br /&gt;
 AW      Aruba&lt;br /&gt;
 AX      Aland Islands&lt;br /&gt;
 AZ      Azerbaijan&lt;br /&gt;
 BA      Bosnia and Herzegovina&lt;br /&gt;
 BB      Barbados&lt;br /&gt;
 BD      Bangladesh&lt;br /&gt;
 BE      Belgium&lt;br /&gt;
 BF      Burkina Faso&lt;br /&gt;
 BG      Bulgaria&lt;br /&gt;
 BH      Bahrain&lt;br /&gt;
 BI      Burundi&lt;br /&gt;
 BIZ     Restricted for Business&lt;br /&gt;
 BJ      Benin&lt;br /&gt;
 BL      Saint Barthelemy&lt;br /&gt;
 BM      Bermuda&lt;br /&gt;
 BN      Brunei Darussalam&lt;br /&gt;
 BO      Bolivia&lt;br /&gt;
 BQ      Bonaire, Sint Eustatius and Saba&lt;br /&gt;
 BR      Brazil&lt;br /&gt;
 BS      Bahamas&lt;br /&gt;
 BT      Bhutan&lt;br /&gt;
 BV      Bouvet Island&lt;br /&gt;
 BW      Botswana&lt;br /&gt;
 BY      Belarus&lt;br /&gt;
 BZ      Belize&lt;br /&gt;
 CA      Canada&lt;br /&gt;
 CC      Cocos (Keeling) Islands&lt;br /&gt;
 CD      Congo, The Democratic Republic of the&lt;br /&gt;
 CF      Central African Republic&lt;br /&gt;
 CG      Congo&lt;br /&gt;
 CH      Switzerland&lt;br /&gt;
 CI      Cote d&amp;#039;Ivoire&lt;br /&gt;
 CK      Cook Islands&lt;br /&gt;
 CL      Chile&lt;br /&gt;
 CM      Cameroon&lt;br /&gt;
 CN      China&lt;br /&gt;
 CO      Colombia&lt;br /&gt;
 COM     Generic top-level domain&lt;br /&gt;
 COOP    cooperative associations&lt;br /&gt;
 CR      Costa Rica&lt;br /&gt;
 CU      Cuba&lt;br /&gt;
 CV      Cape Verde&lt;br /&gt;
 CW      Curaçao&lt;br /&gt;
 CX      Christmas Island&lt;br /&gt;
 CY      Cyprus&lt;br /&gt;
 CZ      Czech Republic&lt;br /&gt;
 DE      Germany&lt;br /&gt;
 DJ      Djibouti&lt;br /&gt;
 DK      Denmark&lt;br /&gt;
 DM      Dominica&lt;br /&gt;
 DO      Dominican Republic&lt;br /&gt;
 DZ      Algeria&lt;br /&gt;
 EC      Ecuador&lt;br /&gt;
 EDU     Educational Institutions&lt;br /&gt;
 EE      Estonia&lt;br /&gt;
 EG      Egypt&lt;br /&gt;
 EH      Western Sahara&lt;br /&gt;
 ER      Eritrea&lt;br /&gt;
 ES      Spain&lt;br /&gt;
 ET      Ethiopia&lt;br /&gt;
 EU      European Union&lt;br /&gt;
 FI      Finland&lt;br /&gt;
 FJ      Fiji&lt;br /&gt;
 FK      Falkland Islands (Malvinas)&lt;br /&gt;
 FM      Micronesia, Federated States of&lt;br /&gt;
 FO      Faroe Islands&lt;br /&gt;
 FR      France&lt;br /&gt;
 GA      Gabon&lt;br /&gt;
 GB      United Kingdom&lt;br /&gt;
 GD      Grenada&lt;br /&gt;
 GE      Georgia&lt;br /&gt;
 GF      French Guiana&lt;br /&gt;
 GG      Guernsey&lt;br /&gt;
 GH      Ghana&lt;br /&gt;
 GI      Gibraltar&lt;br /&gt;
 GL      Greenland&lt;br /&gt;
 GM      Gambia&lt;br /&gt;
 GN      Guinea&lt;br /&gt;
 GOV     United States Government&lt;br /&gt;
 GP      Guadeloupe&lt;br /&gt;
 GQ      Equatorial Guinea&lt;br /&gt;
 GR      Greece&lt;br /&gt;
 GS      South Georgia and the South Sandwich Islands&lt;br /&gt;
 GT      Guatemala&lt;br /&gt;
 GU      Guam&lt;br /&gt;
 GW      Guinea-Bissau&lt;br /&gt;
 GY      Guyana&lt;br /&gt;
 HK      Hong Kong&lt;br /&gt;
 HM      Heard Island and McDonald Islands&lt;br /&gt;
 HN      Honduras&lt;br /&gt;
 HR      Croatia&lt;br /&gt;
 HT      Haiti&lt;br /&gt;
 HU      Hungary&lt;br /&gt;
 ID      Indonesia&lt;br /&gt;
 IE      Ireland&lt;br /&gt;
 IL      Israel&lt;br /&gt;
 IM      Isle of Man&lt;br /&gt;
 IN      India&lt;br /&gt;
 INFO    Generic top-level domain&lt;br /&gt;
 IO      British Indian Ocean Territory&lt;br /&gt;
 IQ      Iraq&lt;br /&gt;
 IR      Iran, Islamic Republic of&lt;br /&gt;
 IS      Iceland&lt;br /&gt;
 IT      Italy&lt;br /&gt;
 JE      Jersey&lt;br /&gt;
 JM      Jamaica&lt;br /&gt;
 JO      Jordan&lt;br /&gt;
 JOBS    Reserved to serve needs of the international human resource management community&lt;br /&gt;
 JP      Japan&lt;br /&gt;
 KE      Kenya&lt;br /&gt;
 KG      Kyrgyzstan&lt;br /&gt;
 KH      Cambodia&lt;br /&gt;
 KI      Kiribati&lt;br /&gt;
 KM      Comoros&lt;br /&gt;
 KN      Saint Kitts and Nevis&lt;br /&gt;
 KP      Korea, Democratic People&amp;#039;s Republic of&lt;br /&gt;
 KR      Korea, Republic of&lt;br /&gt;
 KW      Kuwait&lt;br /&gt;
 KY      Cayman Islands&lt;br /&gt;
 KZ      Kazakhstan&lt;br /&gt;
 LA      Lao People&amp;#039;s Democratic Republic&lt;br /&gt;
 LB      Lebanon&lt;br /&gt;
 LC      Saint Lucia&lt;br /&gt;
 LI      Liechtenstein&lt;br /&gt;
 LK      Sri Lanka&lt;br /&gt;
 LR      Liberia&lt;br /&gt;
 LS      Lesotho&lt;br /&gt;
 LT      Lithuania&lt;br /&gt;
 LU      Luxembourg&lt;br /&gt;
 LV      Latvia&lt;br /&gt;
 LY      Libyan Arab Jamahiriya&lt;br /&gt;
 MA      Morocco&lt;br /&gt;
 MC      Monaco&lt;br /&gt;
 MD      Moldova, Republic of&lt;br /&gt;
 ME      Montenegro&lt;br /&gt;
 MF      Saint Martin (French part)&lt;br /&gt;
 MG      Madagascar&lt;br /&gt;
 MH      Marshall Islands&lt;br /&gt;
 MIL     United States Military&lt;br /&gt;
 MK      Macedonia, The Former Yugoslav Republic of&lt;br /&gt;
 ML      Mali&lt;br /&gt;
 MM      Myanmar&lt;br /&gt;
 MN      Mongolia&lt;br /&gt;
 MO      Macao&lt;br /&gt;
 MOBI    consumers and providers of mobile products and services&lt;br /&gt;
 MP      Northern Mariana Islands&lt;br /&gt;
 MQ      Martinique&lt;br /&gt;
 MR      Mauritania&lt;br /&gt;
 MS      Montserrat&lt;br /&gt;
 MT      Malta&lt;br /&gt;
 MU      Mauritius&lt;br /&gt;
 MUSEUM  museums&lt;br /&gt;
 MV      Maldives&lt;br /&gt;
 MW      Malawi&lt;br /&gt;
 MX      Mexico&lt;br /&gt;
 MY      Malaysia&lt;br /&gt;
 MZ      Mozambique&lt;br /&gt;
 NA      Namibia&lt;br /&gt;
 NAME    individuals&lt;br /&gt;
 NC      New Caledonia&lt;br /&gt;
 NE      Niger&lt;br /&gt;
 NET     Generic top-level domain&lt;br /&gt;
 NF      Norfolk Island&lt;br /&gt;
 NG      Nigeria&lt;br /&gt;
 NI      Nicaragua&lt;br /&gt;
 NL      Netherlands&lt;br /&gt;
 NO      Norway&lt;br /&gt;
 NP      Nepal&lt;br /&gt;
 NR      Nauru&lt;br /&gt;
 NU      Niue&lt;br /&gt;
 NZ      New Zealand&lt;br /&gt;
 OM      Oman&lt;br /&gt;
 ORG     Generic top-level domain&lt;br /&gt;
 PA      Panama&lt;br /&gt;
 PE      Peru&lt;br /&gt;
 PF      French Polynesia&lt;br /&gt;
 PG      Papua New Guinea&lt;br /&gt;
 PH      Philippines&lt;br /&gt;
 PK      Pakistan&lt;br /&gt;
 PL      Poland&lt;br /&gt;
 PM      Saint Pierre and Miquelon&lt;br /&gt;
 PN      Pitcairn&lt;br /&gt;
 PR      Puerto Rico&lt;br /&gt;
 PRO     Restricted to credentialed professionals and related entities&lt;br /&gt;
 PS      Palestinian Territory, Occupied&lt;br /&gt;
 PT      Portugal&lt;br /&gt;
 PW      Palau&lt;br /&gt;
 PY      Paraguay&lt;br /&gt;
 QA      Qatar&lt;br /&gt;
 RE      Reunion&lt;br /&gt;
 RO      Romania&lt;br /&gt;
 RS      Serbia&lt;br /&gt;
 RU      Russian Federation&lt;br /&gt;
 RW      Rwanda&lt;br /&gt;
 SA      Saudi Arabia&lt;br /&gt;
 SB      Solomon Islands&lt;br /&gt;
 SC      Seychelles&lt;br /&gt;
 SD      Sudan&lt;br /&gt;
 SE      Sweden&lt;br /&gt;
 SG      Singapore&lt;br /&gt;
 SH      Saint Helena&lt;br /&gt;
 SI      Slovenia&lt;br /&gt;
 SJ      Svalbard and Jan Mayen&lt;br /&gt;
 SK      Slovakia&lt;br /&gt;
 SL      Sierra Leone&lt;br /&gt;
 SM      San Marino&lt;br /&gt;
 SN      Senegal&lt;br /&gt;
 SO      Somalia&lt;br /&gt;
 SR      Suriname&lt;br /&gt;
 SS      South Sudan&lt;br /&gt;
 ST      Sao Tome and Principe&lt;br /&gt;
 SU      Soviet Union (being phased out)&lt;br /&gt;
 SV      El Salvador&lt;br /&gt;
 SX      Saint Maarten (Dutch part)&lt;br /&gt;
 SY      Syrian Arab Republic&lt;br /&gt;
 SZ      Swaziland&lt;br /&gt;
 TC      Turks and Caicos Islands&lt;br /&gt;
 TD      Chad&lt;br /&gt;
 TEL     businesses and individuals to publish their contact data&lt;br /&gt;
 TF      French Southern Territories&lt;br /&gt;
 TG      Togo&lt;br /&gt;
 TH      Thailand&lt;br /&gt;
 TJ      Tajikistan&lt;br /&gt;
 TK      Tokelau&lt;br /&gt;
 TL      Timor-Leste&lt;br /&gt;
 TM      Turkmenistan&lt;br /&gt;
 TN      Tunisia&lt;br /&gt;
 TO      Tonga&lt;br /&gt;
 TP      Portuguese Timor (being phased out)&lt;br /&gt;
 TR      Turkey&lt;br /&gt;
 TRAVEL  entities whose primary area of activity is in the travel industry&lt;br /&gt;
 TT      Trinidad and Tobago&lt;br /&gt;
 TV      Tuvalu&lt;br /&gt;
 TW      Taiwan, Province of China&lt;br /&gt;
 TZ      Tanzania, United Republic of&lt;br /&gt;
 UA      Ukraine&lt;br /&gt;
 UG      Uganda&lt;br /&gt;
 UK      United Kingdom&lt;br /&gt;
 UM      United States Minor Outlying Islands&lt;br /&gt;
 US      United States&lt;br /&gt;
 UY      Uruguay&lt;br /&gt;
 UZ      Uzbekistan&lt;br /&gt;
 VA      Holy See (Vatican City State)&lt;br /&gt;
 VC      Saint Vincent and the Grenadines&lt;br /&gt;
 VE      Venezuela, Bolivarian Republic of&lt;br /&gt;
 VG      Virgin Islands, British&lt;br /&gt;
 VI      Virgin Islands, US&lt;br /&gt;
 VN      Viet Nam&lt;br /&gt;
 VU      Vanuatu&lt;br /&gt;
 WF      Wallis and Futuna&lt;br /&gt;
 WS      Samoa&lt;br /&gt;
 XXX     the adult entertainment community&lt;br /&gt;
 YE      Yemen&lt;br /&gt;
 YT      Mayotte&lt;br /&gt;
 ZA      South Africa&lt;br /&gt;
 ZM      Zambia&lt;br /&gt;
 ZW      Zimbabwe&lt;br /&gt;
&lt;br /&gt;
Country Code Info Source:&lt;br /&gt;
&lt;br /&gt;
 http://en.wikipedia.org/wiki/ISO_3166-1&lt;br /&gt;
 http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
At April 2012 there may be some problems with countries not being blocked, possibly related to the way the geo database is updated for free users. User experience and opinion vary, and following a complaint, the original forum post about this has been deleted - http://forums.contribs.org/index.php/topic,48560.0.html&lt;br /&gt;
&lt;br /&gt;
Users are advised to determine the effectiveness of the database for themselves.&lt;br /&gt;
&lt;br /&gt;
===Db compatibility with other softwares===&lt;br /&gt;
Some software either use or depends on a geoip library, here is a table to help understand:&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!software&lt;br /&gt;
!repo&lt;br /&gt;
!Geoip 1 support&lt;br /&gt;
!Geoip 2 support&lt;br /&gt;
!notes on behaviour and default or settings to do&lt;br /&gt;
|-&lt;br /&gt;
|spamassassin&lt;br /&gt;
|smeos&lt;br /&gt;
|yes&lt;br /&gt;
|3.4.2 or above&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|smeserver-mailsats&lt;br /&gt;
|smecontribs&lt;br /&gt;
|yes&lt;br /&gt;
|Yes with updates&lt;br /&gt;
|Requires updated perl-IO-Socket-INET6 and check_badcountries plugin: https://bugs.contribs.org/show_bug.cgi?id=10523&lt;br /&gt;
|-&lt;br /&gt;
|qpsmtpd plugin / smeserver-geoip&lt;br /&gt;
|smecontribs&lt;br /&gt;
|yes&lt;br /&gt;
|smeserver-geoip 1.2 and above&lt;br /&gt;
|new bad_countries is a fork of qpsmtpd geoip plugin, default to v2 unless v2 is not available then failback on v1&lt;br /&gt;
|-&lt;br /&gt;
|proftpd&lt;br /&gt;
|smeos&lt;br /&gt;
|only&lt;br /&gt;
|no&lt;br /&gt;
|no support for v2 yet see https://github.com/proftpd/proftpd/issues/605&lt;br /&gt;
|-&lt;br /&gt;
|apache mod_geoip&lt;br /&gt;
|smecontribs&lt;br /&gt;
|yes&lt;br /&gt;
|unknown&lt;br /&gt;
|v 1.2.10 requires libGeoIP.so.1 and GeoIP: probably only v1 db supported up there&lt;br /&gt;
|-&lt;br /&gt;
|apache mod_maxminddb&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|yes&lt;br /&gt;
|https://github.com/maxmind/mod_maxminddb available in smecontribs [[Mod maxminddb|smeserver-mod_maxminddb]]&lt;br /&gt;
|-&lt;br /&gt;
|opensips-mmgeoip&lt;br /&gt;
|epel&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|unknown&lt;br /&gt;
|-&lt;br /&gt;
|php-pecl-geoip&lt;br /&gt;
|epel&lt;br /&gt;
|yes&lt;br /&gt;
|no&lt;br /&gt;
|depends on libGeoIP.so.1&lt;br /&gt;
|-&lt;br /&gt;
|php*-php-pecl-geoip&lt;br /&gt;
|remi-safe&lt;br /&gt;
|yes&lt;br /&gt;
|no&lt;br /&gt;
|depends on libGeoIP.so.1&lt;br /&gt;
|-&lt;br /&gt;
|php-maxminddb&lt;br /&gt;
|remi&lt;br /&gt;
|no&lt;br /&gt;
|yes&lt;br /&gt;
|need to test if installs with base php. mostly not...&lt;br /&gt;
|-&lt;br /&gt;
|php*-php-maxminddb&lt;br /&gt;
|remi-safe&lt;br /&gt;
|&lt;br /&gt;
|yes&lt;br /&gt;
|depends on libmaxminddb&lt;br /&gt;
|-&lt;br /&gt;
|lighttpd-mod_geoip&lt;br /&gt;
|epel&lt;br /&gt;
|yes&lt;br /&gt;
|&lt;br /&gt;
|depends on libGeoIP.so.1&lt;br /&gt;
|-&lt;br /&gt;
|nginx-mod-http-geoip&lt;br /&gt;
|epel&lt;br /&gt;
|yes&lt;br /&gt;
|&lt;br /&gt;
|depends on libGeoIP.so.1 ; found a source for geoip2  https://github.com/leev/ngx_http_geoip2_module&lt;br /&gt;
|-&lt;br /&gt;
|python-GeoIP&lt;br /&gt;
|epel&lt;br /&gt;
|yes&lt;br /&gt;
|no&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|python-geoip2 python2-maxminddb&lt;br /&gt;
|&lt;br /&gt;
|no&lt;br /&gt;
|yes&lt;br /&gt;
|not available on CentOS 6 but 7.&lt;br /&gt;
|-&lt;br /&gt;
|python-pygeoip&lt;br /&gt;
|epel&lt;br /&gt;
|yes&lt;br /&gt;
|no&lt;br /&gt;
|Pure Python GeoIP API&lt;br /&gt;
|-&lt;br /&gt;
|uwsgi-plugin-geoip&lt;br /&gt;
|epel&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|unknown&lt;br /&gt;
|-&lt;br /&gt;
|perl-Geo-IP&lt;br /&gt;
|smecontribs&lt;br /&gt;
|only&lt;br /&gt;
|no&lt;br /&gt;
|libGeoIP.so.1&lt;br /&gt;
|-&lt;br /&gt;
|perl-GeoIP2&lt;br /&gt;
|openfusion&lt;br /&gt;
|no&lt;br /&gt;
|yes&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|perl-MaxMind-DB-*&lt;br /&gt;
|openfusion&lt;br /&gt;
|no&lt;br /&gt;
|yes&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|libmaxminddb&lt;br /&gt;
|epel&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|1.1.1 needed for mmdblookup&lt;br /&gt;
|-&lt;br /&gt;
|mmdblookup&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|provided by libmaxminddb-devel (see https://bugzilla.redhat.com/show_bug.cgi?id=1663670)&lt;br /&gt;
|-&lt;br /&gt;
|bind-libs /bind-utils&lt;br /&gt;
|smeos&lt;br /&gt;
|required&lt;br /&gt;
|unknown&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
you might want to use legacy db updated with recent Maxmind geoilite2, see: https://www.miyuru.lk/geoiplegacy&lt;br /&gt;
&lt;br /&gt;
===Bugs===&lt;br /&gt;
Please raise bugs under the SME-Contribs section in [http://bugs.contribs.org/enter_bug.cgi bugzilla]&lt;br /&gt;
and select the {{#var:smecontribname}} component or use {{BugzillaFileBug|product=SME%20Contribs|component={{#var:smecontribname}}|title=this link}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{#bugzilla:columns=id,product,version,status,summary |sort=id |order=desc |component={{#var:smecontribname}}|noresultsmessage=&amp;quot;No open bugs found.&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
===Changelog===&lt;br /&gt;
Only versions released in smecontrib are listed here.&lt;br /&gt;
&lt;br /&gt;
{{#smechangelog: {{#var:smecontribname}} }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Howto]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
[[Category: Contrib]]&lt;/div&gt;</summary>
		<author><name>Rdswikiadmin</name></author>
	</entry>
</feed>