dnsbl.m4 revision 95154
1divert(-1)
2#
3# Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
4#	All rights reserved.
5#
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.
9#
10#
11
12divert(0)
13ifdef(`_DNSBL_R_',`dnl',`dnl
14VERSIONID(`$Id: dnsbl.m4,v 1.1.1.3 2002/02/17 21:56:44 gshapiro Exp $')
15define(`_DNSBL_R_',`')
16LOCAL_CONFIG
17# map for DNS based blacklist lookups
18Kdnsbl host -T<TMP>ifdef(`DNSBL_MAP_OPT',` DNSBL_MAP_OPT')')
19divert(-1)
20define(`_DNSBL_SRV_', `ifelse(len(X`'_ARG_),`1',`blackholes.mail-abuse.org',_ARG_)')dnl
21define(`_DNSBL_MSG_', `ifelse(len(X`'_ARG2_),`1',`"550 Mail from " $`'&{client_addr} " refused by blackhole site '_DNSBL_SRV_`"',`_ARG2_')')dnl
22define(`_DNSBL_MSG_TMP_', `ifelse(_ARG3_,`t',`"451 Temporary lookup failure of " $`'&{client_addr} " at '_DNSBL_SRV_`"',`_ARG3_')')dnl
23divert(8)
24# DNS based IP address spam list _DNSBL_SRV_
25R$*			$: $&{client_addr}
26R$-.$-.$-.$-		$: <?> $(dnsbl $4.$3.$2.$1._DNSBL_SRV_. $: OK $)
27R<?>OK			$: OKSOFAR
28ifelse(len(X`'_ARG3_),`1',
29`R<?>$+<TMP>		$: TMPOK',
30`R<?>$+<TMP>		$#error $@ 4.7.1 $: _DNSBL_MSG_TMP_')
31R<?>$+			$#error $@ 5.7.1 $: _DNSBL_MSG_
32divert(-1)
33