[comp.mail.sendmail] smart uucp routing with IDA

vixie@decwrl.dec.com (Paul A Vixie) (04/11/90)

>> What is IDA????
>>
>> thanks,    Terry

IDA is a set of patches to sendmail that enhance it in a lot of
useful ways, the most important of which is that you can do a DBM
lookup on something like a pathalias database from a RHS.  Thus
I was able to add smart pathalias routing to my sendmail.cf easily:

#
# uunames is built from the output of the command of the same name
# it is used to prevent auto-routing if the first-hop is already a
# neighbor -- just in case pathalias doesn't know about all of your
# neighbors
#
OKN/usr/lib/mail/uunames
#
# uupaths is the output of pathalias
#
OKP/usr/lib/mail/uupaths
#
# random junk needed to glue the logic together
#
CA@
CZUUX UUCP

###
### neighbor hack
###
S17
R$+<@$-.$=Z>            $:$(N$2$@$1$:@!$1<@$2.UUX>$)    try neighbor
R$=A!$+                 $@$2                            found @!, strip it, ret
R$+<@$+>$*              $@$1<@$2>$3                     still focused, ret
R$+                     $@@!$1                          return with @! prefix

###
### general hack
###
S18
R$+<@$-.$=Z>            $:$(P$2$@$1$:@!$1<@$2.UUX>$)    try path
R$=A!$+                 $@$2                            found @!, strip it, ret
R$+<@$+>$*              $@$1<@$2>$3                     still focused, ret
R$+                     $@@!$1                          return with @! prefix

S0
[...]
#
# resolve UUCP domain
#
# Here we look for fakes (labrea!$- get sent out via SMTP, for example),
# then we look for our neighbors (in a database built from "uuname" on
# a fairly regular basis), then we look for a pathalias route.  Note that
# we do NOT second-guess a path; only the first hop in a path is eligible
# for routing and we have a separate check for neighborness just in case
# pathalias shows a neighbor as other than neighbor!%s.  The only time
# that we route, in other words, is when the alternative is bouncing the
# message.  This is ROUTING, not REROUTING.  [vix, 6jan90]
#
R$+<@$-.$=Z>            $:$>3$(F$2$@$1$:$1<@$2.UUX>$)   try fakes

R$+<@$-.$=Z>            $:$>17$1<@$2.UUX>               try neighbor
R@!$-!$+                $#uux $@$1 $:$2                 found it

R$+<@$-.$=Z>            $:$>18$1<@$2.UUX>               try path
R@!$-!$+                $#uux $@$1 $:$2                 found it

R$+<@$-.$=Z>            $#error $:uucp name <$2> unknown at $U
--
Paul Vixie
DEC Western Research Lab	<vixie@decwrl.dec.com>
Palo Alto, California		{ames,att,uunet}!decwrl!vixie