Xref: utzoo comp.sources.bugs:2799 comp.mail.uucp:5744 can.uucp:234 can.usrgroup:702 Path: utzoo!utgpu!watserv1!watmath!att!linac!midway!gargoyle!igloo!ddsw1!proxima!undeed!barrett From: barrett@Daisy.EE.UND.AC.ZA (Alan P. Barrett) Newsgroups: comp.sources.bugs,comp.mail.uucp,can.uucp,can.usrgroup Subject: Re: smail-2.5 fix for domain gateway routing Message-ID: <1991Jan16.191246.2640@Daisy.EE.UND.AC.ZA> Date: 16 Jan 91 19:12:46 GMT References: <1991Jan14.234354.8055@eci386.uucp> Organization: Univ. Natal, Durban, S. Africa Lines: 160 In article <1991Jan14.234354.8055@eci386.uucp>, woods@eci386 (Greg A. Woods) writes: > The following patch for smail-2.5 "correctly" (to the best of my > interpretation) repairs the domain gateway routing problem in > smail-2.5. This problem has been plauging me for several years, but > finally got me with a commonly used local address. I believe that the right thing to do is this (description taken from the list of changes in my version of smail2.5): | (5) When a line in the paths file starts with a dot then the '%s' has | to be replaced by 'domain!user', not just by the 'user' name. | [apb] | | (12) When looking in the paths file for a route to something like | 'abc.def.ghi,' first try the full name without an initial dot | ('abc.def.ghi'), before trying with an initial dot | ('.abc.def.ghi'). Both might appear in the paths file, and we want | to find the right one first. If that is not found, then continue | as before, looking for '.def.ghi', 'def.ghi', '.ghi' and 'ghi' in | that order. [apb] Greg's patch fixed number 5, but not number 12. Mail addressed to user@abc.def.ghi might be routed differently from mail addressed to user@subdomain.abc.def.ghi. This means that, when mail arrives addressed to user@abc.def.ghi, smail should choose the 'abc.def.ghi' paths line in preference to the '.abc.def.ghi' line. Mail if you are interested in the apb/mje patches. The patch file is about 60k in size, and the feature list appears after my signature. --apb Alan Barrett, Dept. of Electronic Eng., Univ. of Natal, Durban, South Africa Internet: barrett@ee.und.ac.za (or %ee.und.ac.za@saqqara.cis.ohio-state.edu) UUCP: m2xenix!quagga!undeed!barrett PSI-Mail: PSI%(6550)13601353::BARRETT Changes marked [apb] are mine (Alan Barrett ) and changes marked [mje] are originally by Mark Elkins . There are a few bug fixes: (1) The binary search routines were wrong (in two separate places, dealing with the paths file and the fullnames file). [apb] (2) Addresses that contained characters that are special to the shell were not treated properly. Now the address is quoted in such a way that the shell will never clobber them. (Changed definition of LARG and RARG in defs.h, added calls to sh_quote() in several places.) [apb] (3) There are a few more places where the address should be checked for "postmaster". [apb] (4) The stderr file should be opened in append mode, so that stdout and stderr don't get garbled in the "standard error follows" section of a return-to-sender error message. [apb] (5) When a line in the paths file starts with a dot then the '%s' has to be replaced by 'domain!user', not just by the 'user' name. [apb] There are a few enhancements: (1) You can define FAILPOSTMASTER (in defs.h) to make the postmaster get a copy of all failed mail messages. [apb] (2) You can define DOT_EOF and DOT_EOF_ALL (in defs.h) to modify smail's behaviour when it sees a message that contains a line with only a dot on it. The original version treated it like EOF, but now you can tell the program to (a) always treat a dot line as EOF, (b) treat a dot line as EOF only if input is from a tty, or (c) tell the program to never treat a dot line as EOF. [apb] (3) The arpadate function now returns a string that is legal according to a strict interpretation of RFC822. See the comments in the code for details. [apb] (4) "postmast" is now treated exactly like "postmaster". This is for compatibility with sites that have 8-character user names. [apb] (5) Look for a smart-host even if routing is not set to REROUTE. This may not have been such a good idea, but I like it and it works better now that change number 9 below has also been made. [apb] (6) If we get a local address with a '%' in it, change the '%' to an '@' and try again. [apb] (7) If a path cannot be found in the usual way, check whether the desired domain (or host) name is a truncated version of a known domain name. This will find 'abc.def.ghi' in the paths file if it is looking for 'abc.def'. Controlled by TRUNC_DOM in defs.h. [mje] (8) If that also didn't work, see whether the leftmost part of the desired domain (or host) name matches the leftmost part of any domain (or host) name known to the paths file. This will find 'abc.something.else' or plain 'abc' in tha paths file if it is looking for 'abc.def'. Controlled by TRUNC_DOM_LEFT in defs.h. [mje] (9) If that also didn't work, see if the leftmost part of the desired domain (or host) name matches any of the uucp neighbours reported by the uuname command. This will find 'abc' in your L.sys or Systems file if it is looking for 'abc.def.ghi'. Controlled by UUNAME in defs.h. [mje] (10) Remove all explicit routing through the local system during the alias processing stage, and be much more robust about deciding when a domain name refers to the local system. Now, paths like hostname!hostname.hostdomain!hostname!user will correctly resolve to 'user' instead of being treated as erroneous. There are still some problems that may show up if routing = REROUTE and the local system name appears at the end of a path via other systems. [apb] (11) Try harder to be sensible about quoted local parts in addresses like <"user"@myname>, or even <"user@some.where"@myname.mydom>. [apb] (12) When looking in the paths file for a route to something like 'abc.def.ghi,' first try the full name without an initial dot ('abc.def.ghi'), before trying with an initial dot ('.abc.def.ghi'). Both might appear in the paths file, and we want to find the right one first. If that is not found, then continue as before, looking for '.def.ghi', 'def.ghi', '.ghi' and 'ghi' in that order. [apb] (13) New RLFROM macro in defs.h allows the "From " line in mail from a remote user to a local user to be different from that in mail from a remote user to a remote user. Useful because mail sent via uucp should have 'remote from thishost' in the From line, but you may not want 'remote from otherhost' in the From line of mail delivered locally. [apb] (14) Get real name in the From line even if the person sending the mail is su'ed to another user id. [mje] (15) Make the stderr file unbuffered, to help with debugging. Line buffering would also be fine, on systems where it works. [apb] There are a few gratuitous changes: (1) The version name (in defs.h). (2) The LMAIL macro in defs.h calls /usr/local/bin/deliver, which I prefer because it doesn't chop messages off when it sees a dot line. "deliver" also allows one to do some fancy stuff, but I haven't really tried that. [apb] (3) MAXCLEN in defs.h is much bigger, to allow more addresses to be passed with a single copy of a message. Make sure my value isn't too big for your system, and remember that smail will actually exceed the limit you specify here, so be conservative. [apb] (5) The text of the return-to-sender message is altered. [apb] (6) Indentation has been changed in functions that were creeping off the right hand side of the page. [apb]