17c478bd9Sstevel@tonic-gatedivert(-1) 27c478bd9Sstevel@tonic-gate# 3*058561cbSjbeck# Copyright (c) 1998-2002, 2005-2007 Sendmail, Inc. and its suppliers. 47c478bd9Sstevel@tonic-gate# All rights reserved. 57c478bd9Sstevel@tonic-gate# 67c478bd9Sstevel@tonic-gate# By using this file, you agree to the terms and conditions set 77c478bd9Sstevel@tonic-gate# forth in the LICENSE file which can be found at the top level of 87c478bd9Sstevel@tonic-gate# the sendmail distribution. 97c478bd9Sstevel@tonic-gate# 107c478bd9Sstevel@tonic-gate# ident "%Z%%M% %I% %E% SMI" 117c478bd9Sstevel@tonic-gate# 127c478bd9Sstevel@tonic-gate 137c478bd9Sstevel@tonic-gateifdef(`DNSBL_MAP', `', `define(`DNSBL_MAP', `dns -R A')') 147c478bd9Sstevel@tonic-gatedivert(0) 157c478bd9Sstevel@tonic-gateifdef(`_DNSBL_R_',`dnl',`dnl 16*058561cbSjbeckVERSIONID(`$Id: dnsbl.m4,v 8.33 2007/01/05 18:49:29 ca Exp $') 177c478bd9Sstevel@tonic-gatedefine(`_DNSBL_R_',`') 183ee0e492Sjbeckifelse(defn(`_ARG_'), `', 193ee0e492Sjbeck `errprint(`*** ERROR: missing argument for FEATURE(`dnsbl')')') 207c478bd9Sstevel@tonic-gateLOCAL_CONFIG 217c478bd9Sstevel@tonic-gate# map for DNS based blacklist lookups 227c478bd9Sstevel@tonic-gateKdnsbl DNSBL_MAP -T<TMP>ifdef(`DNSBL_MAP_OPT',` DNSBL_MAP_OPT')') 237c478bd9Sstevel@tonic-gatedivert(-1) 243ee0e492Sjbeckdefine(`_DNSBL_SRV_', `_ARG_')dnl 257c478bd9Sstevel@tonic-gatedefine(`_DNSBL_MSG_', `ifelse(len(X`'_ARG2_),`1',`"550 Rejected: " $`'&{client_addr} " listed at '_DNSBL_SRV_`"',`_ARG2_')')dnl 267c478bd9Sstevel@tonic-gatedefine(`_DNSBL_MSG_TMP_', `ifelse(_ARG3_,`t',`"451 Temporary lookup failure of " $`'&{client_addr} " at '_DNSBL_SRV_`"',`_ARG3_')')dnl 277c478bd9Sstevel@tonic-gatedivert(8) 287c478bd9Sstevel@tonic-gate# DNS based IP address spam list _DNSBL_SRV_ 297c478bd9Sstevel@tonic-gateR$* $: $&{client_addr} 307c478bd9Sstevel@tonic-gateR$-.$-.$-.$- $: <?> $(dnsbl $4.$3.$2.$1._DNSBL_SRV_. $: OK $) 317c478bd9Sstevel@tonic-gateR<?>OK $: OKSOFAR 327c478bd9Sstevel@tonic-gateifelse(len(X`'_ARG3_),`1', 337c478bd9Sstevel@tonic-gate`R<?>$+<TMP> $: TMPOK', 3449218d4fSjbeck`R<?>$+<TMP> $#error $@ 4.4.3 $: _DNSBL_MSG_TMP_') 35*058561cbSjbeckifelse(`X'_ARG2_,`Xquarantine', 36*058561cbSjbeck`R<?>$+ $#error $@ quarantine $: _DNSBL_SRV_', 37*058561cbSjbeck`X'_ARG2_,`Xdiscard', 38*058561cbSjbeck`R<?>$+ $#discard $: _DNSBL_SRV_', 39*058561cbSjbeck`R<?>$+ $#error $@ 5.7.1 $: _DNSBL_MSG_') 407c478bd9Sstevel@tonic-gatedivert(-1) 41