# Special rules when relay control is active Scheck_rcpt R$* $: $(dequote "" $1 $) # first: get client address R$+ $: $(dequote "" $&{client_addr} $) $| $1 R0 $| $* $@ ok client_addr is 0 for sendmail -bs R$={LocalIP}$* $| $* $@ ok from here # next: get client name R$* $| $+ $: $(dequote "" $&{client_name} $) $| $2 R $| $* $@ ok no client name: directly invoked #R$- $| $* $@ ok for those without full DNS... R$*$=w $| $* $@ ok from here R$*$={LocalNames} $| $* $@ ok from allowed system $(POPHASH)R$* $| $* $: $(popauth $1 $) $(POPHASH)ROK $@ OK # now check other side R$* $| $* $: $>3 $2 # remove local part R$+ $:$>removelocal $1 # still something left? R$*%$*<@> $#error $@ 5.7.1 $: 551 We do not relay R$*<@$+>$* $#error $@ 5.7.1 $: 551 we do not relay Sremovelocal # remove RelayTo part (maybe repeatedly) R$*<@$*$={RelayTo}.>$* $>3 $1 $4 R$*<@$*$={RelayTo}>$* $>3 $1 $4 R$*<@$=V>$* $: $>removelocal $>3 $1 $3 R$*<@$=V.>$* $: $>removelocal $>3 $1 $3 R$*<@$=w.>$* $: $>removelocal $>3 $1 $3 R$*<@$*>$* $@ $1<@$2>$3 # dequote local part R$- $: $>3 $(dequote $1 $) R$*<@$*>$* $: $>removelocal $1<@$2>$3 Scheck_relay # check IP R$+ $| $+ $: $1 $| $>junkIP $2 R$+ $| $*@JUNK $#error $@ 5.7.1 $: $2 # check hostname R$+ $| $+ $: $>junk <@$1> R$*<@$*@JUNK>$* $#error $@ 5.7.1 $: $2