Subject: corrected .mc file
To: None <mklinux-misc@public.lists.apple.com, port-mac68k@NetBSD.ORG>
From: root <root@colossus.cs.wits.ac.za>
List: port-mac68k
Date: 02/23/1998 13:20:20
OSTYPE(mklinux)
define(`ALIAS_FILE',`/etc/aliases,/etc/aliases.cs2,/etc/aliases.everyone,/etc/aliases.hdip,/etc/aliases.hons,/etc/aliases.misc,/etc/aliases.misc,/etc/aliases.other,/etc/aliases.staff,/etc/aliases.tutors')
define(`confPRIVACY_FLAGS', goaway)
FEATURE(local_procmail)
FEATURE(nouucp)
FEATURE(use_cw_file)dnl
MAILER(local)
MAILER(smtp)
LOCAL_RULESETS
#
# block 3rd party relay
#
Scheck_rcpt
# check client domain name (save rcpt to: argument for later)
R$*			$: $(dequote "" $&{client_name} $) $| $1
R$@ $| $*		$@ OK		permit local user
R$=w $| $*		$@ OK		permit hosts in Cw
# this .cs.wits.ac.za was a  "w"
# check supplied rcpt to: address after dequoting
R$* $| $*		$: $>Relay_to $(dequote $2 $)
R*OK*			$@ OK		OK to relay to address
# If this rule is reached, this recipient should not be accepted
R$*			$#error $@ 5.5.1 $: "551 Relaying denied"
#
# Relay_to: check for an address that we will relay mail TO.  Accepts
# address and canonifies with ruleset 3; returns token *OK* if address
# specifies or routes through Cw hosts or *NOTOK* for anything else
SRelay_to
R$* *OK* $*		$@ *NOTOK*		reject marker in input
R$*			$: $>3 $1		canonify and focus
R$* <@ $* .> $*		$: $1 <@ $2 > $3	remove a trailing . in focus
R$* <@ $=w > $*		$: $1 <@ *OK* > $3	permit hosts in Cw
# remove left component and iterate until down to one token
R$* <@ *OK* >		$: $>Relay_to $1	focus is OK, remove and recurse
R<@ *OK* >: $*		$: $>Relay_to $1	same if weird source route form
R$* <@ $* > $*		$@ *NOTOK*		reject focus without marker
R*NOTOK*		$@ *NOTOK*		return *NOTOK* from above
# if we get here, then it's just a local user form and that's OK
R$*			$@ *OK*