enhdnsbl.m4 revision 157001
11590Srgrimesdivert(-1)
254029Smarcel#
31590Srgrimes# Copyright (c) 2000-2002, 2005 Sendmail, Inc. and its suppliers.
4263086Sglebius#	All rights reserved.
5263086Sglebius#
6219138Sdchagin# By using this file, you agree to the terms and conditions set
7219138Sdchagin# forth in the LICENSE file which can be found at the top level of
8219138Sdchagin# the sendmail distribution.
9219138Sdchagin#
10100559Sru#
1198553Smarkm
1298557Smarkmdivert(0)
13226158Sdesifdef(`_EDNSBL_R_',`dnl',`dnl
14226158SdesVERSIONID(`$Id: enhdnsbl.m4,v 1.10 2005/07/25 20:56:53 ca Exp $')
15226145SdesLOCAL_CONFIG
161590Srgrimesdefine(`_EDNSBL_R_',`')dnl
17263086Sglebius# map for enhanced DNS based blacklist lookups
18263086SglebiusKednsbl dns -R A -a. -T<TMP> -r`'ifdef(`EDNSBL_TO',`EDNSBL_TO',`5')
19263086Sglebius')
20263086Sglebiusdivert(-1)
21226329Sdesdefine(`_EDNSBL_SRV_', `ifelse(len(X`'_ARG_),`1',`blackholes.mail-abuse.org',_ARG_)')dnl
22201386Seddefine(`_EDNSBL_MSG_', `ifelse(len(X`'_ARG2_),`1',`"550 Rejected: " $`'&{client_addr} " listed at '_EDNSBL_SRV_`"',`_ARG2_')')dnl
23277106Sdchagindefine(`_EDNSBL_MSG_TMP_', `ifelse(_ARG3_,`t',`"451 Temporary lookup failure of " $`'&{client_addr} " at '_EDNSBL_SRV_`"',`_ARG3_')')dnl
2498553Smarkmdefine(`_EDNSBL_MATCH_', `ifelse(len(X`'_ARG4_),`1',`$`'+',_ARG4_)')dnl
25277106Sdchagindivert(8)
26277106Sdchagin# DNS based IP address spam list _EDNSBL_SRV_
27277106SdchaginR$*			$: $&{client_addr}
28277106SdchaginR$-.$-.$-.$-		$: <?> $(ednsbl $4.$3.$2.$1._EDNSBL_SRV_. $: OK $)
29100559SruR<?>OK			$: OKSOFAR
30234058Sdimifelse(len(X`'_ARG3_),`1',
31226608Sdes`R<?>$+<TMP>		$: TMPOK',
321590Srgrimes`R<?>$+<TMP>		$#error $@ 4.4.3 $: _EDNSBL_MSG_TMP_')
33226145SdesR<?>_EDNSBL_MATCH_	$#error $@ 5.7.1 $: _EDNSBL_MSG_
34226145Sdesifelse(len(X`'_ARG5_),`1',`dnl',
35226145Sdes`R<?>_ARG5_	$#error $@ 5.7.1 $: _EDNSBL_MSG_')
36158766Snetchildifelse(len(X`'_ARG6_),`1',`dnl',
37226145Sdes`R<?>_ARG6_	$#error $@ 5.7.1 $: _EDNSBL_MSG_')
38226145Sdesifelse(len(X`'_ARG7_),`1',`dnl',
39277106Sdchagin`R<?>_ARG7_	$#error $@ 5.7.1 $: _EDNSBL_MSG_')
40277106Sdchaginifelse(len(X`'_ARG8_),`1',`dnl',
41219138Sdchagin`R<?>_ARG8_	$#error $@ 5.7.1 $: _EDNSBL_MSG_')
42277106Sdchaginifelse(len(X`'_ARG9_),`1',`dnl',
43219138Sdchagin`R<?>_ARG9_	$#error $@ 5.7.1 $: _EDNSBL_MSG_')
441590Srgrimesdivert(-1)
45