# please use the .m4 file, this file is not maintained! LOCAL_CONFIG # file containing full e-mail addresses of spammers (for check_mail): # spammer@address.domain "Error-Code Error-Text" # or junk domains (for check_mail, check_relay): # junk.domain "Error-Code Error-Text" # or IP addresses (for check_relay): # D.X.Y.Z "Error-Code Error-Text" # C.X.Y "Error-Code Error-Text" # B.X "Error-Code Error-Text" # A "Error-Code Error-Text" Kjunk dbm -a@JUNK /etc/mail/junk LOCAL_RULESETS # check for junk domain/spammers Sjunk # lookup domain in database R$*<@$+> $:$1<@$(junk $2$)> # exists? return R$*<@JUNK@JUNK> $@$1<@ "550 This domain is banned, contact your local admin." @JUNK> R$*<@$*@JUNK> $@$1<@$2@JUNK> # lookup address in database R$*<@$+> $:$1<@$(junk $1@$2 $:$2$)> # exists? return R$*<@SPAMMER@JUNK> $@$1<@ "550 You are banned, contact your local admin." @JUNK> R$*<@$*@JUNK> $@$1<@$2@JUNK> # remove one subdomain, try again R$*<@$-.$-.$+> $: $>junk $1<@$3.$4> Scheck_mail # don't check these R<$*@$=w> $@ ok shortcut # idea from Steven Schultz R<> $: <$n @ $(dequote "" $&{client_name} $) > # mark address #R$* $:<@>$1 # is the syntax ok (uses <> and no dot at the end?) #R<@><$*@$*$~.> $:<$1@$2$3> # mark still there: error... #R<@>$* $#error $@ 5.1.8 $: 550 illegal MAIL FROM $1, # if we don't to the above: remove at least the dot... R<$*@$*.> <$1@$2> R$* $: $>3 $1 canonify R$- $@ ok local host # no host without a . in the FQHN ? # if you get local e-mail from hosts without full domains, # put a hash in front of the next rule 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 # copy the result of the lookup R$* $:$1 $| $1 # now remove the dot R$* $| $*<@$*.>$* $: $1 $| $2<@$3>$4 # and check the database R$* $| $*<@$*>$* $: $1 $| $>junk $2<@$3> # match: return given error code (rhs of map) R$* $| $*<@$*@JUNK>$* $#error $@ 5.7.1 $: $3 # restore original value (after canonicalization by ruleset 3) # this is only required if you want to enable the last rule # R$* $| $* $: $1 # this is dangerous! no real name # R$*<@$*$~P>$* $#error $@ 4.1.8 $: 451 unresolvable host name $2$3, check your setup.