Path: utzoo!mnetor!uunet!husc6!bbn!rochester!PT.CS.CMU.EDU!cadre!pitt!darth!formtek!ditka!kls From: kls@ditka.UUCP (Karl Swartz) Newsgroups: comp.mail.uucp Subject: Re: Rerouting of explicit paths Message-ID: <203@ditka.UUCP> Date: 9 Mar 88 22:38:04 GMT References: <327@vsi1.UUCP> <475@minya.UUCP> Reply-To: kls@ditka.UUCP (Karl Swartz) Organization: Pittsburgh Fish Hackery, Pittburgh, PA Lines: 94 Summary: Hacking sendmail.cf for selectively auto-route In article <475@minya.UUCP> jc@minya.UUCP (John Chambers) writes: >a position of wishing to do it right, and not quite knowing how. The problem >is the notorious sendmail, which is running on various machines over which I >have Postmaster power (if I choose to accept the assignment, knowing full well >that the whole thing is likely to self-destruct in my hands in 3 minutes :-). > >So the puzzle I have for all you mail wizards out there: Is there a simple >(well, I know nothing about sendmail is simple, but I can dream, can't I?), >straighforward recipe for taking an existing sendmail.cf and modifying it >so that it takes bang paths literally? Not sure what you mean by "takes bang paths literally". As it comes out of the box, sendmail should just pass bang paths on to the next guy, via the appropriate mechanism for reaching "the next guy". I've hacked formtek's sendmail.cf to deal with several cases; in the hope that the descriptions will help you in your quest, here they are. First, I wanted to deal with the awful, huge replies from news. In our case, this was fairly easy, since a few hops up the usual path is "cadre!PT.CS.CMU.EDU!rochester". Apparently, CMU will not forward mail that doesn't have a sender or receiver inside CMU. So, mail sent via that path *will* bounce, and I have no qualms about sending these to smail for full routing: from ruleset 0: # Force full routing of dumb mail replies R$+.cmu.edu!rochester!$+<@$+> $#reply $@rochester $:$2 # Resolve UUCP domain from UUCP mailer specifications: Mreply, P=/bin/smail, F=sDFMhum, S=13, R=23, M=100000, A=smail -R -vH$j $h!$u The other set of problems I wanted to deal with were some awfully, horribly mutilated addresses I was seeing, such as sun.com!idis!psuvax1!texsun!arc!user Say what? We might talk to sun.com via psuvax1, but certainly not directly. Hmmm. Finally figured out this sequence of events: arc: arc!user texsun: texsun!arc!user sun.com: texsun!arc!user@sun.com psuvax1: psuvax1!texsun!arc!user@sun.com idis: idis!psuvax1!texsun!arc!user@sun.com our smail: sun.com!idis!psuvax1!texsun!arc!user Simply awful. Now if we weren't running smail, it would all work, but fo all the wrong reasons. With smail, it's screwed. An even more lovely example is this one: zermatt.lcs.mit.edu!idis!psuvax1!@killington.lcs.mit.edu:rws Charming. Well, I set as my goal to untangle these messes for our unknowing users, putting things into full bang-paths to minimize confusion down the pike, and to avoid screwing up valid addresses: from ruleset 8: ### input rewriting S8 # Hacks for f***ed up addresses from down the way R$+!$+!idis!$+ $@$1!$2!idis!$3 only fix locally R$+.$-!idis!$=B!$+ $:idis!$3!$4@$1.$2 use domain format Ridis!$=B!$+ $:idis!$1<$2> focus on username R$+<@$+:$+> $1<$3@$2> convert @h: R$+<$+@$+> $1<$3%$2> map @ to % R$+<$+%$+%$+> $1!$4<$2%$3> untangle u%h2%h1 R$+<$+%$+> $1!$3!$2 force bang path R$+<$+> $1!$2 strip remaining groupers definitions from up front: # brain-damaged nodes that generate BAD addresses CBcadre pitt psuvax1 Note that ruleset 8 is called as "host dependent cleanup" from ruleset 0 in my sendmail.cf, which long ago was stock for a Sun. Note too that this seems to work for me for every case I've tried--which doesn't imply it's 100% right. I'm sure there are some address forms which I'll mangle, but which I've never seen at our site. Sorry to ramble on for so long ... I hope this helps somebody. -- Karl Swartz |UUCP decvax!formtek!ditka!kls 1-412/937-4930 office | {floyd,pitt,psuvax1}!idis!formtek!ditka!kls |BIX kswartz "I never let my schooling get in the way of my education." (Twain)