2002-02-17 21:56:45 +00:00
|
|
|
divert(-1)
|
|
|
|
#
|
2006-06-14 16:23:02 +00:00
|
|
|
# Copyright (c) 2000-2002, 2005, 2006 Sendmail, Inc. and its suppliers.
|
2002-02-17 21:56:45 +00:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# By using this file, you agree to the terms and conditions set
|
|
|
|
# forth in the LICENSE file which can be found at the top level of
|
|
|
|
# the sendmail distribution.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
2006-06-14 16:23:02 +00:00
|
|
|
ifelse(defn(`_ARG_'), `',
|
|
|
|
`errprint(`*** ERROR: missing argument for FEATURE(`enhdnsbl')')')
|
2002-02-17 21:56:45 +00:00
|
|
|
divert(0)
|
|
|
|
ifdef(`_EDNSBL_R_',`dnl',`dnl
|
2006-06-14 16:23:02 +00:00
|
|
|
VERSIONID(`$Id: enhdnsbl.m4,v 1.11 2006/03/31 19:56:16 ca Exp $')
|
2002-02-17 21:56:45 +00:00
|
|
|
LOCAL_CONFIG
|
|
|
|
define(`_EDNSBL_R_',`')dnl
|
|
|
|
# map for enhanced DNS based blacklist lookups
|
|
|
|
Kednsbl dns -R A -a. -T<TMP> -r`'ifdef(`EDNSBL_TO',`EDNSBL_TO',`5')
|
|
|
|
')
|
|
|
|
divert(-1)
|
2006-06-14 16:23:02 +00:00
|
|
|
define(`_EDNSBL_SRV_', `_ARG_')dnl
|
2002-06-11 21:12:04 +00:00
|
|
|
define(`_EDNSBL_MSG_', `ifelse(len(X`'_ARG2_),`1',`"550 Rejected: " $`'&{client_addr} " listed at '_EDNSBL_SRV_`"',`_ARG2_')')dnl
|
2002-02-17 21:56:45 +00:00
|
|
|
define(`_EDNSBL_MSG_TMP_', `ifelse(_ARG3_,`t',`"451 Temporary lookup failure of " $`'&{client_addr} " at '_EDNSBL_SRV_`"',`_ARG3_')')dnl
|
|
|
|
define(`_EDNSBL_MATCH_', `ifelse(len(X`'_ARG4_),`1',`$`'+',_ARG4_)')dnl
|
|
|
|
divert(8)
|
|
|
|
# DNS based IP address spam list _EDNSBL_SRV_
|
|
|
|
R$* $: $&{client_addr}
|
|
|
|
R$-.$-.$-.$- $: <?> $(ednsbl $4.$3.$2.$1._EDNSBL_SRV_. $: OK $)
|
|
|
|
R<?>OK $: OKSOFAR
|
|
|
|
ifelse(len(X`'_ARG3_),`1',
|
|
|
|
`R<?>$+<TMP> $: TMPOK',
|
2006-03-22 16:40:03 +00:00
|
|
|
`R<?>$+<TMP> $#error $@ 4.4.3 $: _EDNSBL_MSG_TMP_')
|
2002-02-17 21:56:45 +00:00
|
|
|
R<?>_EDNSBL_MATCH_ $#error $@ 5.7.1 $: _EDNSBL_MSG_
|
|
|
|
ifelse(len(X`'_ARG5_),`1',`dnl',
|
|
|
|
`R<?>_ARG5_ $#error $@ 5.7.1 $: _EDNSBL_MSG_')
|
|
|
|
ifelse(len(X`'_ARG6_),`1',`dnl',
|
|
|
|
`R<?>_ARG6_ $#error $@ 5.7.1 $: _EDNSBL_MSG_')
|
|
|
|
ifelse(len(X`'_ARG7_),`1',`dnl',
|
|
|
|
`R<?>_ARG7_ $#error $@ 5.7.1 $: _EDNSBL_MSG_')
|
|
|
|
ifelse(len(X`'_ARG8_),`1',`dnl',
|
|
|
|
`R<?>_ARG8_ $#error $@ 5.7.1 $: _EDNSBL_MSG_')
|
|
|
|
ifelse(len(X`'_ARG9_),`1',`dnl',
|
|
|
|
`R<?>_ARG9_ $#error $@ 5.7.1 $: _EDNSBL_MSG_')
|
|
|
|
divert(-1)
|