Is anyone interested in a GeoIP enabled version of tcpserver?
If yes we will put the new code on our inter7 website for download.
Recently we wanted to block incoming emails from some countries that
were only sending us spam. And we did not want to go through the bother
of finding all the IP ranges assigned to a country and adding them to
a firewall.
So we added code to tcpserver to do a GeoIP lookup of the country code
using the TCPREMOTEIP and GeoIP's database that's included in recent
packages. "/usr/share/GeoIP/GeoIP.dat"
We also added two environment variables. One for a comma separated list
of country codes to deny "DENYCOUNTRY" and another for a comma separated
list of country codes to only allow "ALLOWCOUNTRY"
If the country code is in the DENYCOUNTRY list then tcpserver denies
the connection.
If the country code is not in the ALLOWCOUNTRY list then tcpserver
denies the connection.
Otherwise the connection is allowed.
Neither, either or both DENYCOUNTRY and ALLOWCOUNTRY can be used.
The DENYCOUNTRY and ALLOWCOUNTRY environment variables would be a comma
separated list of standard 2 character country codes.
For example: "US,CA"
On our server we are using just the DENYCOUNTRY environment variable to
block certain countries that are only sending us spam.
Please let me know if you are interested and I'll put together a webpage
and documentation.
Thanks,
Ken Jones
inter7
If yes we will put the new code on our inter7 website for download.
Recently we wanted to block incoming emails from some countries that
were only sending us spam. And we did not want to go through the bother
of finding all the IP ranges assigned to a country and adding them to
a firewall.
So we added code to tcpserver to do a GeoIP lookup of the country code
using the TCPREMOTEIP and GeoIP's database that's included in recent
packages. "/usr/share/GeoIP/GeoIP.dat"
We also added two environment variables. One for a comma separated list
of country codes to deny "DENYCOUNTRY" and another for a comma separated
list of country codes to only allow "ALLOWCOUNTRY"
If the country code is in the DENYCOUNTRY list then tcpserver denies
the connection.
If the country code is not in the ALLOWCOUNTRY list then tcpserver
denies the connection.
Otherwise the connection is allowed.
Neither, either or both DENYCOUNTRY and ALLOWCOUNTRY can be used.
The DENYCOUNTRY and ALLOWCOUNTRY environment variables would be a comma
separated list of standard 2 character country codes.
For example: "US,CA"
On our server we are using just the DENYCOUNTRY environment variable to
block certain countries that are only sending us spam.
Please let me know if you are interested and I'll put together a webpage
and documentation.
Thanks,
Ken Jones
inter7