rhost-check.c

Download: rhost-check.c
rhost-check is an incredibly simple tcpserver style program that checks if the environment variable TCPREMOTEHOST is set, and if so sets RBLSMTPD to bad reverse DNS.
This is useful to you if you use tcpserver (with -h -p) to run qmail-smtpd with rblsmtpd and want to block SMTP servers that don't have a valid reverse DNS name.

Usage

gcc -O -o rhost-check rhost-check.c
tcpserver -R -h -p 0 smtp rhost-check rblsmtpd qmail-smtpd 2>&1
NOTE: This must be chained to rblsmtpd to sucessfully block messages.