home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume4 / msg / part8 < prev    next >
Encoding:
Internet Message Format  |  1986-11-30  |  13.0 KB

  1. From: hplabs!hpcnou!dat (Dave Taylor)
  2. Subject: Addition to Msg distribution...
  3. Newsgroups: mod.sources
  4. Approved: jpn@panda.UUCP
  5.  
  6. Mod.sources:  Volume 4, Issue 34
  7. Submitted by: hplabs!hpcnou!dat (Dave Taylor)
  8.  
  9.  
  10. Oops! I forgot this;
  11.  
  12. [save as doc/Alias.guide.  Format with "mm" ]
  13.  
  14. '
  15. '  A guide to the MSG alias system and so on.
  16. '  format with 'nroff -mm Alias.guide > Alias.format'
  17. '  or something similar.
  18. '  (C) Copyright 1986 Dave Taylor
  19. '
  20. '  reachable at ..hpfcla!d_taylor
  21. '  or HP - CNO, 3404 E. Harmony Rd, Fort Collins, CO, 80525
  22. '  (303) 229-2419
  23. '
  24. '  Last modification: March 3rd, 1986
  25. '
  26. .SA 1
  27. .nr Hy 1
  28. .nr Pt 1
  29. .PH ""
  30. .PF "''Page \\\\nP'"
  31. .HM 1 1
  32. .ce 3
  33. A Users Guide to the 
  34. MSG Alias System
  35. .sp
  36. .ce 999
  37. (C) Copyright 1986, by
  38. Dave Taylor
  39. .sp
  40. \*(DT
  41. .ce 0
  42. .sp
  43. .P
  44. This document is intended as a supplement to the \fBMsg Users Guide\fR
  45. and is only of interest to those users desiring more knowledge
  46. about how aliases work and how to create strange and exciting
  47. aliases for their systems (alright, so it's not \fIthat\fR exciting!)
  48. .sp
  49. .P
  50. This document is broken up into the following sections;
  51. user aliases,
  52. group aliases,
  53. system aliases,
  54. editing and installing new aliases,
  55. the machine routing database,
  56. and general warnings and other chitchat.
  57. .sp
  58. .H 1 "User Aliases"
  59. The most simple sort of aliases in the \fBMsg\fR system are individual
  60. user aliases.  These are made up of three parts;
  61. .nf
  62.  
  63.     <aliasname list> : <username> : <address>
  64.  
  65. .fi
  66. Where the \fIalias list\fR is either a single aliasname*
  67. .FS *
  68. Please see the appendix for a full definition of what exactly an
  69. aliasname consists of.
  70. .FE
  71. or a list of aliasnames separated by commas.
  72. .P
  73. \fIUsername\fR is currently a comment field, and is used to indicate
  74. the full "real name" that the alias is for.  For example, if you had
  75. an alias for "dat" to get to me, the \fIusername\fR field would
  76. contain "Dave Taylor" or perhaps "Dave Taylor, HP" or some other
  77. permutation of that.  In a future release of the mailer, the alias
  78. system will know about this field and include it in outgoing messages
  79. AND as a supplement to the usual list of aliasnames. 
  80. .P
  81. \fIAddress\fR is either the users full electronic mail address or, if
  82. the machine routing database is installed, the minimum address needed
  83. to specify the destination.  For example, say our routing database
  84. contained information on how to get to machine "hp-sdd" and I wanted
  85. to have an address for my friend Ken there - I could have his address
  86. specified as simply "ken@hp-sdd" (or alternatively "hp-sdd!ken" since
  87. the two are functionally equivalent).
  88. .sp
  89. .P 0
  90. Let's get on to some examples, shall we?
  91. .sp
  92. Consider this excerpt from my own \fB.alias_text\fR file;
  93. .nf
  94.  
  95.  wunder,walt   : Walt Underwood  : wunder@hpcea
  96.  laubach       : Mark Laubach    : laubach@hpcea
  97.  mary          : Mary Hsia-Coron : hsia@hpindla
  98.  decot         : Dave Decot      : decot@hpda
  99.      
  100.  jeff           : Jeff Wu         : hpcnoe!j_wu
  101.  dave           : Dave Barrett    : hpcnof!d_barrett
  102.  
  103. .fi
  104. Note that the alias for Walt Underwood has two aliasnames associated
  105. with it, "wunder" and "walt".  Also notice that the first four aliases
  106. use the ARPA style naming convention (user@machine) but the last two
  107. use the UUCP style convention (machine!user).  In this context it is
  108. independent.
  109. .P
  110. The only time when it \fIdoes\fR make a difference which notation you
  111. use is if you have to specify more than the machine that the user is
  112. receiving mail on.  That is, say we have a friend who receives mail at
  113. a machine called "twinkie" and our best connection is through Georgia
  114. Tech...Then our alias for them could be;
  115. .nf
  116.  
  117.   buddy         : Our friend      : gatech!twinkie!buddy
  118.  
  119. or
  120.  
  121.   buddy2        : Our friend      : gatech!buddy@twinkie
  122.  
  123. .fi
  124. but not;
  125. .nf
  126.  
  127.   buddy         : Our friend      : buddy@twinkie@gatech
  128.  
  129. .fi
  130. (however, buddy%twinkie@gatech \fIwill\fR also work, but that's far
  131. too bizarre a notation to be recommended!!) (besides there's no
  132. guarantee that "gatech" will like it, nor the "buddy2" alias above!)
  133. .P
  134. Anyway, suffice to say that if you must specify any sort of route
  135. that you should use the uucp notation as much as possible to ensure
  136. that the \fBMsg\fR system expands the correct machine name.
  137. .sp
  138. .H 1 "Group Aliases"
  139. After the confusion of user aliases, group aliases are even more 
  140. fun!  For the most part the notation is very similar;
  141. .nf
  142.  
  143.     <aliasname list> : <groupname> : <list of people>
  144.  
  145. .fi
  146. Where \fIaliasname list\fR and \fIgroupname\fR are exactly equivalent
  147. to the corresponding fields in user aliases.
  148. .P
  149. The interesting part is the \fIlist of people\fR field!  This
  150. field is actually in the same notation as the aliasname list,
  151. so it's not quite as strange as I've lead you to believe.
  152. It's best to illustrate by example;
  153. .nf
  154.  
  155. friends, mypals, gang : The Gang of Six : joe, larry, mary, joanna,
  156.                       nancy, michael
  157.  
  158. .fi
  159. (Notice that you can continue onto as many lines as you'd like so
  160. long as each additional line start with either a SPACE or a TAB
  161. character)
  162. .P
  163. The significant limitation with group aliases is that each of the
  164. people in the list must be a \fBpreviously defined aliasname in either the
  165. existing alias file or the system alias file\fR or a valid destination
  166. on the current machine.
  167. .P
  168. What does this mean?  This means that the following excerpt from an
  169. alias file;
  170. .nf
  171.  
  172. hawaii : The Hawaiian Twins : joe@RIT-CS.ARPA, maoa
  173. maoa   : Maoa Lichtenski Jr : maoa@Hawaii.cs.uh.ARPA
  174.  
  175. .fi
  176. will fail for two reasons - not only does the group \fIlist of people\fR
  177. contain a complex address, but it also contains an aliasname that is 
  178. defined \fIlater\fR in the \fB.alias_text\fR file!  ** BEWARE!!! **
  179. .P
  180. The correct way to have the previous alias in the file is to have it like;  
  181. .nf
  182.  
  183. joe    : Joe Lichtenski     : joe@RIT-CS
  184. maoa   : Maoa Lichtenski Jr : maoa@Hawaii
  185. hawaii : The Hawaiian Twins : joe, maoa
  186.  
  187. .fi
  188. which will then work correctly.
  189. .P 0
  190. This isn't too hard now, is it?
  191. .sp
  192. Fortunately, while this seems pretty tough, if you run the \fBnewalias\fR
  193. command to install your new aliases, it will give you nice meaningful
  194. error messages that will help you fix the list up correctly!
  195. .sp
  196. .H 1 "System Aliases"
  197. System aliases are functionally equivalent to the individual \fBMsg\fR 
  198. alias lists each \fBMsg\fR user has (both user aliases and group aliases) 
  199. but are "read only" for everyone but the \fBMsg\fR administrator.  The 
  200. format of the file is identical to the users file, and the only difference is
  201. that this file is expected to be located in the directory that contains
  202. the "system_hash_file" and "system_data_file" files (see the
  203. \fBMsg Configuration Guide\fR for more details on these variables).
  204. .P
  205. Simply create a \fB.alias_text\fR file in the specific directory
  206. as you would a normal file, and install it the same way (see the
  207. following section for more details on that).  
  208. .P
  209. Voila!!
  210. .sp
  211. .H 1 "Editing and Installing New Aliases"
  212. To install new aliases, you need merely to create, or modify,
  213. your \fB.alias_text\fR file in your home directory until you're
  214. satisfied with it and it meets the requirements stated above.
  215. You can then try to install it with the command;
  216. .nf
  217.  
  218.     $ \fBnewalias\fR
  219.  
  220. .fi
  221. which will either report back the number of aliases installed into 
  222. the system or will report errors indicative of the changes that
  223. the program expects before it can accept the alias list.
  224. .P
  225. Note that blank lines are no problem and that comments are not only
  226. allowed but actually encouraged, and must have \fB#\fR as the first
  227. character of each comment line.
  228. .sp
  229. Finally, if you find that you're hitting the "Too many aliases" error, 
  230. then you'll need to reconfigure the entire \fBMsg\fR system (again,
  231. see the \fBMsg Configuration Guide\fR especially the discussion on
  232. "MAX_UALIASES" and "MAX_SALIASES" therein).
  233. .sp
  234. .H 1 "The Hostname Routing Database"
  235. Floating about on the various networks is a rather nifty program by
  236. a number of people, including Peter Honeyman and Steve Bellovin, 
  237. called "pathalias".  What this incredibly handy program does is 
  238. take the strange postings in groups like "mod.map" and massage
  239. them into a file of the form;
  240. .nf
  241.  
  242.   <hostname>    <address>
  243.  
  244. .fi
  245. which is then sorted alphabetically and stored in the file
  246. pointed to by "pathfile" (guess where to look for more information!)
  247. for \fBMsg\fR to use.
  248. .P
  249. If you don't have the program, or don't want to use it, you can 
  250. simulate this file by listing machines in the same format.  The
  251. exact format expected is;
  252. .nf
  253.  
  254.   <hostname><tab><machine-address>
  255.  
  256. .fi
  257. where hostname is a limited identifier (no special characters) and
  258. machine-address MUST contain the sequence "%s" (and consequently
  259. any other percent signs that appear in the address must be paired)
  260. so that the call in the program "sprintf(buffer, machine-address, username)"
  261. will generate a valid return address.
  262. .P 0
  263. By way of example, here are a few entries from my own file;
  264. .nf
  265.  
  266.  HPL        hplabs!%s
  267.  PARC        hplabs!%s@Xerox.PA.COM
  268.  amc-hq        hplabs!%s@AMC-HQ.ARPA
  269.  imsss        hplabs!%s%%IMSSS@SU-AI.ARPA
  270.  infopro    hpfcla!ihnp4!astrovax!infopro!%s
  271.  interleaf  hpfcdc!hpda!sun!interleaf!%s
  272.  jpl-vax    hplabs!%s@jpl-vax
  273.  
  274. .fi
  275. As you can see, the addresses can get pretty complicated!!  In fact
  276. it's due purely to the complication that a database file of this
  277. sort can be so wonderful!!
  278. .sp
  279. If you'd like further information on the pathalias program, try
  280. keeping track of the entries in "mod.sources" - it's posted about
  281. once a year or so...
  282. .sp
  283. .H 1 "Other Stuff not Covered Yet"
  284. Probably the biggest question you have in your mind right now is
  285. "But how the heck does this relate to the 'ole \fBmailx\fR
  286. aliases and the snazzo \fBsendmail\fR alias system??"  Well,
  287. rest assured, \fBsendmail\fR fans, that if you REALLY want to have
  288. your aliases down in the transport you can.  No problem.  All you'll
  289. need to do is to turn off the address validation routine in \fBMsg\fR
  290. by defining the "NOCHECK_VALIDNAME" definition (I'm not even going to 
  291. bother to tell you where to look for this one!!).
  292. .P
  293. For those \fBmailx\fR fanatics out there, you can translate your 
  294. aliases into the format that \fBMsg\fR wants by running them
  295. through the \fBawk\fR script listed in Appendix Two.
  296. .sp
  297. .P
  298. Finally, if you have any problems or questions, try looking in 
  299. the \fBnewalias\fR manual entry, or dropping me a line at the
  300. "usual" email address (ask your administrator!).
  301. .SK
  302. .ce 99
  303. Appendix One
  304.  
  305. A BNF of the Alias File Grammar
  306. .ce 0
  307. .sp 2
  308. In this listing, items in <> brackets are non-terminals, items in {}
  309. are optional, and items in \fBbold face\fR are terminals.
  310. .sp 2
  311. .nf
  312.  
  313. <alias_file>  ::=  <line> { <alias_file> }
  314.  
  315. <line>          ::=  <comment> | <empty> | <alias>
  316.  
  317. <comment>     ::=  .. any sequence of characters starting with '#' ..
  318.  
  319. <empty>          ::=  .. an empty line ..
  320.  
  321. <alias>          ::=  <user alias> | <group alias>
  322.  
  323. <user alias>  ::=  <aliaslist> \fB:\fR { <comment> \fB:\fR } 
  324.            {<whitespace>} <address>
  325.  
  326. <group alias> ::=  <aliaslist> \fB:\fR { <comment> \fB:\fR } 
  327.            {<whitespace>} <list of addresses>
  328.  
  329. <aliaslist>   ::=  <aliasname> { \fB,\fR <aliaslist> }
  330.  
  331. <aliasname>   ::=  <alpha-char> { <sequence-of-chars> }
  332.  
  333. <comment>     ::=  .. anything other than ":" ..
  334.  
  335. <address>     ::=  <username> | <arpa-address> | <uucp-address> | 
  336.            <complex-address>
  337.  
  338. <list-of-addresses> ::= <aliasname> { \fB,\fR <whitespace> } 
  339.             { <list-of-addresses> }
  340.  
  341. <username>    ::=  .. any valid mailbox name on the system ..
  342.  
  343. <arpa-address> ::= <username> ( \fB@\fR <hostname> | <postfix> )
  344.  
  345. <hostname>    ::=  .. any legal host machine name ..
  346.  
  347. <uucp-address> ::= <hostname> \fB!\fR <username>
  348.  
  349. <complex-address> ::= <prefix> ( <uucp-address> | <arpa-address> )
  350.  
  351. <prefix>      ::= <hostname> \fB!\fR { <prefix> }
  352.  
  353. <postfix>     ::= \fB%\fR <hostname> { <postfix> } \fB@\fR 
  354.           <hostname>
  355.  
  356. <sequence-of-chars> ::= .. any characters other than space, tab, 
  357.                    return, or colon ..
  358.  
  359. <whitespace> ::= .. space, tab or newline followed by space or tab ..
  360.  
  361. .fi
  362. .SK
  363. .ce 99
  364. Appendix Two
  365.  
  366. An AWK Script for 
  367. Translating Aliases from a
  368. ".mailrc" Format to a
  369. Msg Format
  370. .ce 0
  371. .sp 2
  372. .nf
  373. .ce
  374. -------------------------------------------------------------------
  375.  
  376. BEGIN { 
  377.     print "# MSG alias_text file, from a .mailrc file..." 
  378.     print ""
  379.       }
  380.  
  381. next_line == 1 { 
  382.  
  383.     next_line = 0;
  384.         group = ""
  385.     for (i = 1; i <= NF; i++) {
  386.       if (i == NF && $i == "\\\\") sep = ""
  387.       else                       sep = ", "
  388.     
  389.       if ($i == "\\\\") {
  390.         group = sprintf("%s,", group)
  391.         next_line = 1;
  392.       }
  393.       else if (length(group) > 0)
  394.         group = sprintf("%s%s%s", group, sep, $i);
  395.       else
  396.         group = $i;
  397.       }
  398.       print "\\t" group
  399.  
  400.     }
  401.  
  402. $1 ~ /[Aa]lias|[Gg]roup/ { 
  403.  
  404.     if ( NF == 3)
  405.       print $2 " : user alias : " $3;
  406.     else {
  407.       group = ""
  408.       for (i = 3; i <= NF; i++) {
  409.         if (i == NF && $i == "\\\\") sep = ""
  410.         else        sep = ", "
  411.     
  412.         if ($i == "\\\\") {
  413.            group = sprintf("%s,", group)
  414.            next_line = 1;
  415.         }
  416.         else if (length(group) > 0) 
  417.            group = sprintf("%s%s%s", group, sep, $i);
  418.         else
  419.            group = $i;
  420.         }
  421.         print $2 " : group alias : " group;
  422.       }
  423.      }
  424.  
  425. .ce
  426. -------------------------------------------------------------------
  427. .fi
  428. .P
  429. Note: this script is contained in the release under the name 
  430. "mailrc.awk" in the utilities directory "utils".
  431.  
  432.  
  433.  
  434.  
  435.