I wrote a bash script to add X-Country tag to mail header.
e.g.: X-Country: TW
X-Country tag may be used for basic spam filtering.
Install:
Download xcountry.tgz
tar zxf xcountry.tgz -C /
ip-to-country data in /usr/local/xcountry, xcountry in /usr/local/bin
Usage:
Add following to procmailrc
:0fw
| /usr/local/bin/xcountry
# This example delete any mail from China and Korea.
:0
* X-Country: (CN|KR)
/dev/null
and you can use IP as parameter to get country code.
eg.
# xcountry 168.95.1.1
TW
# xcountry 200.200.200.200
BR
ref. Spamhaus TOP 10 Spam Origin Countries