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