xref: /titanic_41/usr/src/cmd/sendmail/cf/feature/enhdnsbl.m4 (revision 94501b61e12c24a6ea3abf427022ca0d4a302f3b)
1divert(-1)
2#
3# Copyright (c) 2000-2002, 2005, 2006 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# ident	"%Z%%M%	%I%	%E% SMI"
11#
12
13ifelse(defn(`_ARG_'), `',
14	`errprint(`*** ERROR: missing argument for FEATURE(`enhdnsbl')')')
15divert(0)
16ifdef(`_EDNSBL_R_',`dnl',`dnl
17VERSIONID(`$Id: enhdnsbl.m4,v 1.11 2006/03/31 19:56:16 ca Exp $')
18LOCAL_CONFIG
19define(`_EDNSBL_R_',`')dnl
20# map for enhanced DNS based blacklist lookups
21Kednsbl dns -R A -a. -T<TMP> -r`'ifdef(`EDNSBL_TO',`EDNSBL_TO',`5')
22')
23divert(-1)
24define(`_EDNSBL_SRV_', `_ARG_')dnl
25define(`_EDNSBL_MSG_', `ifelse(len(X`'_ARG2_),`1',`"550 Rejected: " $`'&{client_addr} " listed at '_EDNSBL_SRV_`"',`_ARG2_')')dnl
26define(`_EDNSBL_MSG_TMP_', `ifelse(_ARG3_,`t',`"451 Temporary lookup failure of " $`'&{client_addr} " at '_EDNSBL_SRV_`"',`_ARG3_')')dnl
27define(`_EDNSBL_MATCH_', `ifelse(len(X`'_ARG4_),`1',`$`'+',_ARG4_)')dnl
28divert(8)
29# DNS based IP address spam list _EDNSBL_SRV_
30R$*			$: $&{client_addr}
31R$-.$-.$-.$-		$: <?> $(ednsbl $4.$3.$2.$1._EDNSBL_SRV_. $: OK $)
32R<?>OK			$: OKSOFAR
33ifelse(len(X`'_ARG3_),`1',
34`R<?>$+<TMP>		$: TMPOK',
35`R<?>$+<TMP>		$#error $@ 4.4.3 $: _EDNSBL_MSG_TMP_')
36R<?>_EDNSBL_MATCH_	$#error $@ 5.7.1 $: _EDNSBL_MSG_
37ifelse(len(X`'_ARG5_),`1',`dnl',
38`R<?>_ARG5_	$#error $@ 5.7.1 $: _EDNSBL_MSG_')
39ifelse(len(X`'_ARG6_),`1',`dnl',
40`R<?>_ARG6_	$#error $@ 5.7.1 $: _EDNSBL_MSG_')
41ifelse(len(X`'_ARG7_),`1',`dnl',
42`R<?>_ARG7_	$#error $@ 5.7.1 $: _EDNSBL_MSG_')
43ifelse(len(X`'_ARG8_),`1',`dnl',
44`R<?>_ARG8_	$#error $@ 5.7.1 $: _EDNSBL_MSG_')
45ifelse(len(X`'_ARG9_),`1',`dnl',
46`R<?>_ARG9_	$#error $@ 5.7.1 $: _EDNSBL_MSG_')
47divert(-1)
48