190792Sgshapirodivert(-1)
290792Sgshapiro#
3261194Sgshapiro# Copyright (c) 2000-2002, 2005-2007 Proofpoint, Inc. and its suppliers.
490792Sgshapiro#	All rights reserved.
590792Sgshapiro#
690792Sgshapiro# By using this file, you agree to the terms and conditions set
790792Sgshapiro# forth in the LICENSE file which can be found at the top level of
890792Sgshapiro# the sendmail distribution.
990792Sgshapiro#
1090792Sgshapiro#
1190792Sgshapiro
12159609Sgshapiroifelse(defn(`_ARG_'), `', 
13159609Sgshapiro	`errprint(`*** ERROR: missing argument for FEATURE(`enhdnsbl')')')
1490792Sgshapirodivert(0)
1590792Sgshapiroifdef(`_EDNSBL_R_',`dnl',`dnl
16266527SgshapiroVERSIONID(`$Id: enhdnsbl.m4,v 1.13 2013-11-22 20:51:11 ca Exp $')
1790792SgshapiroLOCAL_CONFIG
1890792Sgshapirodefine(`_EDNSBL_R_',`')dnl
1990792Sgshapiro# map for enhanced DNS based blacklist lookups
2090792SgshapiroKednsbl dns -R A -a. -T<TMP> -r`'ifdef(`EDNSBL_TO',`EDNSBL_TO',`5')
2190792Sgshapiro')
2290792Sgshapirodivert(-1)
23159609Sgshapirodefine(`_EDNSBL_SRV_', `_ARG_')dnl
24168515Sgshapirodefine(`_EDNSBL_MSG_',
25168515Sgshapiro	`ifelse(len(X`'_ARG2_),`1',`"550 Rejected: " $`'&{client_addr} " listed at '_EDNSBL_SRV_`"',
26168515Sgshapiro		X`'_ARG2_,`Xquarantine',`_EDNSBL_SRV_',
27168515Sgshapiro		`_ARG2_')')dnl
2890792Sgshapirodefine(`_EDNSBL_MSG_TMP_', `ifelse(_ARG3_,`t',`"451 Temporary lookup failure of " $`'&{client_addr} " at '_EDNSBL_SRV_`"',`_ARG3_')')dnl
2990792Sgshapirodefine(`_EDNSBL_MATCH_', `ifelse(len(X`'_ARG4_),`1',`$`'+',_ARG4_)')dnl
30168515Sgshapirodefine(`_EDNSBL_ACTION_',
31168515Sgshapiro	`ifelse(X`'_ARG2_,`Xquarantine',`$`'#error $`'@ quarantine',
32168515Sgshapiro		X`'_ARG2_,`Xdiscard',`$`'#discard',
33168515Sgshapiro		`$`'#error $`'@ 5.7.1')')dnl
3490792Sgshapirodivert(8)
3590792Sgshapiro# DNS based IP address spam list _EDNSBL_SRV_
3690792SgshapiroR$*			$: $&{client_addr}
3790792SgshapiroR$-.$-.$-.$-		$: <?> $(ednsbl $4.$3.$2.$1._EDNSBL_SRV_. $: OK $)
3890792SgshapiroR<?>OK			$: OKSOFAR
3990792Sgshapiroifelse(len(X`'_ARG3_),`1',
4090792Sgshapiro`R<?>$+<TMP>		$: TMPOK',
41157001Sgshapiro`R<?>$+<TMP>		$#error $@ 4.4.3 $: _EDNSBL_MSG_TMP_')
42168515SgshapiroR<?>_EDNSBL_MATCH_	_EDNSBL_ACTION_ $: _EDNSBL_MSG_
4390792Sgshapiroifelse(len(X`'_ARG5_),`1',`dnl',
44168515Sgshapiro`R<?>_ARG5_		_EDNSBL_ACTION_ $: _EDNSBL_MSG_')
4590792Sgshapiroifelse(len(X`'_ARG6_),`1',`dnl',
46168515Sgshapiro`R<?>_ARG6_		_EDNSBL_ACTION_ $: _EDNSBL_MSG_')
4790792Sgshapiroifelse(len(X`'_ARG7_),`1',`dnl',
48168515Sgshapiro`R<?>_ARG7_		_EDNSBL_ACTION_ $: _EDNSBL_MSG_')
4990792Sgshapiroifelse(len(X`'_ARG8_),`1',`dnl',
50168515Sgshapiro`R<?>_ARG8_		_EDNSBL_ACTION_ $: _EDNSBL_MSG_')
5190792Sgshapiroifelse(len(X`'_ARG9_),`1',`dnl',
52168515Sgshapiro`R<?>_ARG9_		_EDNSBL_ACTION_ $: _EDNSBL_MSG_')
5390792Sgshapirodivert(-1)
54