<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: More spam stopping statistics</title>
	<atom:link href="http://www.almqvist.net/johan/blog/2006/06/more-spam-stopping-statistics/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.almqvist.net/johan/blog/2006/06/more-spam-stopping-statistics/</link>
	<description>Johan's wandering mind, in blog form...</description>
	<pubDate>Fri, 30 Jul 2010 15:58:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: TyskJohan</title>
		<link>http://www.almqvist.net/johan/blog/2006/06/more-spam-stopping-statistics/comment-page-1/#comment-975</link>
		<dc:creator>TyskJohan</dc:creator>
		<pubDate>Fri, 30 Nov 2007 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.almqvist.net/johan/blog/2006/06/more-spam-stopping-statistics/#comment-975</guid>
		<description>I got it &lt;a href="http://svn.perl.org/viewcvs/qpsmtpd/trunk/plugins/ident/geoip" rel="nofollow"&gt;here&lt;/a&gt; and modified it quite heavily.

&lt;code&gt;
use Geo::IP;
my $geoip = Geo::IP-&gt;new(GEOIP_STANDARD); 

sub hook_connect {
        my ($self) = @_;
        my $country = $geoip-&gt;country_code_by_addr
                ($self-&gt;qp-&gt;connection-&gt;remote_ip); 
        $self-&gt;qp-&gt;connection-&gt;notes('geoip_country', $country); 
        $self-&gt;log(LOGNOTICE, "GeoIP Country: $country"); 
        if ( $self-&gt;qp-&gt;config("badcountries") ) {
                my @badcountries = $self-&gt;qp-&gt;config("badcountries");

                for (@badcountries) {
                        my ($pattern, $response) = split /\s+/, $_, 2;
                        return (DENY, $response) if ($country eq $pattern);
                } 
        }

        return (DECLINED);
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I got it <a href="http://svn.perl.org/viewcvs/qpsmtpd/trunk/plugins/ident/geoip" rel="nofollow">here</a> and modified it quite heavily.</p>
<p><code><br />
use Geo::IP;<br />
my $geoip = Geo::IP->new(GEOIP_STANDARD); </p>
<p>sub hook_connect {<br />
        my ($self) = @_;<br />
        my $country = $geoip->country_code_by_addr<br />
                ($self->qp->connection->remote_ip);<br />
        $self->qp->connection->notes('geoip_country', $country);<br />
        $self->log(LOGNOTICE, "GeoIP Country: $country");<br />
        if ( $self->qp->config("badcountries") ) {<br />
                my @badcountries = $self->qp->config("badcountries");</p>
<p>                for (@badcountries) {<br />
                        my ($pattern, $response) = split /\s+/, $_, 2;<br />
                        return (DENY, $response) if ($country eq $pattern);<br />
                }<br />
        }</p>
<p>        return (DECLINED);<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug</title>
		<link>http://www.almqvist.net/johan/blog/2006/06/more-spam-stopping-statistics/comment-page-1/#comment-935</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Fri, 30 Nov 2001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.almqvist.net/johan/blog/2006/06/more-spam-stopping-statistics/#comment-935</guid>
		<description>I like the new graph. Where did you get the GEOIP plugin?</description>
		<content:encoded><![CDATA[<p>I like the new graph. Where did you get the GEOIP plugin?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
