All pastes #67896 Raw Edit

Untitled

public text v1 · immutable
#67896 ·published 2006-06-20 19:15 UTC
rendered paste body
######################################################################
###  ParseRecipient --  Strip off hosts in $=R as well as possibly
###                     $* $=m or the access database.
###                     Check user portion for host separators.
###
###     Parameters:
###             $1 -- full recipient address
###
###     Returns:
###             parsed, non-local-relaying address
######################################################################

SParseRecipient
R$*                             $: <?> $>CanonAddr $1
R<?> $* < @ $* . >              <?> $1 < @ $2 >                 strip trailing dots
R<?> $- < @ $* >                $: <?> $(dequote $1 $) < @ $2 > dequote local part

# if no $=O character, no host in the user portion, we are done
R<?> $* $=O $* < @ $* >         $: <NO> $1 $2 $3 < @ $4>
R<?> $*                         $@ $1

# if we relay, check username portion for user%host so host can be checked also
R<NO> $* < @ $* $=m >           $: <RELAY> $1 < @ $2 $3 >

R<NO> $* < @ $* $=R >           $: <RELAY> $1 < @ $2 $3 >



R<RELAY> $* < @ $* >            $@ $>ParseRecipient $1
R<$+> $*                        $@ $2