*** sendmail-8.11.6/cf/feature/dnsbl.m4.~1~	Wed Nov 22 08:30:58 2000
--- sendmail-8.11.6/cf/feature/dnsbl.m4	Fri Sep 28 11:48:00 2001
***************
*** 15,20 ****
--- 15,21 ----
  divert(-1)
  define(`_DNSBL_SRV_', `ifelse(len(X`'_ARG_),`1',`blackholes.mail-abuse.org',_ARG_)')dnl
  define(`_DNSBL_MSG_', `ifelse(len(X`'_ARG2_),`1',`"550 Mail from " $`'&{client_addr} " refused by blackhole site '_DNSBL_SRV_`"',`_ARG2_')')dnl
+ define(`_DNSBL_CODE_', substr(_DNSBL_MSG_,1,1))dnl
  divert(8)
  # DNS based IP address spam list _DNSBL_SRV_
  R$*			$: $&{client_addr}
***************
*** 21,25 ****
  R::ffff:$-.$-.$-.$-	$: <?> $(host $4.$3.$2.$1._DNSBL_SRV_. $: OK $)
  R$-.$-.$-.$-		$: <?> $(host $4.$3.$2.$1._DNSBL_SRV_. $: OK $)
  R<?>OK			$: OKSOFAR
! R<?>$+			$#error $@ 5.7.1 $: _DNSBL_MSG_
  divert(-1)
--- 22,26 ----
  R::ffff:$-.$-.$-.$-	$: <?> $(host $4.$3.$2.$1._DNSBL_SRV_. $: OK $)
  R$-.$-.$-.$-		$: <?> $(host $4.$3.$2.$1._DNSBL_SRV_. $: OK $)
  R<?>OK			$: OKSOFAR
! R<?>$+			$#error $@ _DNSBL_CODE_.7.1 $: _DNSBL_MSG_
  divert(-1)
*** sendmail-8.11.6/cf/m4/proto.m4.~1~	Tue Jul 31 15:25:49 2001
--- sendmail-8.11.6/cf/m4/proto.m4	Wed Apr 17 16:51:36 2002
***************
*** 1266,1271 ****
--- 1266,1276 ----
  ifelse(substr(confDELIVERY_MODE,0,1), `d', `errprint(`WARNING: Antispam rules not available in deferred delivery mode.
  ')')
  ifdef(`_ACCESS_TABLE_', `dnl
+ Scheck_mail_domain
+ Sset_ignore_header
+ ifdef(`_ENABLE_IGNORE_HEADERS_', `dnl', `dnl
+ R$*				$:		default rule returns nothing')
+ 
  ######################################################################
  ###  LookUpDomain -- search for domain in access database
  ###
***************
*** 1304,1309 ****
--- 1309,1317 ----
  R<?> <$+.$+> <$+> <$*> <$*>	$@ $>LookUpDomain <$2> <$3> <$4> <$5>
  dnl not found, no subdomain: return default
  R<?> <$+> <$+> <$*> <$*>	$@ <$2> <$3>
+ dnl IGNORE, note reason(s): return default
+ R<IGNORE $- $*> <$+> <$+> <$*> <$*>	<IGNORE $2> <$3> <$4> <$5> <$6> $>set_ignore_header $1
+ R<IGNORE> <$+> <$+> <$*> <$*>	$@ <$2> <$3>
  dnl return result of lookup
  R<$*> <$+> <$+> <$*> <$*>	$@ <$1> <$4>
  
***************
*** 1334,1339 ****
--- 1342,1350 ----
  R<?> <$+.$-> <$+> <$*> <$*>	$@ $>LookUpAddress <$1> <$3> <$4> <$5>
  dnl no match: return default
  R<?> <$+> <$+> <$*> <$*>	$@ <$2> <$3>
+ dnl IGNORE, note reason(s): return default
+ R<IGNORE $- $*> <$+> <$+> <$*> <$*>	<IGNORE $2> <$3> <$4> <$5> <$6> $>set_ignore_header $1
+ R<IGNORE> <$+> <$+> <$*> <$*>	$@ <$2> <$3>
  dnl match: return result
  R<$*> <$+> <$+> <$*> <$*>	$@ <$1> <$4>',
  `dnl')
***************
*** 1561,1566 ****
--- 1572,1578 ----
  dnl workspace: <@><mark> <CanonicalAddress> $| <result>
  R<@> <$+> <$*> $| <$*>	$: <$3> <$1> <$2>		reverse result
  dnl workspace: <result> <mark> <CanonicalAddress>
+ R$*			$: $>check_mail_domain $1	check for domain in external blacklists
  # retransform for further use
  dnl required form:
  dnl <ResultOfLookup|mark> CanonicalAddress
***************
*** 1579,1591 ****
  R$* $| $*		$: $2
  R<?> $*			$: < ? $&{client_name} > $1
  R<?> $*			$@ <OK>				...local unqualed ok
! R<? $+> $*		$#error $@ 5.5.4 $: "CODE553 Domain name required for sender address " $&f
  							...remote is not')
  # check results
  R<?> $*			$: @ $1		mark address: nothing known about it
  R<OK> $*		$@ <OK>
! R<TEMP> $*		$#error $@ 4.1.8 $: "451 Domain of sender address " $&f " does not resolve"
! R<PERM> $*		$#error $@ 5.1.8 $: "CODE553 Domain of sender address " $&f " does not exist"
  ifdef(`_ACCESS_TABLE_', `dnl
  R<$={Accept}> $*	$# $1
  R<DISCARD> $*		$#discard $: discard
--- 1591,1603 ----
  R$* $| $*		$: $2
  R<?> $*			$: < ? $&{client_name} > $1
  R<?> $*			$@ <OK>				...local unqualed ok
! R<? $+> $*		$#error $@ 5.5.4 $: "CODE553 Domain name required for sender address " $2
  							...remote is not')
  # check results
  R<?> $*			$: @ $1		mark address: nothing known about it
  R<OK> $*		$@ <OK>
! R<TEMP> $+ < @ $+ >	$#error $@ 4.1.8 $: "451 Sender domain " $2 " does not resolve"
! R<PERM> $+ < @ $+ >	$#error $@ 5.1.8 $: "CODE553 Sender domain " $2 " does not exist"
  ifdef(`_ACCESS_TABLE_', `dnl
  R<$={Accept}> $*	$# $1
  R<DISCARD> $*		$#discard $: discard
***************
*** 1668,1673 ****
--- 1680,1686 ----
  dnl maybe we should stop checks already here (if SPAM_xyx)?
  R<$={SpamTag}> <$*>	$: @ $2		mark address as no match')
  R<REJECT> $*		$#error $@ 5.2.1 $: "550 Mailbox disabled for this recipient"
+ R<POISON> $*		$#error $@ 5.1.1 $: "550 User unknown"
  R<DISCARD> $*		$#discard $: discard
  dnl error tag
  R<ERROR:$-.$-.$-:$+> $*		$#error $@ $1.$2.$3 $: $4
***************
*** 1861,1873 ****
  ifdef(`_SPAM_HATER_',
  	`errprint(`*** ERROR: define either SpamHater or SpamFriend
  ')', `dnl')
! R<SPAMFRIEND> $+	$@ SPAMFRIEND
  R<$*> $+		$: $2',
  `dnl')
  ifdef(`_SPAM_HATER_',
  `# is the recipient no spam hater?
! R<SPAMHATER> $+		$: $1			spam hater: continue checks
! R<$*> $+		$@ NOSPAMHATER		everyone else: stop
  dnl',`dnl')
  dnl run further checks: check_mail
  dnl should we "clean up" $&f?
--- 1874,1887 ----
  ifdef(`_SPAM_HATER_',
  	`errprint(`*** ERROR: define either SpamHater or SpamFriend
  ')', `dnl')
! R<SPAMFRIEND> $+	$@ SPAMFRIEND $>set_ignore_header SPAMFRIEND
! R$*			$: $1 $>set_ignore_header SPAMHATER
  R<$*> $+		$: $2',
  `dnl')
  ifdef(`_SPAM_HATER_',
  `# is the recipient no spam hater?
! R<SPAMHATER> $+		$: $1 $>set_ignore_header SPAMHATER		spam hater: continue checks
! R<$*> $+		$@ NOSPAMHATER $>set_ignore_header SPAMFRIEND	everyone else: stop
  dnl',`dnl')
  dnl run further checks: check_mail
  dnl should we "clean up" $&f?
***************
*** 1934,1939 ****
--- 1948,1956 ----
  R<+ $-> $| <U:$* + $*> <$*>	$: <+ $1> $| <$(access $2@ $: U:$2 + $3$)> <$4>
  dnl no match, try rest of list
  R<$+> $| <$={src}:$+> <$+>	$@ $>SearchList <$1> $| <$4>
+ dnl IGNORE, note reason(s): return failure
+ R<$+> $| <IGNORE $- $*> <$*> <$*> <>	<$1> $| <IGNORE $3> <$4> <$5> <> $>set_ignore_header $2
+ R<$+> $| <IGNORE> <$*> <$*> <>	$@ <?>
  dnl no match, list empty: return failure
  R<$+> $| <$={src}:$+> <>	$@ <?>
  dnl got result, return it
