home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / sendmail / sendmail-5.65c+IDA-1.4.4.1 / ida / cf / CANONICAL next >
Encoding:
Text File  |  1991-06-07  |  3.4 KB  |  72 lines

  1. The internal canonical form used in the IDA/NIU Sendmail.mc.
  2. -----------------------------------------------------------
  3.  
  4.   The internal representation of an address is a modified source route,
  5. changed so as to provide a completely linear route.
  6.  
  7.   Thus a source route <@a,@b:user@c>
  8. is converted to:
  9.             @a,@b,@c,user
  10.  
  11. Notice how the modified source route is a completely linear description
  12. of the sequence of delivery steps.
  13.  
  14.   We further extend this format by allowing the separation character to be
  15. any of ',' ':' or '!'.  The ',' is used for domains delimited by an '@'.  The
  16. ':' is used as a separator for domains delimited by a '%'.  The '!' is the
  17. separator for domains delimited by a '!'.
  18.  
  19.   Thus an address:  'a!b!c!user'  becomes  '@a!@b!@c!user', while address
  20. 'user%b@a' becomes '@a,@b:user'.
  21.  
  22.   The address is then further canonicalized by enclosing the immediate
  23. domain in <angle brackets>.  Thus a hybrid address 'b!c!x@a' for which the '@'
  24. has precedence is ultimately formatted into: '<@a>,@b!@c!x'.  (However the
  25. initial '@' in the angle brackets may on occasion be changed to a '%' as
  26. a flag which indicates that this is a sender address rather than a recipient
  27. address).
  28.  
  29.   ALGORITHMS.
  30.   ----------
  31.  
  32.   The basic idea is that the output address format can be completely set
  33. while retaining the internal canonical form, by merely changing the 
  34. delimiters ',', ':', or '!'.  The address need not be turned back into
  35. external form until the final pass through ruleset 4 (except when used
  36. as a dbm search argument).
  37.  
  38.   Classes:  CX is '@' and '%' as before.  But CY is changed to '!',',' or ':'.
  39.         CA is '@' in a class by itself as before.
  40.  
  41.   Searching for a domain in the address uses the argument:
  42.         @$+$=Y
  43.   Searching for the user portion uses the search argument:
  44.         $=Y$~A$*  (with the last two matching the user).
  45.  
  46.   Canonicalization is done in ruleset #7 (and its subroutine #9) called
  47. from ruleset #3.  Ruleset #9 is designed to recognize the user portion
  48. of an address.  However in a mixed @/%/! address, the user portion may
  49. itself be a %-path or a !-path.  So rule set #9 canonicalizes any path
  50. in the user portion, which it encloses in <angle brackets> to separate
  51. it from the rest of the address.  Rule set #7 calls #9 to select the
  52. <user portion>, then canonicalizes the address treating the <user portion>
  53. as a unit.  Then it removes the <angle brackets> to merge the possible
  54. two routes.  Finally it places <angle brackets> around the immediate
  55. host.  A local user address (without host) is represented as '<>,user'
  56. to indicate a null host.  (Rule set #3 later changes a local user
  57. to '<>,@local-host-name,user' to provide a default host name).  The
  58. ability to ruleset #7 to combine two routes is also used in the
  59. pathalias lookup (ruleset #22).
  60.  
  61.   Ruleset #4, which converts an internal address to external form, is
  62. in principle the reverse of the above.  Initially the complete address
  63. is enclosed in <angle brackets>.  Then the idea is to logically look at
  64. what is in <angle brackets> and change it by pulling out the primary
  65. domain in the appropriate external format.  This recursive procedure doesn't
  66. quite work because of the complexity of the source route format, but still
  67. forms the idea behind ruleset #4.
  68.   The unqualification of UUCP nodes with uucpxtable is done in ruleset #4
  69. as part of the formatting process.  This allows the full domain named to
  70. be retained internally for as long as possible.  (However decnetxtable is
  71. not handled in ruleset #4).
  72.