# please use the .m4 file, this file is not maintained!
LOCAL_CONFIG
# file containing full e-mail addresses of well-known spammers:
# spammer@address.domain SPAMMER
# or junk domain:
# junk.domain JUNK
Kjunk dbm /etc/mail/junk

LOCAL_RULESETS
# check for junk domain/spammers
Sjunk
# lookup domain in database
R$*<@$+>$*		$:$1<@$(junk $2$)>$3
# exists? return
R$*<@JUNK>$*		$@$1<@JUNK>$2
# lookup address in database
R$*<@$+>$*		$:$1<@$(junk $1@$2 $:$2$)>$3
# exists? return
R$*<@SPAMMER>$*		$@$1<@SPAMMER>$2
# mv one subdomain in front, try again
R$*<@$-.$-.$+>$*	$: $2<@> $>junk $1<@$3.$4>$5
# undo damage
R$*<@>$*<@$+>$*		$2<@$1.$3>$4

Scheck_mail
# don't check these
R<$*@$=w>	$@ ok			shortcut
# idea from Steven Schultz
R<>		$: <$n @ $(dequote "" $&{client_name} $) >
R$*		$: $>3 $1			canonify
R$-		$@ ok				local host
# no host without a . in the FQHN ?
R$*<@$->$*	$#error $@ 5.1.8 $: 550 invalid host name $2, check your configuration.
# lookup IP address (reverse mapping available?)
# R$*<@[$-.$-.$-.$-]>$*	$: $1 < @ $[ [ $2.$3.$4.$5 ] $] > $6 
# this is dangerous! no real name
# R$*<@$*$~P>$*	$#error $@ 4.1.8 $: 451 unresolvable host name $2$3, check your setup.
# now remove the dot
R$*<@$*.>$*	$: $1<@$2>$3
# and check the database
R$*<@$*>$*	$: $>junk $1<@$2>$3
R$*<@$*JUNK>$*	$#error $@ 5.7.1 $: "550 This domain is banned, contact your local admin." 	go away
R$*<@$*SPAMMER>$*	$#error $@ 5.7.1 $: "550 You are banned, contact your local admin." 	go away
