]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/sendmail/cf/feature/enhdnsbl.m4
Merge commit '850ef5ae11d69ea3381bd310f564f025fc8caea3'
[FreeBSD/FreeBSD.git] / contrib / sendmail / cf / feature / enhdnsbl.m4
1 divert(-1)
2 #
3 # Copyright (c) 2000-2002, 2005-2007 Proofpoint, 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 ifelse(defn(`_ARG_'), `',
13         `errprint(`*** ERROR: missing argument for FEATURE(`enhdnsbl')')')
14 divert(0)
15 ifdef(`_EDNSBL_R_',`dnl',`dnl
16 VERSIONID(`$Id: enhdnsbl.m4,v 1.13 2013-11-22 20:51:11 ca Exp $')
17 LOCAL_CONFIG
18 define(`_EDNSBL_R_',`')dnl
19 # map for enhanced DNS based blocklist lookups
20 Kednsbl dns -R A -T<TMP> -z  -Z32 -r`'ifdef(`EDNSBL_TO',`EDNSBL_TO',`5')
21 ')
22 divert(-1)
23 define(`_EDNSBL_SRV_', `_ARG_')dnl
24 define(`_EDNSBL_MSG_',
25         `ifelse(len(X`'_ARG2_),`1',`"550 Rejected: " $`'&{client_addr} " listed at '_EDNSBL_SRV_`"',
26                 X`'_ARG2_,`Xquarantine',`_EDNSBL_SRV_',
27                 `_ARG2_')')dnl
28 define(`_EDNSBL_MSG_TMP_', `ifelse(_ARG3_,`t',`"451 Temporary lookup failure of " $`'&{client_addr} " at '_EDNSBL_SRV_`"',`_ARG3_')')dnl
29 define(`_EDNSBL_MATCH_', `ifelse(len(X`'_ARG4_),`1',`$`'+',_ARG4_)')dnl
30 define(`_EDNSBL_ACTION_',
31         `ifelse(X`'_ARG2_,`Xquarantine',`$`'#error $`'@ quarantine',
32                 X`'_ARG2_,`Xdiscard',`$`'#discard',
33                 `$`'#error $`'@ 5.7.1')')dnl
34 divert(8)
35 # DNS based IP address spam list _EDNSBL_SRV_
36 R$*                     $: $&{client_addr}
37 R$-.$-.$-.$-            $: <?> $(ednsbl $4.$3.$2.$1._EDNSBL_SRV_. $: OK $)
38 R<?>OK                  $: OKSOFAR
39 ifelse(len(X`'_ARG3_),`1',
40 `R<?>$+<TMP>            $: TMPOK',
41 `R<?>$+<TMP>            $#error $@ 4.4.3 $: _EDNSBL_MSG_TMP_')
42 R<?>$* patsubst(_EDNSBL_MATCH_, `\.$', `') $*   _EDNSBL_ACTION_ $: _EDNSBL_MSG_
43 ifelse(len(X`'_ARG5_),`1',`dnl',
44 `R<?>$* patsubst(_ARG5_, `\.$', `') $*          _EDNSBL_ACTION_ $: _EDNSBL_MSG_')
45 ifelse(len(X`'_ARG6_),`1',`dnl',
46 `R<?>$* patsubst(_ARG6_, `\.$', `') $*          _EDNSBL_ACTION_ $: _EDNSBL_MSG_')
47 ifelse(len(X`'_ARG7_),`1',`dnl',
48 `R<?>$* patsubst(_ARG7_, `\.$', `') $*          _EDNSBL_ACTION_ $: _EDNSBL_MSG_')
49 ifelse(len(X`'_ARG8_),`1',`dnl',
50 `R<?>$* patsubst(_ARG8_, `\.$', `') $*          _EDNSBL_ACTION_ $: _EDNSBL_MSG_')
51 ifelse(len(X`'_ARG9_),`1',`dnl',
52 `R<?>$* patsubst(_ARG9_, `\.$', `') $*          _EDNSBL_ACTION_ $: _EDNSBL_MSG_')
53 divert(-1)