Testing check_relay ruleset

To test DNS blacklists (DNSBLs) or the sendmail access database (i.e. with a Left-Hand Side key starting with Connect:) using the check_relay ruleset, use the following procedure.

1. Add the following to sendmail.mc.
LOCAL_RULESETS
SStart
R$* $$| $* $: $1 $| $2 fake for -bt mode, remove for real version
2. Build and install sendmail.cf.

3. Start sendmail in address test mode.
# sendmail -bt

4. Define the client_addr macro with the IP address to test.
> .D{client_addr}IP_address_to_test

5. Test the IP address with the check_relay ruleset.
> Start,check_relay $| IP_address_to_test

Example:
> .D{client_addr}64.148.216.214
> Start,check_relay $| 64.148.216.214

check_relay      returns: $# error $@ 5 . 7 . 1 $: "550 Rejected " 64 . 148 . 216 . 214 " listed in Spamhaus blacklist. Please see http://www.spamhaus.org/query/bl?ip=" 64 . 148 . 216 . 214 "

More information:
Debugging check_* in sendmail 8.8/8.9 and later

Back to brandonhutchinson.com.

Last modified: 02/06/2006