On Thu, Apr 9, 2009 at 08:31, Kai Schaetzl <mailli...@conactive.com> wrote: > John Rudd wrote on Wed, 8 Apr 2009 12:44:29 -0700: > >> 1) Does anyone know of a convenient command line tool (perl library >> being ideal) that lets you give it an IP address, and it tells you the >> country and/or continent (and that's it)? > > google for GeoIP. > >> >> 2) similarly, does anyone know of a command line tool where you can >> give it a country and/or continent, and it will generate concise IP >> addresses ranges (like A.B.C.D-E.F.G.H) that have been allocated to >> that country/continent? (and by "concise", I mean compacted into as >> few range statements as possible, to minimize the number of lines) > > You want to block by country? milter-greylist has GeoIP support built-in > and allows to black/grey/whitelist on country. >
We use CommuniGate Pro, which has a "Denied IP Addresses" feature, which rejects connections on ALL ports. This differs from their DNSBL support (called "Blackholed IP Addresses"), in that the Blackhole feature only rejects email messages. The Denied IP Address feature also affects connection attempts to IMAP, POP, WebMail, and CGP's other features/services. So it's more comprehensive. (and, it is unfortunately necessary, but I wont go into details here ... ) Unfortunately, it doesn't support DNSBL's for use in the Denied IP Address feature. So I can't just say "ng.countries.blackholes.us" and have it work. I can do that for their "Blackhole" feature, but not for the "Denied" feature. For the Denied feature, I have to enter them one by one (new line or comma separated), or in ranges like I gave above. I don't think it accepts CIDR blocks. Thus, the reason I want the type of list I gave. Luckily, I was wrong about countries.blackholes.us ... they are up and running. And their rbldnsd data is in cidr blocks, so I'll probably convert that to ranges. Now I just have to convince the management here that it's worth doing.