dnl http://www.imperialviolet.org/dnsfix.html
dnl http://www.imperialviolet.org/binary/check_nxdomain.m4
dnl
dnl Version: $Id: check_nxdomain.m4,v 1.8 2003/09/21 04:48:26 root Exp $
dnl Written by: Wed Sep 17 00:52:59 CDT 2003
dnl This code is contributed to the public domain.
dnl Use at your own risk.
dnl TODO:
dnl Add IP6 lookups.
dnl Usage:
dnl Do IP lookup on the host given with "MAIL From:" and look it up in
dnl the access file/db:
dnl MAILFROMIP:64.94.110.11 NXDOMAIN
dnl If the access file shows it should be NXDOMAIN, rather than an IP,
dnl reject the mail. [Being in the access file, the IP can be changed or
dnl added to without rebuilding the .cf file.]
LOCAL_CONFIG
# map to make hostname into IP
Kdnsa dns -RA
divert(8)
R$+ $: <@> $>CanonAddr $&f
R<@>$*<@$*> $: < $(dnsa $2 $) > <$2>
R<$*> <$*> $: $>A <$1> > <$2 [$1]>
R <$*> $#error $@ 5.7.1 $: "550 rejected Host/IP: " $1 ": DNS should have returned NXDOMAIN, not that IP."