home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume4 / msg / fmtd1 / Alias.fmtd next >
Encoding:
Text File  |  1986-11-30  |  13.1 KB  |  661 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                    A Users Guide to the
  9.                       MSG Alias System
  10.  
  11.                    (C) Copyright 1986, by
  12.                         Dave Taylor
  13.  
  14.                        March 15, 1986
  15.  
  16.  
  17.      This document is intended as a supplement  to  the  Msg
  18. Users  Guide and is only of interest to those users desiring
  19. more knowledge about how aliases  work  and  how  to  create
  20. strange  and exciting aliases for their systems (alright, so
  21. it's not that exciting!)
  22.  
  23.  
  24.      This document is broken up into the following sections;
  25. user  aliases,  group  aliases,  system aliases, editing and
  26. installing new aliases, the machine  routing  database,  and
  27. general warnings and other chitchat.
  28.  
  29.  
  30.  
  31. 1.  User Aliases
  32.  
  33.      The most simple sort of aliases in the Msg  system  are
  34. individual user aliases.  These are made up of three parts;
  35.  
  36.         <aliasname list> : <username> : <address>
  37.  
  38. Where the alias list is either a single aliasname* or a list
  39. of aliasnames separated by commas.
  40.  
  41.      Username is currently a comment field, and is  used  to
  42. indicate  the  full  "real name" that the alias is for.  For
  43. example, if you had an alias for "dat" to  get  to  me,  the
  44. username  field would contain "Dave Taylor" or perhaps "Dave
  45. Taylor, HP" or some other permutation of that.  In a  future
  46. release of the mailer, the alias system will know about this
  47. field and include it in outgoing messages AND as  a  supple-
  48. ment to the usual list of aliasnames.
  49.  
  50.      Address  is  either  the  users  full  electronic  mail
  51. address  or,  if  the machine routing database is installed,
  52.  
  53.  
  54. __________
  55.  
  56.   * Please see the appendix for a full definition of what
  57.     exactly an aliasname consists of.
  58.  
  59.  
  60.  
  61.  
  62. Page 1
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. the minimum address needed to specify the destination.   For
  75. example,  say  our routing database contained information on
  76. how to get to machine "hp-sdd"  and  I  wanted  to  have  an
  77. address  for  my friend Ken there - I could have his address
  78. specified as  simply  "ken@hp-sdd"  (or  alternatively  "hp-
  79. sdd!ken" since the two are functionally equivalent).
  80.  
  81.  
  82. Let's get on to some examples, shall we?
  83.  
  84. Consider this excerpt from my own .alias_text file;
  85.  
  86.  wunder,walt   : Walt Underwood  : wunder@hpcea
  87.  laubach       : Mark Laubach    : laubach@hpcea
  88.  mary          : Mary Hsia-Coron : hsia@hpindla
  89.  decot         : Dave Decot      : decot@hpda
  90.  
  91.  jeff          : Jeff Wu         : hpcnoe!j_wu
  92.  dave          : Dave Barrett    : hpcnof!d_barrett
  93.  
  94. Note that the alias for Walt Underwood  has  two  aliasnames
  95. associated  with  it, "wunder" and "walt".  Also notice that
  96. the first four aliases use the ARPA style naming  convention
  97. (user@machine)  but  the last two use the UUCP style conven-
  98. tion (machine!user).  In this context it is independent.
  99.  
  100.      The only time when it  does  make  a  difference  which
  101. notation  you  use  is  if you have to specify more than the
  102. machine that the user is receiving mail on.  That is, say we
  103. have  a  friend  who  receives  mail  at  a  machine  called
  104. "twinkie"  and  our  best  connection  is  through   Georgia
  105. Tech...Then our alias for them could be;
  106.  
  107.   buddy         : Our friend      : gatech!twinkie!buddy
  108.  
  109. or
  110.  
  111.   buddy2        : Our friend      : gatech!buddy@twinkie
  112.  
  113. but not;
  114.  
  115.   buddy         : Our friend      : buddy@twinkie@gatech
  116.  
  117. (however, buddy%twinkie@gatech will also  work,  but  that's
  118. far  too  bizarre  a  notation to be recommended!!) (besides
  119. there's no guarantee that "gatech" will  like  it,  nor  the
  120. "buddy2" alias above!)
  121.  
  122.      Anyway, suffice to say that if  you  must  specify  any
  123. sort  of route that you should use the uucp notation as much
  124. as possible to  ensure  that  the  Msg  system  expands  the
  125.  
  126.  
  127.  
  128. Page 2
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140. correct machine name.
  141.  
  142.  
  143.  
  144. 2.  Group Aliases
  145.  
  146.      After the confusion of user aliases, group aliases  are
  147. even more fun!  For the most part the notation is very simi-
  148. lar;
  149.  
  150.         <aliasname list> : <groupname> : <list of people>
  151.  
  152. Where aliasname list and groupname are exactly equivalent to
  153. the corresponding fields in user aliases.
  154.  
  155.      The interesting part is the list of people field!  This
  156. field  is  actually  in  the  same notation as the aliasname
  157. list, so it's not quite as  strange  as  I've  lead  you  to
  158. believe.  It's best to illustrate by example;
  159.  
  160. friends, mypals, gang : The Gang of Six : joe, larry, mary, joanna,
  161.                                           nancy, michael
  162.  
  163. (Notice that you can continue onto as many  lines  as  you'd
  164. like  so  long  as  each additional line start with either a
  165. SPACE or a TAB character)
  166.  
  167.      The significant limitation with group aliases  is  that
  168. each  of the people in the list must be a previously defined
  169. aliasname in either the existing alias file  or  the  system
  170. alias file or a valid destination on the current machine.
  171.  
  172.      What does this mean?  This  means  that  the  following
  173. excerpt from an alias file;
  174.  
  175. hawaii : The Hawaiian Twins : joe@RIT-CS.ARPA, maoa
  176. maoa   : Maoa Lichtenski Jr : maoa@Hawaii.cs.uh.ARPA
  177.  
  178. will fail for two reasons - not only does the group list  of
  179. people  contain  a  complex address, but it also contains an
  180. aliasname that is defined later in the .alias_text file!  **
  181. BEWARE!!! **
  182.  
  183.      The correct way to have the previous alias in the  file
  184. is to have it like;
  185.  
  186. joe    : Joe Lichtenski     : joe@RIT-CS
  187. maoa   : Maoa Lichtenski Jr : maoa@Hawaii
  188. hawaii : The Hawaiian Twins : joe, maoa
  189.  
  190. which will then work correctly.
  191.  
  192.  
  193.  
  194. Page 3
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206. This isn't too hard now, is it?
  207.  
  208. Fortunately, while this seems pretty tough, if you  run  the
  209. newalias  command  to install your new aliases, it will give
  210. you nice meaningful error messages that will  help  you  fix
  211. the list up correctly!
  212.  
  213.  
  214.  
  215. 3.  System Aliases
  216.  
  217.      System aliases are functionally equivalent to the indi-
  218. vidual  Msg alias lists each Msg user has (both user aliases
  219. and group aliases) but are "read only" for everyone but  the
  220. Msg  administrator.   The format of the file is identical to
  221. the users file, and the only difference is that this file is
  222. expected  to  be  located in the directory that contains the
  223. "system_hash_file" and "system_data_file" files (see the Msg
  224. Configuration Guide for more details on these variables).
  225.  
  226.      Simply create a .alias_text file in the specific direc-
  227. tory as you would a normal file, and install it the same way
  228. (see the following section for more details on that).
  229.  
  230.      Voila!!
  231.  
  232.  
  233.  
  234. 4.  Editing and Installing New Aliases
  235.  
  236.      To install new aliases, you need merely to  create,  or
  237. modify,  your  .alias_text file in your home directory until
  238. you're satisfied with  it  and  it  meets  the  requirements
  239. stated  above.  You can then try to install it with the com-
  240. mand;
  241.  
  242.         $ newalias
  243.  
  244. which  will  either  report  back  the  number  of   aliases
  245. installed  into  the system or will report errors indicative
  246. of the changes that the program expects before it can accept
  247. the alias list.
  248.  
  249.      Note that blank lines are no problem and that  comments
  250. are  not only allowed but actually encouraged, and must have
  251. # as the first character of each comment line.
  252.  
  253. Finally, if you find  that  you're  hitting  the  "Too  many
  254. aliases"  error,  then you'll need to reconfigure the entire
  255. Msg system (again, see the  Msg  Configuration  Guide  espe-
  256. cially  the  discussion on "MAX_UALIASES" and "MAX_SALIASES"
  257.  
  258.  
  259.  
  260. Page 4
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272. therein).
  273.  
  274.  
  275.  
  276. 5.  The Hostname Routing Database
  277.  
  278.      Floating about on the  various  networks  is  a  rather
  279. nifty  program by a number of people, including Peter Honey-
  280. man and  Steve  Bellovin,  called  "pathalias".   What  this
  281. incredibly  handy  program does is take the strange postings
  282. in groups like "mod.map" and massage them into a file of the
  283. form;
  284.  
  285.   <hostname>    <address>
  286.  
  287. which is then sorted alphabetically and stored in  the  file
  288. pointed  to  by  "pathfile"  (guess  where  to look for more
  289. information!) for Msg to use.
  290.  
  291.      If you don't have the program, or don't want to use it,
  292. you  can  simulate this file by listing machines in the same
  293. format.  The exact format expected is;
  294.  
  295.   <hostname><tab><machine-address>
  296.  
  297. where hostname is a limited identifier (no  special  charac-
  298. ters)  and  machine-address  MUST  contain the sequence "%s"
  299. (and consequently any other percent signs that appear in the
  300. address  must  be  paired)  so  that the call in the program
  301. "sprintf(buffer, machine-address, username)" will generate a
  302. valid return address.
  303.  
  304. By way of example, here are a few entries from my own file;
  305.  
  306.  HPL        hplabs!%s
  307.  PARC       hplabs!%s@Xerox.PA.COM
  308.  amc-hq     hplabs!%s@AMC-HQ.ARPA
  309.  imsss      hplabs!%s%%IMSSS@SU-AI.ARPA
  310.  infopro    hpfcla!ihnp4!astrovax!infopro!%s
  311.  interleaf  hpfcdc!hpda!sun!interleaf!%s
  312.  jpl-vax    hplabs!%s@jpl-vax
  313.  
  314. As you can see, the addresses can get  pretty  complicated!!
  315. In  fact it's due purely to the complication that a database
  316. file of this sort can be so wonderful!!
  317.  
  318. If you'd like further information on the pathalias  program,
  319. try  keeping  track  of  the entries in "mod.sources" - it's
  320. posted about once a year or so...
  321.  
  322.  
  323.  
  324.  
  325.  
  326. Page 5
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338. 6.  Other Stuff not Covered Yet
  339.  
  340.      Probably the biggest question you  have  in  your  mind
  341. right  now is "But how the heck does this relate to the 'ole
  342. mailx aliases and the snazzo sendmail alias system??"  Well,
  343. rest assured, sendmail fans, that if you REALLY want to have
  344. your aliases down in the transport  you  can.   No  problem.
  345. All  you'll need to do is to turn off the address validation
  346. routine in Msg by defining the  "NOCHECK_VALIDNAME"  defini-
  347. tion (I'm not even going to bother to tell you where to look
  348. for this one!!).
  349.  
  350.      For those mailx fanatics out there, you  can  translate
  351. your  aliases into the format that Msg wants by running them
  352. through the awk script listed in Appendix Two.
  353.  
  354.  
  355.      Finally, if you have any  problems  or  questions,  try
  356. looking  in the newalias manual entry, or dropping me a line
  357. at the "usual" email address (ask your administrator!).
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392. Page 6
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.                         Appendix One
  405.  
  406.               A BNF of the Alias File Grammar
  407.  
  408.  
  409. In this listing, items in  <>  brackets  are  non-terminals,
  410. items  in {} are optional, and items in bold face are termi-
  411. nals.
  412.  
  413.  
  414.  
  415. <alias_file>  ::=  <line> { <alias_file> }
  416.  
  417. <line>        ::=  <comment> | <empty> | <alias>
  418.  
  419. <comment>     ::=  .. any sequence of characters starting with '#' ..
  420.  
  421. <empty>       ::=  .. an empty line ..
  422.  
  423. <alias>       ::=  <user alias> | <group alias>
  424.  
  425. <user alias>  ::=  <aliaslist> : { <comment> : }
  426.                    {<whitespace>} <address>
  427.  
  428. <group alias> ::=  <aliaslist> : { <comment> : }
  429.                    {<whitespace>} <list of addresses>
  430.  
  431. <aliaslist>   ::=  <aliasname> { , <aliaslist> }
  432.  
  433. <aliasname>   ::=  <alpha-char> { <sequence-of-chars> }
  434.  
  435. <comment>     ::=  .. anything other than ":" ..
  436.  
  437. <address>     ::=  <username> | <arpa-address> | <uucp-address> |
  438.                    <complex-address>
  439.  
  440. <list-of-addresses> ::= <aliasname> { , <whitespace> }
  441.                         { <list-of-addresses> }
  442.  
  443. <username>    ::=  .. any valid mailbox name on the system ..
  444.  
  445. <arpa-address> ::= <username> ( @ <hostname> | <postfix> )
  446.  
  447. <hostname>    ::=  .. any legal host machine name ..
  448.  
  449. <uucp-address> ::= <hostname> ! <username>
  450.  
  451. <complex-address> ::= <prefix> ( <uucp-address> | <arpa-address> )
  452.  
  453. <prefix>      ::= <hostname> ! { <prefix> }
  454.  
  455.  
  456.  
  457.  
  458. Page 7
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470. <postfix>     ::= % <hostname> { <postfix> } @
  471.                   <hostname>
  472.  
  473. <sequence-of-chars> ::= .. any characters other than space, tab,
  474.                            return, or colon ..
  475.  
  476. <whitespace> ::= .. space, tab or newline followed by space or tab ..
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524. Page 8
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.                         Appendix Two
  537.  
  538.                      An AWK Script for
  539.                  Translating Aliases from a
  540.                    ".mailrc" Format to a
  541.                          Msg Format
  542.  
  543.  
  544. -------------------------------------------------------------------
  545.  
  546. BEGIN {
  547.         print "# MSG alias_text file, from a .mailrc file..."
  548.         print ""
  549.       }
  550.  
  551. next_line == 1 {
  552.  
  553.         next_line = 0;
  554.         group = ""
  555.         for (i = 1; i <= NF; i++) {
  556.           if (i == NF && $i == "\\") sep = ""
  557.           else                       sep = ", "
  558.  
  559.           if ($i == "\\") {
  560.             group = sprintf("%s,", group)
  561.             next_line = 1;
  562.           }
  563.           else if (length(group) > 0)
  564.             group = sprintf("%s%s%s", group, sep, $i);
  565.           else
  566.             group = $i;
  567.           }
  568.           print "\t" group
  569.  
  570.         }
  571.  
  572. $1 ~ /[Aa]lias|[Gg]roup/ {
  573.  
  574.         if ( NF == 3)
  575.           print $2 " : user alias : " $3;
  576.         else {
  577.           group = ""
  578.           for (i = 3; i <= NF; i++) {
  579.             if (i == NF && $i == "\\") sep = ""
  580.             else        sep = ", "
  581.  
  582.             if ($i == "\\") {
  583.               group = sprintf("%s,", group)
  584.               next_line = 1;
  585.             }
  586.             else if (length(group) > 0)
  587.  
  588.  
  589.  
  590. Page 9
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.               group = sprintf("%s%s%s", group, sep, $i);
  603.             else
  604.               group = $i;
  605.             }
  606.             print $2 " : group alias : " group;
  607.           }
  608.         }
  609.  
  610. -------------------------------------------------------------------
  611.  
  612.      Note: this script is contained in the release under the
  613. name "mailrc.awk" in the utilities directory "utils".
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656. Page 10
  657.  
  658.  
  659.  
  660.  
  661.