DNS Black List / RBL Checking in Python

Following on from performing basic DNS Lookups in Python, it’s relatively trivial to begin testing DNS Block Lists/Real Time Black Lists for blocked mail server IP addresses. To assist in preventing spam, a number of public and private RBLs are available. These track the IP addresses of mail servers that are known to produce spam, thus allowing recipient mail servers to deny delivery from known spammers. RBLs operate over DNS. In order to test a RBL, a DNS query is made. As an example, is a popular RBL. If I wanted to test IP address against the blocklist, I would reverse the octets in the IP address and then append ‘’, i.e. I then perform an ‘A’ record lookup on said host: root@w:~/tmp# host -t a Host not found: 3(NXDOMAIN) Excellent. IP was not found in NXDOMAIN is returned. Now, to take a known spammer’s IP: […]

By | November 22nd, 2014|Python|2 Comments

Linux – Exim, Avenger and SpamAssassin Tips

Further to Exim, MySQL, Courier IMAP, Courier POP3 & Spamassassin – vdomain and vuser set up, I’ve recently been receiving an increasing amount of spam, and have finally decided to take some positive action. Previously, my account would get hit with about 100 to 150 per day, of which 2 or 3 might get through. Lately, this has quickly increased to about 700+ of which at least 20 to 30 have been getting through, and I’ve been doing nothing but clearing spam day and night for the past few weeks. It is, however, critital that I do not catch any genuine email – I would rather keep on the side of caution and be more generous than not. […]

By | September 17th, 2009|Linux, Technology|0 Comments