home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / mail / sendmail / 3135 < prev    next >
Encoding:
Text File  |  1993-01-09  |  3.7 KB  |  79 lines

  1. Newsgroups: comp.mail.sendmail
  2. Path: sparky!uunet!psinntp!monymsys!sonyd1.broadcast.sony.com!blilly.uucp!bruce
  3. From: bruce@blilly.uucp (Bruce Lilly)
  4. Subject: Re: Does alias lookup iterate?
  5. Keywords: sendmail alias
  6. References: <1hsohvINNleo@agate.berkeley.edu> <1huuhfINNjfj@network.ucsd.edu> <1ik8l9INN90r@early-bird.think.com>
  7. Organization: Bruce Lilly
  8. Date: Sat, 9 Jan 93 19:44:32 GMT
  9. Message-ID: <1993Jan9.194432.20633@blilly.uucp>
  10. Reply-To: lilb@sony.compuserve.com (Bruce Lilly)
  11. Distribution: usa
  12. Lines: 65
  13.  
  14. In article <1ik8l9INN90r@early-bird.think.com>,
  15.  posted to comp.mail.sendmail,
  16.  ellozy@farber.dfci.harvard.edu (Mohamed Ellozy) wrote:
  17. >
  18. >The following patch is taken from IDA, I am not sure why they try null-terminated strings but decided to include that part.  This is a context diff from a previously unmodiffied alias.c from berkeley 5.65, as usual your mileage may differ!
  19.  
  20. The aliases database is a specific case of a general dbm database, provided
  21. that sendmail is compiled with some sort of database support (else it is
  22. implemented in the sybmol table).
  23.  
  24. Older versions of sendmail provide a redundant '\0' at the end of the key
  25. and datum strings. It is redundant because the length field is sufficient to
  26. determine the end of the string. (using the length field also permits a '\0'
  27. character to be stored in the database) Obviously, database size can be
  28. reduced by not including the redundant '\0' character at the end of each key
  29. and datum.
  30.  
  31. Checking for the '\0'-terminated string is done for two reasons:
  32. 1)    if the database was generated with an old sendmail binary, that's
  33.     the way it was stored (i.e. it is done for backward compatibility).
  34. 2)    some implementations of NIS (a.k.a. YP) support programs fail if the
  35.     redundant '\0' is not there (i.e. for compatibility with backward
  36.     programs  1/2 :-). If you use any of these support programs, either
  37.     compile sendmail to pad (all) databases with '\0', or scream at your
  38.     supplier to provide fixes for their programs. By the way, it appears
  39.     that sendmail version 6.x provides the option of '\0'-terminated
  40.     strings on a per-database basis, as well as a hack to force the
  41.     '\0'-termination if the database is an NIS aliases database.
  42.  
  43.  
  44. Both verbatim and lower-cased versions of the key are used to support both
  45. case-sensitive and case-insensitive lookups (previously everything was
  46. supposed to be case-insensitive[!]). Using all lower-case letters in the
  47. aliases file will result in a case-insensitive match, while any upper-case
  48. letters in the aliases file must be matched by a corresponding upper-case
  49. character. E.g. if the aliases file has the lines
  50.     postmaster:root
  51.     MAILER-DAEMON:root
  52. then "postmaster" will be matched in a case-insensitive manner[*], but
  53. "MAILER-DAEMON" will only match "MAILER-DAEMON", not "mailer-daemon".
  54.  
  55.  
  56. All 4 cases which result from using the verbatim string or the
  57. '\0'-terminated extension, and the given case or lower-cased string are
  58. tested by the UIUC/IDA code.
  59.  
  60. All database lookups use the length field to determine the extent of the
  61. string (note that there might still be problems when sprintf'ing such
  62. strings using "%s", that is, strings containing an embedded '\0' will be
  63. prematurely truncated (that's a printf() "feature")).
  64.  
  65.  
  66. !    this was achieved by converting all strings to lower-case before
  67. storage, and by converting all keys to lower-case before an attempted
  68. retrieval. It was therefore impossible to distinguish "Foo" from "foo", and
  69. there were some problems with systems that support user names which can
  70. contain upper-case characters.
  71.  
  72. *    i.e. "Postmaster", "PoStmAster", etc. will all match (as required
  73. for the reserved local-part "postmaster").
  74.  
  75.  
  76. P.S. some people may find articles easier to read if long lines are folded.
  77. -- 
  78.     Bruce Lilly        ...uupsi!monymsys!sonyd1!blilly!bruce
  79.