3 # Copyright (c) 1998-2002, 2005-2007 Sendmail, Inc. and its suppliers.
6 # By using this file, you agree to the terms and conditions set
7 # forth in the LICENSE file which can be found at the top level of
8 # the sendmail distribution.
10 # ident "%Z%%M% %I% %E% SMI"
13 ifdef(`DNSBL_MAP', `', `define(`DNSBL_MAP', `dns -R A')')
15 ifdef(`_DNSBL_R_',`dnl',`dnl
16 VERSIONID(`$Id: dnsbl.m4,v 8.33 2007/01/05 18:49:29 ca Exp $')
17 define(`_DNSBL_R_',`')
18 ifelse(defn(`_ARG_'), `',
19 `errprint(`*** ERROR: missing argument for FEATURE(`dnsbl')')')
21 # map for DNS based blacklist lookups
22 Kdnsbl DNSBL_MAP -T<TMP>ifdef(`DNSBL_MAP_OPT',` DNSBL_MAP_OPT')')
24 define(`_DNSBL_SRV_', `_ARG_')dnl
25 define(`_DNSBL_MSG_', `ifelse(len(X`'_ARG2_),`1',`"550 Rejected: " $`'&{client_addr} " listed at '_DNSBL_SRV_`"',`_ARG2_')')dnl
26 define(`_DNSBL_MSG_TMP_', `ifelse(_ARG3_,`t',`"451 Temporary lookup failure of " $`'&{client_addr} " at '_DNSBL_SRV_`"',`_ARG3_')')dnl
28 # DNS based IP address spam list _DNSBL_SRV_
29 R$* $: $&{client_addr}
30 R$-.$-.$-.$- $: <?> $(dnsbl $4.$3.$2.$1._DNSBL_SRV_. $: OK $)
32 ifelse(len(X`'_ARG3_),`1',
33 `R<?>$+<TMP> $: TMPOK',
34 `R<?>$+<TMP> $#error $@ 4.4.3 $: _DNSBL_MSG_TMP_')
35 ifelse(`X'_ARG2_,`Xquarantine',
36 `R<?>$+ $#error $@ quarantine $: _DNSBL_SRV_',
38 `R<?>$+ $#discard $: _DNSBL_SRV_',
39 `R<?>$+ $#error $@ 5.7.1 $: _DNSBL_MSG_')