Aug 152011

I received email from someone fiew days ago, he directed me to an article about senderscore and and asked if I could make it usable. Actually, I’m not very familiar with how senderscore work. I’ve read the article and see the FAQ at I have found that senderscore can be queried with a format like this:

Ie, I want to know the score value of ip address, the format of the query would be like this:

$ dig a +short

Look at the answers given by senderscore’s NS. last octet is the score of the ip address, which scored 75.

Excerpts from senderscore faq:

All scores are based on a scale of 0 to 100, where 0 is the worst, and 100 is the best possible score. A score represents that IP address’s rank as measured against other IP addresses, much like a percentile ranking.

Now back to the article, The authors make a perl module that can perform queries to senderscore ns, put a “reputation score” into memcache, at the same time, calculating how many times an ip address connected to our smtp.

Let’s begin, first of all download Policy::Memcache from this git repository 
Create a working directory, and extract the tarball.

$ mkdir pol-mem && cd pol-mem
$ tar --extract --file=petermblair-libemail-f73612c.tar.gz petermblair-libemail-f73612c/perl/senderscore/memcache/
$ mv petermblair-libemail-f73612c/perl/senderscore/memcache/* .

Continue reading »

Aug 092011

I was rewrote Omar Kilani’s memcache patch couple of weeks ago. But that was not tested due to lack of time and unavailability of servers that can be used.

Now, i got chance to implement simple test. This is my configuration:

smtpd_recipient_restrictions =
   check_recipient_access memcache:/etc/postfix/,

servers = localhost:11211
key_format = %s

Entry on memcache	REJECT	not allowed

Query using postmap

$ postmap -q "" memcache:/etc/postfix/
postmap: dict_memcache_lookup: using key_format '%s'
postmap: plmemcache_get: fetching key from memcache
postmap: plmemcache_get: key => REJECT not allowed
postmap: dict_memcache_lookup: returned REJECT not allowed
REJECT not allowed

A little bit too verbose i guess, but it can be adjusted by modifying source code.
Continue reading »