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