Организация и администрирование почтовых и файловых серверов Internet



Настройка программы sendmail - часть 6


# convert old-style addresses to a domain-based address R$- ! $+ $@ $>96 $2 < @ $1 .UUCP > resolve uucp names R$+ . $- ! $+ $@ $>96 $3 < @ $1 . $2 > domain uucps R$+ ! $+ $@ $>96 $2 < @ $1 .UUCP > uucp subdomains # if we have % signs, take the rightmost one R$* % $* $1 @ $2 First make them all @s. R$* @ $* @ $* $1 % $2 @ $3 Undo all but the last. R$* @ $* $@ $>96 $1 < @ $2 > Insert < > and finish # else we must be a local name ################################################ ### Ruleset 96 - bottom half of ruleset 3 ### ################################################ # At this point, everything should be in a "local_part<@domain>extra" format. S96 # handle special cases for local names R$* < @ localhost > $* $: $1 < @ $j . > $2 no domain at all R$* < @ localhost . $m > $* $: $1 < @ $j . > $2 local domain R$* < @ localhost . UUCP > $* $: $1 < @ $j . > $2 .UUCP domain R$* < @ [ $+ ] > $* $: $1 < @@ [ $2 ] > $3 mark [a.b.c.d] R$* < @@ $=w > $* $: $1 < @ $j . > $3 self-literal R$* < @@ $+ > $* $@ $1 < @ $2 > $3 canon IP addr # pass UUCP addresses straight through R$* < @ $+ . UUCP > $* $@ $1 < @ $2 . UUCP . > $3 # pass to name server to make hostname canonical R$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4 # local host aliases and pseudo-domains are always canonical R$* < @ $=w > $* $: $1 < @ $2 . > $3 R$* < @ $* $=P > $* $: $1 < @ $2 $3 . > $4 R$* < @ $* . . > $* $1 < @ $2 . > $3 # if this is the local hostname, make sure we treat is as canonical R$* < @ $j > $* $: $1 < @ $j . > $2 ################################################## ### Ruleset 4 - Final Output Post-rewriting ### ################################################## S4 R$*<@> $@ $1 handle <> and list:; # strip trailing dot off possibly canonical name R$* < @ $+ . > $* $1 < @ $2 > $3 # externalize local domain info R$* < $+ > $* $1 $2 $3 defocus R@ $+ : @ $+ : $+ @ $1 , @ $2 : $3 <route-addr> canonical R@ $* $@ @ $1 ...and exit # UUCP must always be presented in old form R$+ @ $- . UUCP $2!$1 u@h.UUCP => h!u # delete duplicate local names R$+ % $=w @ $=w $1 @ $j u%host@host => u@host ############################################################## ### Ruleset 97 - recanonicalize and call ruleset zero ### ### (used for recursive calls) ### ############################################################## S97 R$* $: $>3 $1 R$* $@ $>0 $1 ###################################### ### Ruleset 0 - Parse Address ### ###################################### S0 R<@> $#local $: <> special case error msgs R$* : $* ; $#error $@ USAGE $: "list:; syntax illegal for recipient addresses" R<@ $+> $#error $@ USAGE $: "user address required" R<$* : $* > $#error $@ USAGE $: "colon illegal in host name part" # handle numeric address spec R$* < @ [ $+ ] > $* $: $>98 $1 < @ [ $2 ] > $3 numeric internet spec R$* < @ [ $+ ] > $* $#smtp $@ [$2] $: $1 < @ [$2] > $3 still numeric: send # now delete the local info -- note $=O to find characters that cause forwarding R$* < @ > $* $@ $>97 $1 user@ => user R< @ $=w . > : $* $@ $>97 $2 @here:... -> ... R$* $=O $* < @ $=w . > $@ $>97 $1 $2 $3 ...@here -> ...




Содержание  Назад  Вперед