Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!TRANSARC.COM!Craig_Everhart From: Craig_Everhart@TRANSARC.COM Newsgroups: comp.mail.sendmail Subject: Re: Idempotence of S3 Message-ID: Date: 17 Apr 91 15:34:44 GMT References: <1991Apr16.223723.25275@csl.dl.nec.com> Sender: daemon@ucbvax.BERKELEY.EDU Lines: 27 My belief is that lots of S0's start by invoking S3 because people are lazy in their recursive use of S0. That is, it's common in S0 to recognize an outermost domain as local, to strip off that outermost domain, and recurse to determine whether the next-outermost domain (if any) was local, or UUCP, or whatever. But you don't have to recurse by calling S0 directly from S0. You can do the right thing by allocating some other ruleset, say S9, and having it call S3 and then S0 itself: S9 # First, make it canonical R$*<$*>$* $1$2$3 defocus R$+ $:$>3$1 make canonical (find outer host name) R$* $@$>0$1 and return the result of S0 Then your S0 can ``recurse'' by calling S9. (The first ruleset may or may not be necessary, depending on how you invoke it from S0.) Now, the last time I looked, when Sendmail gets a To: foo bar (comment) header, it has hard code to strip that down to ``baz@ola'' before handing it to ruleset 3, leaving something like ``foo bar <$g> (comment)'' in a buffer somewhere so it knows how to merge the output of the rulesets back into a mail header. Thus, you shouldn't have to deal with the ``foo bar'' or ``(comment)'' parts of an address at all. Craig