I have written a full antispam adaptative solution in PERL. I have also written a distributted SMTP server crawler in PERL that scanned through all Brazilian IP address space and saved the results of MX, SPF records and SMTP server type (postfix, sendmail, exim, etc) in a file for later processing.
I think I could be of help for your problem.