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

  1. From: decvax!hplabs!hpcnou!dat (Dave Taylor)
  2. Subject: Msg Shar.part.2
  3. Newsgroups: mod.sources
  4. Approved: jpn@panda.UUCP
  5.  
  6. Mod.sources:  Volume 4, Issue 6
  7. Submitted by: decvax!hplabs!hpcnou!dat (Dave Taylor)
  8.  
  9.  
  10.  
  11. # Msg Shar part 2 of 7
  12.  
  13. # Shell Archive created by hpcnou!dat at Wed Feb 26 15:55:52 1986
  14.  
  15. # To unpack the enclosed files, please use this file as input to the
  16. # Bourne (sh) shell.  This can be most easily done by the command;
  17. #     sh < thisfilename
  18.  
  19. # This archive contains;
  20. #  doc/Msg.guide    hdrs/curses.h       hdrs/defs.h         hdrs/headers.h
  21. #  hdrs/msg.h       hdrs/sysdefs.h
  22.  
  23.  
  24. if [ ! -d doc ]
  25. then
  26.   echo creating directory doc
  27.   mkdir doc
  28. fi
  29.  
  30. # ---------- file doc/Msg.guide ----------
  31.  
  32.  
  33. if [ -f doc/Msg.guide ]
  34. then
  35.   echo File 'doc/Msg.guide' already exists\!
  36.   exit 1
  37. fi
  38.  
  39. echo extracting file doc/Msg.guide...
  40. cat << 'END-OF-FILE' > doc/Msg.guide
  41. '
  42. '  Users guide to the MSG mail system.
  43. '  format with 'nroff -mm Msg.guide > Msg.format
  44. '  or something similar.
  45. '  (C) Copyright 1985 Dave Taylor
  46. '
  47. '  reachable at ..ihnp4!hpfcla!d_taylor
  48. '  or HP - CNO, 3404 E. Harmony Rd, Fort Collins, CO, 80525
  49. '
  50. '  (303) 226-3800 x2419
  51. '
  52. '  Last update: February 24th, 1986
  53. '
  54. .SA 1
  55. .nr Hy 1
  56. .nr Pt 1
  57. .PH ""
  58. .PF "''Page \\\\nP'"
  59. .HM 1 1
  60. .sp 3
  61. .PH "'Msg Users Guide''Version 3.2'"
  62. .ce 99
  63. Msg 3.1 Users Guide
  64. .sp 2
  65. Dave Taylor
  66. .sp 2
  67. \*(DT
  68. .ce 0
  69. .sp 3
  70. .H 1 "Introduction"
  71. .P 1
  72. The UNIX operating system was originally written on a small PDP machine
  73. to work with teletypewriters.  Consequently, all the original software for
  74. the operating system was written with a 'tty' in mind - they were all 
  75. line oriented, rather than screen oriented.
  76. .P
  77. Gradually this began to change, and, with the addition of the Berkeley
  78. .I vi
  79. visual shell to the 
  80. .I ed
  81. line editor, the trend was brought to the attention of certain 
  82. UNIX systems designers.  
  83. .P
  84. This, however, seemingly hasn't been enough, as 
  85. .I vi
  86. and
  87. .I notes
  88. are still the only screen oriented software available
  89. (other than games, which are a taboo subject with managers
  90. and the like!).  Consequently, after becoming more and more frustrated
  91. with the existing electronic mail facilities on the system ('mail'
  92. and 'mailx', both of which are essentially line-editors) I decided
  93. to write my own!
  94. .P
  95. This document discusses the 
  96. .I msg
  97. mailer, and includes a set of example screens and a discussion
  98. of configuration (for systems administrators).  It is broken
  99. down into the following general sections;
  100. The \fI.msgrc\fR file,
  101. starting options of 
  102. .I msg,
  103. the main system level,
  104. responses of various commands,
  105. the alias system,
  106. and system configuration.
  107. .P
  108. Any comments or problems with either this document or the program
  109. itself are welcome: all installed systems should have an alias
  110. that will ensure that I receive any mail sent to 'msg'.
  111. .SK
  112. .H 1 "The .msgrc File"
  113. .P
  114. The \fImsg\fR mailer has the 
  115. ability to automatically read in a configuration 
  116. file at each invocation.  The file must be
  117. called ".msgrc" and reside in your home directory for it
  118. to be read in, and can have any of the following entries
  119. in any order (note that the first four entries replace
  120. environment variables of the same name, and the four
  121. boolean options supplement required starting parameters);
  122. .VL 10 0
  123. .LI "fullname"
  124. This is the name the mailer will use when sending mail 
  125. from you.  It is highly recommended that you use your
  126. full name and nothing strange or unusual, as that can
  127. appear extremely rude to people receiving your mail.
  128. .LI  "maildir"
  129. This is the default mail folder.  It is used to expand filenames
  130. in the mailer when specified using the '=' metacharacter.  That
  131. is, if you save to file "=/stuff" then the '=' will be expanded
  132. to the current value of maildir.
  133. .LI "mailbox"
  134. This is where to put incoming mail after you've read it.
  135. When you answer 'y' to the "save to mailbox?" prompt, this
  136. is where the messages go!
  137. .LI "editor"
  138. The editor to use when typing in message to people.
  139. .LI "print"
  140. This indicates how to print out a message.  There are two
  141. possible formats for this string, either a command that
  142. can have a filename affixed to (as a suffix) and then
  143. sent to the system for execution, or a string that 
  144. contains the meta-sequence '%s' which will be replaced
  145. by the name of the file and then also sent to the
  146. shell.  Examples of each are;
  147. .nf
  148.  
  149.     print = print -formfeed
  150.     print = pr %s | lpr
  151.  
  152. .fi
  153. .LI "prefix"
  154. When you reply to a message or forward a message to another person,
  155. you can optionally include the original message.  Defining the
  156. prefix value here allows you to indicate what the prefix of 
  157. each included line should be.  The default is "> " and is
  158. fairly standard in the Unix community.
  159. .LI "savemail"
  160. This is where outgoing mail will have a copy silently (and
  161. quickly) saved.  This will only be used if the flag 'copy'
  162. is turned on.  Also note that if the 'savename' flag
  163. is turned on then this line is ignored since each outgoing
  164. message is saved according to whom it's being sent to.
  165. .LI "shell"
  166. This defines the shell to use when doing '!' escapes and
  167. such.  Note that the program also reads the $SHELL variable
  168. out of the current environment, but that defining this
  169. in the .msgrc file will override the environment definition.
  170. .LI "weedout"
  171. This is something new and exciting!  When specifying this
  172. option, you can then list as many headers of messages that
  173. you \fBdon't\fR want to see when you are read mail.
  174. This list can continue for as many lines as desired, as 
  175. long as the continued lines all have leading indentation.
  176. .LI "alternatives"
  177. This is a list of other machine/username combinations
  178. that you receive mail from (forwarded).  This is used 
  179. when the G)roup reply feature is invoked to ensure that
  180. you don't send yourself a copy of the outbound message.
  181. .LI "autocopy"
  182. This is a boolean flag, and if set will automatically copy
  183. the text of each message being replied to into the edit
  184. buffer.  This is the same as the '-a' starting parameter.
  185. .LI "copy"
  186. This, in combination with the "savemail" filename, will
  187. allow you to have silent copies of all outgoing mail
  188. made on the outbound step.  
  189. .LI "resolve"
  190. This is a boolean flag that defines the behaviour of the
  191. program for such actions as deletion, saving a message 
  192. and so on.  
  193. .LI "weed"
  194. This is a boolean flag that, in combination with the
  195. "weedout" list, allows you to custom define the set of
  196. headers you would like to not have displayed while reading
  197. messages.  The defaults are listed further into the
  198. document.
  199. .LI "noheader"
  200. This boolean flag tells the mailer not to include the 
  201. headers of messages when copying a message into a file
  202. buffer for replying to or forwarding.
  203. .LI "titles"
  204. This boolean flag allows you to have each page of a message
  205. to be titled with:
  206. .nf
  207. Message #N from username    Mailed date at time
  208. .fi
  209. where all the information has been previously extracted
  210. from the message.
  211. This is especially useful if you weed out all the headers of each
  212. message with a large 'weedout' list...
  213. .LE
  214. .sp
  215. Two more things: the format for each of the lines is;
  216. .nf
  217.  
  218.     variable = value
  219.  
  220. .fi
  221. and for boolean variables, value can be 'ON' or 'OFF' only.
  222. .sp
  223. For a better idea of how this all works, here's my .msgrc file.
  224. While looking through it, notice that you can have lots of comments
  225. and blank lines for readability and that you can also use 'shell
  226. variables' and the '~' metacharacter for your home directory, 
  227. and they are expanded accordingly when read in by the mailer.
  228. .nf
  229.  
  230.   #
  231.   # .msgrc - automatic variable defines for the 'msg' mailer.
  232.   #
  233.   # Personalized for Dave Taylor
  234.   # 
  235.   
  236.   fullname = Dave Taylor
  237.  
  238.   # where to save my mail to, default directory
  239.   maildir  = ~/Mail
  240.   
  241.   # where to save messages to, default file
  242.   mailbox  = ~/Mail/mailbox
  243.   
  244.   # what editor to use
  245.   editor   = $EDITOR
  246.   
  247.   # where to save mail if not specified somewhere else
  248.   savemail = ~/Mail/mail.sent
  249.   
  250.   # how to print a message ('%s' is the filename)
  251.   print    = /usr/local/bin/print -p lpn -f %s
  252.   
  253.   # prefix sequence for including message text in other messages...
  254.   prefix = > 
  255.   
  256.   # what headers I DON'T want to see, ever.
  257.   
  258.   weedout  = "Via:"  "Sent:"  "Date:"  "Status:"  "Original"
  259.          "From"  "Phase"  "Subject:"  "Fruit"  "Sun"
  260.          "Lat"  "Buzzword"  "Return"  "Posted" "Telephone"
  261.          "Postal-Address" "Origin" "X-Sent-By-Nmail-V"
  262.          "Resent" "X-Location"  "Source" "Mood"  "Neuron"
  263.          "Libido" "To:" "X-Mailer:"  "Full-Name:" "X-HPMAIL"
  264.          "Cc:" "cc:" "Mmdf" "Network-"
  265.   
  266.   # automatically copy message being replied to into buffer? 
  267.   autocopy = OFF
  268.   
  269.   # save a copy of all outbound messages? 
  270.   copy     = ON
  271.   
  272.   # emulate the mailx message increment mode (only increment after something
  273.   # has been 'done' to a message, either saved or deleted)
  274.   resolve  = ON
  275.   
  276.   # enable the weedout list to be read...
  277.   weed     = ON
  278.   
  279.   # when messages are copied into the outbound buffer, don't include headers
  280.   noheader = ON
  281.   
  282.   # display message title when displaying pages of message
  283.   titles     = ON
  284.   
  285.   # alternative addresses that I could receive mail from (usually a
  286.   # forwarding mailbox)
  287.  
  288.   alternatives = hpcnof!dat,  hpcnof!d_taylor,   hpcnou!d_taylor,
  289.              hpcnou!root, hpcnou!postmaster, hpcnoe!d_taylor, 
  290.                  hpcnoe!dat,  hpcnoa!d_taylor,   hpcnoa!dat, 
  291.                  hpfcla!d_taylor
  292.  
  293. .fi
  294. Along with this, there is still an environment variable
  295. that the mailer checks for, namely "EDITOR", which can
  296. also define what editor to use when entering messages.
  297. As with the shell variable, having an editor specified
  298. in the .msgrc file will override anything read in from
  299. the current environment.
  300. .sp 2
  301. .H 1 "The Starting Parameters"
  302. .P
  303. There are a number of starting options to the
  304. .I msg
  305. program, with only one that needs to be remembered: '-?'or '-h' for help.
  306. .P 0
  307. The flags are;
  308. .VL 10 3
  309. .LI "-d"
  310. Debug.  Useful for debugging the 
  311. .I msg
  312. program.  The results of using the debug option is
  313. much less drastic than in the previous versions of 
  314. the program - it creates a file in your home directory
  315. called "Msg.debug.info" and creates a (verbose) log
  316. of activity as the program is used.  
  317. .LI "-f <file>"
  318. File.  Read specified file rather than the default input mailbox.
  319. .LI "-h or -?"
  320. Help.  Gives a short list of all these options and exit.
  321. .LI "-k"
  322. Keypad - This option, when used, lets the \fImsg\fR program
  323. know that you're on an HP terminal, and it can then interpret
  324. the PREV NEXT and HOME/DOWN-HOME keys accordingly.  If you
  325. are not on an HP terminal, it is recommended that you do
  326. NOT use this option.
  327. .LI "-s"
  328. Softkeys.  The \fImsg\fR mailer can, to a rather limited
  329. extent, use the HP softkeys as an alternative form of
  330. input.  If you specify this option be sure that you're on
  331. an HP terminal that can accept the standard 2622 terminal
  332. escape sequences!
  333. .LI "-z"
  334. Zero.  This causes the mailer not to be started if you don't
  335. have any mail.   This emulates the behaviour of programs
  336. like 'mailx'.
  337. .LI "-S <subject>"
  338. In batch mode, this is how to indicate the subject of the
  339. resulting message.  Please see the section on "Non-Interactive
  340. Uses of Msg" for further information.
  341. .LE
  342. .P
  343. All the above flags default to reasonable options, so there is
  344. usually no need to use them.   
  345. .sp 2
  346. .H 1 "Non-Interactive Uses of Msg"
  347. .P 1
  348. Before we discuss the main mail system, it's worth noting that 
  349. there are a couple of other ways to use the \fBmsg\fR mail 
  350. system, namely to 'send only' and to send files (batchmail).
  351. .P
  352. To send a message to someone without any of the associated 
  353. overhead of the main system being loaded, you can invoke the
  354. mailer with the name(s) of the people to send to.  The 
  355. mailer will then prompt for Subject, Copies, and then drop
  356. you in your (defined in the ".msgrc" file) editor to compose
  357. the message.   When composition is complete, the program 
  358. verifies transmission then terminates.  For example;
  359. .nf
  360.  
  361.   $ \fBmsg dat\fR
  362.   To: ihnp4!hpfcla!d_taylor
  363.   Subject: \fBthis is a test\fR
  364.   Copies To: \fB<return>\fR
  365.  
  366.   <invokes editor, message composed, then>
  367.  
  368.   Are you sure you want to send this? (y/n) \fBy\fR
  369.  
  370.   mail sent.
  371.  
  372.   $
  373.  
  374. .fi
  375. Note that the user input is in \fBbold\fR face, so you can see that
  376. the mailer verified the alias expansion too!
  377. .sp
  378. .P
  379. The mailer also supports batch type mailing, of files and so on,
  380. by using the following starting sequence;
  381. .nf
  382.  
  383.   $ \fBmsg -S "File help.c" dat < help.c\fR
  384.  
  385. .fi
  386. which will read in the file and transmit it to the specified user
  387. with the specified subject.  Note that the program is intelligent
  388. enough to check to see what the stdin is from this invocation, so
  389. a command of the form
  390. .nf
  391.  
  392.   $ \fBmsg -S "file help.c" dat\fR
  393.  
  394. .fi
  395. would result in the following sequence (since the program is reading
  396. the "standard in" for information;
  397. .nf
  398.  
  399.   $ \fBmsg -S "file help.c" dat\fR
  400.   To: ihnp4!hpfcla!d_taylor
  401.   Subject: file help.c
  402.  
  403.   Enter your message, ending with ^D
  404.  
  405.   \fBthis is the message
  406.   Please don't ask me why I used this wierd mode!
  407.  
  408.   ^D\fR
  409.   <end-of-message>
  410.  
  411.   $
  412.  
  413. .fi
  414. which is reasonable behaviour!!  (not only that, but this is 
  415. almost exactly what \fB/bin/mail\fR does in the same situation!!)
  416. .sp
  417. .P
  418. Enough of this foolishness, however, let's get onto the real
  419. stuff;
  420. .sp 2
  421. .H 1 "The Main System"
  422. .P 1
  423. Upon entry to the program, the main screen will be 
  424. displayed as below;
  425. .sp
  426. .DS
  427. .ce
  428. -----------------------------------------------------------------
  429. .ce
  430. Mailbox is '/usr/mail/mymail' with 13 messages.  [Version 3.0]
  431. .nf
  432.  
  433.    1<-   Apr 3  rob        Doing anything tonight?
  434.    2     Apr 5  hplabs!joe    bug in gammon game
  435.    3     Apr 5  root        
  436.    4     Apr 6  root            (continuation of previous message)
  437. U  5     Apr 8  decvax!mouse    Re: net.music article decvax:495
  438.    6     Apr 13 John Jacobs      How can you hate RUSH?
  439.    7     Apr 15 kevin         More software requests
  440. N  8     Apr 18 games        Hi there
  441. N  9     Apr 18 Dave Taylor    EditFile.c source...
  442. N 10      Apr 23 veeger!carl    More silly stuff
  443.  
  444.  
  445. .ce 3
  446. |=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern
  447. A)lias, C)hange mailbox, D)elete, F)orward, G)roup reply, M)ail,
  448. N)ext, P)rint, R)eply, S)ave to file, Q)uit, U)ndelete, or eX)it
  449.                                                             
  450. Mail :@
  451. .fi
  452. .ce
  453. -----------------------------------------------------------------
  454. .DE
  455. .sp
  456. .P 
  457. There are a number of things to notice about this screen;
  458. .ML o 5
  459. .LI
  460. The top line always displays the current mail file, 
  461. the number of messages in the file, and the current 
  462. .I msg
  463. version number.
  464. .LI
  465. On the left side of each message is the message
  466. number which is unique for each message in the file.
  467. .LI
  468. The arrow ('<-') always points to the current message.  This is the
  469. message that the commands having default message numbers
  470. (such as D)elete, and N)ext) will work with.
  471. .LI
  472. The date associated with each message is the date the person
  473. .B sent 
  474. the message.  This is obtained by either the oldest of the
  475. ">From" line dates, or, if possible, by parsing the "Date:"
  476. line.
  477. .LI 
  478. The third field displayed is a truncated 'from' address, and will
  479. indicate whom the message is from.  Note that on the sixth and
  480. ninth messages full names appear instead of the usual machine!login
  481. format.  This is because these messages have a From line of the
  482. form:
  483. .nf
  484.   
  485.     From: fullname <address>
  486. or      From: address (fullname)
  487.  
  488. .fi
  489. which the mailer reads and displays if possible.  The \fImsg\fR
  490. mailer (version 2.1 and beyond) also generates this header line on
  491. outgoing mail.
  492. .LI
  493. The final field is the (optional) subject of the message.  Note
  494. that message 3 has no subject.
  495. .LI
  496. Message five is an 'Urgent' message (it contains the header
  497. .nf
  498.  
  499.     Priority: Urgent
  500.  
  501. .fi
  502. to make it urgent) that should be read immediately.
  503. .LI
  504. Messages 8 thru 10 are new since the last time the user read their
  505. mail - the "N" in the leftmost margin indicates this.
  506. .LI
  507. A maximum of ten messages are displayed at one time*.
  508. .FS \*
  509. On terminals with greater than 25 lines, more messages will be 
  510. displayed automatically.  
  511. .FE
  512. Further into
  513. the document we'll learn how to change 'pages' in the mailbox. 
  514. .LI
  515. The three line mini-menu will always 
  516. indicate what commands are available at 
  517. the current moment.  
  518. ' This display can be inhibited by the '-m' (menu) starting option.
  519. .LI
  520. Finally, the '@' character indicates where the cursor would be, awaiting
  521. your input.
  522. .LE
  523. .P
  524. The typical action at this point is to use the 
  525. .I <return>
  526. key to read the current message.  This particular option isn't
  527. noted in the mini-menu, but choosing the '?=help' option will
  528. inform you of a number of choices other than those in the 
  529. basic menu!
  530. .P
  531. Pressing this key will clear the screen and display the first page
  532. of the message.  At the bottom of the page, the system will write
  533. either;
  534. .sp
  535. .tl 'Please press <space> to continue''<xx> lines left'
  536. .sp
  537. or
  538. .sp
  539. .tl 'Please press <space> to return'
  540. .P 0
  541. These indicate how much of the current message has been read: 'continue'
  542. indicates the presence of
  543. at least one more line of information (the exact number will
  544. be indicated on the right hand side as 'xx lines left').  Pressing
  545. <return> rather than <space> will automatically return you to the main
  546. system level at any page of a message.
  547. .P
  548. When the message continues onto another page the \fImsg\fR mailer will
  549. also indicate how many lines are left in the message...
  550. .P
  551. If resolve-mode is turned off (see the 'resolve' flag)
  552. the current message pointer 
  553. (the arrow) will be incremented after reading the message
  554. and will point to the next message in
  555. the list.  
  556. .P
  557. As you can see, it would be quite simple to quickly read through
  558. all the pending mail by repeatedly using the
  559. .I <return>
  560. command at the menu level, and the <space> bar while reading 
  561. each message!
  562. .P
  563. While reading is perhaps the most fundamental function that the
  564. .I msg
  565. program performs, there are a number of other options available,
  566. namely;
  567. .sp
  568. .VL 25 0 1
  569. .LI "Command"
  570. Action
  571. .LE
  572. .sp
  573. .VL 22 3 1
  574. .LI "|"
  575. Pipe current message to specified command.
  576. .LI "!"
  577. Shell escape.
  578. .LI "?"
  579. A help screen listing commands
  580. .LI "+, <space>, or <NEXT>"
  581. Next page of headers
  582. .LI "-, or <PREV>"
  583. Previous page of headers
  584. .LI "=, or <HOME>"
  585. Set current message to 1
  586. .LI "*, or <SHIFT>-<HOME>"
  587. Set current to last message.
  588. .LI "<n>"
  589. Set current message to n
  590. .sp
  591. .LI "a"
  592. Alias, change to 'alias' mode 
  593. .LI "c"
  594. Change current mail file
  595. .LI "d"
  596. Delete current message
  597. .LI "f"
  598. Forward message to specified user
  599. .LI "g" 
  600. Group reply - reply to everyone who received the current message
  601. .LI "h"
  602. Display message + headers
  603. .LI "j"
  604. Increment current message by one
  605. .LI "k"
  606. Decrement current message by one
  607. .LI "m"
  608. Mail to arbitrary user(s)
  609. .LI "n or <return>"
  610. Next message (Read current, then increment)
  611. .LI "o"
  612. Option.  Alter current options.
  613. .LI "p"
  614. Print current message.
  615. .LI "r"
  616. Reply to the author of current message
  617. .LI "s"
  618. Save current message to file
  619. .LI "t"
  620. The current time and date is displayed
  621. .LI "q"
  622. Quit - mail deleted, saved in mbox or left.
  623. .LI "u"
  624. Undelete current message
  625. .LI "v"
  626. Variables.  Display current variables.
  627. .LI "x"
  628. Exit - don't record as read, don't save...
  629. .sp
  630. .LI "^L"
  631. Rewrite screen.
  632. .LI "^M (<return>)"
  633. Read current message
  634. .LI "^Q, ^Z, DEL"
  635. Exit - don't record as read, don't save...
  636. .LE
  637. .sp
  638. .P 0
  639. That are all the commands available at the main level of the
  640. .I msg
  641. program!  Now you can see why it is nice to leave the three-line
  642. menu displayed!
  643. .sp 2
  644. .P
  645. As an example, let's enter a series of commands and indicate
  646. what the display would be after each one;
  647. .sp
  648. .P 0
  649. First off, let's go to the next page of mail with '+';
  650. .sp
  651. .DS
  652. .nf
  653. .ce
  654. -----------------------------------------------------------------
  655. .ce
  656. Mailbox is '/usr/mail/mymail' with 13 messages.  [Version 3.0]
  657. .nf
  658.  
  659. N 11<-    Apr 27 Jack        Wanna buy some albums cheap?
  660. N 12      Apr 28 Jack        Cancel the previous offer!
  661. N 13      Apr 30 sdcsvax!dx    Moving day (long)        
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671. .ce 3
  672. |=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern
  673. A)lias, C)hange mailbox, D)elete, F)orward, G)roup reply, M)ail,
  674. N)ext, P)rint, R)eply, S)ave to file, Q)uit, U)ndelete, or eX)it
  675.  
  676. Mail :@
  677. .fi
  678. .ce
  679. -----------------------------------------------------------------
  680. .DE
  681. .P 1
  682. We need to move the current message pointer to message 11, so
  683. type in '11', then let's read the new current message by
  684. using the 
  685. .I next
  686. command (typing <return>)...
  687. .sp 
  688. .DS
  689. .nf
  690. .ce
  691. -----------------------------------------------------------------
  692. .sp
  693. Message #11 from Jack          Mailed December 7, 1984 at 8:45 pm
  694.  
  695. Hey Dave! I've got some old AC/DC and KISS albums, and as I know
  696. you are a collector, do you want to buy them off of me before
  697. I make ashtrays out of them (or frisbees...)?
  698.  
  699.             Humourously,
  700.                     Jack The Gripper
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708. Please press <space> to return: @
  709. .sp
  710. .ce
  711. -----------------------------------------------------------------
  712. .DE
  713. .sp
  714. .fi
  715. .P
  716. Needless to say, we can't let this message go by without replying!
  717. So let's press the <space> bar to return to the main menu, 
  718. then use the
  719. .I "reply"
  720. command to respond.
  721. .P
  722. After pressing the 'r' key, the program asks if a copy of the source
  723. message is desired (the character under the cursor indicates the
  724. default if <return> is pressed.  In this case, the default is 'no');
  725. .sp
  726. .nf
  727. copy source message? (y/n) @
  728. .fi
  729. .P
  730. We choose to answer no, so press the 'n' key.  Next 
  731. .I msg
  732. verifies that the subject is okay;
  733. .sp
  734. .nf
  735. Subject: Re: Wanna buy some albums cheap?@
  736. .fi
  737. .sp
  738. Typing anything other than <return> will allow us
  739. to change the subject to something more appropriate.
  740. Furthermore, if we choose to type our "kill line"
  741. character (the same as the one the shell uses,
  742. probably Control-U or Control-X) the entire line will
  743. be erased.
  744. We decide, however, to leave it be and press return.
  745. .sp
  746. Finally, we're asked if we want to send copies of this
  747. message to anyone.  We don't, so we press <return> one
  748. more time.
  749. .P
  750. The program then puts us
  751. in the
  752. .I vi
  753. editor (the default, assuming no other editor specified 
  754. by the '.msgrc' variable "editor") with a blank file.
  755. .P
  756. After having entered a suitable reply, and left the editor,
  757. the 
  758. .I msg
  759. system then verifies that we really want to send the message with;
  760. .sp
  761. Are you sure you want to send this message? (y/n) @
  762. .sp
  763. To which the response is 'y' for 'yes'.  It then sends the message off
  764. to Jack, who will receive it hopefully quite soon (or at least
  765. before he makes ashtrays out of the albums!)
  766. .sp
  767. .P
  768. Also, if we have a file called \fB".msgheaders"\fR in our home
  769. directory, the mailer will include those headers in the 
  770. outbound message.  This is to allow custom (personalized)
  771. mail, especially headers like "Organization:" and "Location:".
  772. .sp
  773. .P
  774. Message 11 is still the current message,
  775. so, now that we have saved it, let's mark it for deletion by
  776. using the
  777. .I delete
  778. command 'd'.
  779. .P
  780. The screen is now;
  781. .sp
  782. .nf
  783. .DS
  784. .ce
  785. -----------------------------------------------------------------
  786. .ce
  787. Mailbox is '/usr/mail/mymail' with 13 messages.  [Version 3.0]
  788. .nf
  789.  
  790. N 11    * Apr 27 Jack        Wanna buy some albums cheap?
  791. N 12<-    Apr 28 Jack        Cancel the previous offer!
  792. N 13      Apr 30 sdcsvax!dx    Moving day (long)        
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803. .ce 3
  804. |=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern
  805. A)lias, C)hange mailbox, D)elete, F)orward, G)roup reply, M)ail,
  806. N)ext, P)rint, R)eply, S)ave to file, Q)uit, U)ndelete, or eX)it
  807.  
  808. Mail :@
  809. .fi
  810. .ce
  811. -----------------------------------------------------------------
  812. .DE
  813. .sp
  814. .P
  815. Now lets go back to the first page of messages by typing '=';
  816. .sp
  817. .DS
  818. .ce
  819. -----------------------------------------------------------------
  820. .ce
  821. Mailbox is '/usr/mail/mymail' with 13 messages.  [version 2.2]
  822. .nf
  823.  
  824.    1<-   Apr 3  rob        Doing anything tonight?
  825.    2     Apr 5  hplabs!joe    bug in gammon game
  826.    3     Apr 5  root        
  827.    4     Apr 6  root            (continuation of previous message)
  828. U  5     Apr 8  decvax!mouse    Re: net.music article decvax:495
  829.    6     Apr 13 John Jacob       How can you hate RUSH?
  830.    7     Apr 15 kevin         More software requests
  831. N  8     Apr 18 games        Hi there
  832. N  9     Apr 18 Dave Taylor    EditFile.c source...
  833. N 10     Apr 23 veeger!carl    More silly stuff
  834.  
  835.  
  836.  
  837. .ce 3
  838. |=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern
  839. A)lias, C)hange mailbox, D)elete, F)orward, G)roup reply, M)ail,
  840. N)ext, P)rint, R)eply, S)ave to file, Q)uit, U)ndelete, or eX)it
  841.  
  842. Mail :@
  843. .ce
  844. -----------------------------------------------------------------
  845. .DE
  846. .fi
  847. .sp
  848. .P
  849. Gee..note five not only looks mildly interesting but it's an 
  850. Urgent message too!  So 
  851. let's read it by typing '5'<return>
  852. to make that the current message, and press <return> again
  853. to read it.  After reading
  854. the message we decide that this seems like a message worth
  855. keeping in the 'music' mailbox, so lets do that by using
  856. the 
  857. .I "save to file"
  858. command!
  859. .P
  860. Pressing 's' results in the 
  861. .I msg
  862. system prompting;
  863. .P 0
  864. Save to what file : @
  865. .P 0
  866. to which we reply '=/music'.  The file is then saved in the
  867. directory we specified as mail home via the '.msgrc'
  868. variable "maildir". After saving, the "Mail:"
  869. prompt returns, with message 5 marked for deletion and the
  870. current message pointer incremented to message 6.
  871. .P
  872. Before we finish up, we suddenly remember that one of the 
  873. messages was supposed to be about how to write decent 
  874. documentation for Unix systems, so let's try to find it...
  875. .P
  876. First off, we'll move back to message one with the <HOME>
  877. key (you'll need to use the "-k" starting option and be on
  878. an HP terminal for this to work!) and then use the '/'
  879. pattern matching command:
  880. .nf
  881.  
  882. Mail: Pattern              / = match anywhere in messages
  883. Match pattern: @
  884.  
  885. .fi
  886. we'll type in 'document' and see if the system can find it.
  887. After a brief second or two it returns 'pattern not found.'
  888. Hmm...maybe it's not either the from or the subject of
  889. any of the messages...In case, let's try using the new
  890. .I "match anywhere in message" 
  891. command;
  892. .nf
  893.  
  894. Mail: @
  895.  
  896. .fi
  897. To which we type '/' for pattern matching;
  898. .nf
  899.  
  900. Mail: Pattern              / = match anywhere in messages
  901. Match pattern: @
  902.  
  903. .fi
  904. Now we'll use '/' again to get the match anywhere in file
  905. option, and then get the prompt;
  906. .nf
  907.  
  908. Match pattern (in entire mailbox): @
  909.  
  910. .fi
  911. to which we respond 'document' again.  
  912. .P
  913. The
  914. .B msg
  915. mailer then searches through each line of all the messages in 
  916. the file and moves the current message pointer to message 
  917. number 7.  A quick check reveals that this message indeed
  918. contains the word 'document', but it's not the one we want,
  919. so we're going to just get outta here!
  920. .P
  921. We've had enough mail for today, so lets quit, saving
  922. all messages in our mailbox as defined in the '.msgrc' file, except
  923. messages 5 and 11, which are marked for deletion.
  924. .P
  925. .I Quit
  926. prompts;
  927. .sp
  928. .nf
  929. Delete messages? (y/n) @
  930. .fi
  931. .sp
  932. to which we answer 'y' for yes.  The next prompt is then;
  933. .sp
  934. .nf
  935. Keep mail in incoming mailbox? (y/n) @
  936. .fi
  937. .sp
  938. To which we also answer yes...the program then quickly saves
  939. the files, removing message 5 and 11 as it goes along, and exits.
  940. .sp
  941. .H 1 "Responses..."
  942. .sp
  943. .P
  944. This section will discuss each command in the 
  945. .I msg
  946. program in more detail than above, including the 
  947. prompts the user can expect upon executing the
  948. command, the meaning of different options etc etc.
  949. .sp
  950. .VL 10 3
  951. .LI |
  952. Pipe.  This command allows you to pipe the current message
  953. through other filters as you desire.  The shell used for
  954. the entire command will be either the one specified in
  955. your ".msgrc" file, or, if none, /bin/sh.
  956. .LI !
  957. Shell.  This allows you to send a command to the shell without
  958. leaving the program. 
  959. .LI ?
  960. Help.  This command produces a two-page display that details
  961. all the commands available in a reference guide format.  
  962. .LI \/
  963. Pattern match.  This command, on the top level, allows the
  964. user to search through all the from and subject lines of
  965. the current mailbox starting at the current message and
  966. continuing through the end.  If the first character of the
  967. pattern is a '/', then the program will try to match the
  968. specified pattern against ANY line in the mailbox.  Again,
  969. this works from one after the current message through the
  970. end.
  971. .LI <n>
  972. Specify new current message.  Typing in any of the digits one
  973. thru nine will result in the 
  974. .I msg
  975. program producing the prompt 'Set current to : n', where 'n' is
  976. the digit entered.  
  977. Note that changing the current message to a message not on the 
  978. current page of the headers will result in a new page of headers
  979. being displayed.
  980. .LI a
  981. Alias.  The alias system is a way by which more complex mail addresses
  982. can be shortened for the mail user.  For example;
  983. .P 0
  984. joe, blow : Joe Blow : veeger!hpcnoe!hpcfla!jblow
  985. .P 0
  986. which allows mail to 'joe' with the system expanding
  987. the address properly.  As is obvious, this not only saves remembering
  988. complex addresses, it also allows the address to be optimized to
  989. go through the minimum number of machines without anyone having to
  990. be informed of the change.  A more detailed discussion can
  991. be found in the section entitled 'The Alias System'.
  992. .LI c
  993. Change mailbox.  Specifying this command allows the user to change
  994. the mailbox file that is currently being read.  This is intended 
  995. for perusal and reply to previously archived messages.
  996. The prompt is 'Name of new mailbox : ' and entering <return>
  997. cancels the operation, while entering a filename causes the program
  998. to read that file as the new mailbox file, if possible.
  999. As with the "save" command, this command expands filenames
  1000. with '~' being your home directory and '=' being your
  1001. MAILDIR directory, if defined.  This command also allows the
  1002. special character '!' to be used to allow you to change to
  1003. the default incoming mailbox.
  1004. .LI "d, u"
  1005. Delete and Undelete.  Neither of these two commands have any prompts
  1006. and indicate their action by either adding an asterisk to the current
  1007. message index entry (indicating deletion pending) or removing the
  1008. asterisk (indicating that the deletion is cancelled).
  1009. .LI f
  1010. Forward.  Allows the user to forward the current message to another user.  
  1011. This copies the message into the edit
  1012. buffer and allows the user to add their own message too.
  1013. The prompt is 'Forward to:' and will expand an alias if
  1014. entered.
  1015. .LI "j, k"
  1016. These two keys work similarly to what they would do in 'vi' or
  1017. any of the other screen oriented programs.  The 'j' key moves
  1018. the current message pointer down to the next message (going to
  1019. the next page if needed) and the 'k' key moves the current
  1020. message pointer back to the previous message (also changing 
  1021. pages if needed)
  1022. .LI m
  1023. Mail.  Send mail to a specified user.  The prompt that is associated
  1024. with this command is 'Send mail to :'.  Entering an alias name results
  1025. in the full address being rewritten in parenthesis immediately.  This
  1026. prompt is followed by 'Subject:' which allows the user to title their
  1027. note.  The final field is 'Copies to: ', which allows other people
  1028. specified to receive "carbon copies" of the message. 
  1029. Upon entering all three items the 
  1030. .I vi
  1031. editor (or any other editor specified by $EDITOR) 
  1032. is invoked and the message can be composed.
  1033. .LI n
  1034. Next message.  See above.
  1035. .LI o
  1036. Options.  This is a small subsystem of the 
  1037. .I msg
  1038. system with the various options selected by their first
  1039. letter, '1' enabling the option, '0' disabling it
  1040. and <return> leaving it unchanged. 'r' returns to
  1041. the main system.
  1042. .LI p
  1043. Print message.  This allows you to print out the current
  1044. message to a previously defined printer (see the section
  1045. on the '.msgrc' discussing the "print" variable)
  1046. .LI q
  1047. Quit.  This command's action is dependent on the current state of
  1048. the 
  1049. .I msg
  1050. program.
  1051. For example, if the current mailbox is the default mailbox the messages
  1052. that are not deleted are saved in the file $home/mbox, whereas
  1053. if it is a specified mailbox the to-be-deleted messages are 
  1054. removed from the
  1055. file.  The possible prompts are 'Save to mailbox?' if the default mailbox
  1056. is being read and there is at least one message to save, 'Delete all
  1057. messages' if all messages in any mailbox are marked for deletion 
  1058. or 'Delete message(s)?'
  1059. if not reading the default mailbox and there are some messages that
  1060. should be saved.  A response of 'n' (no) to any of these questions will
  1061. result in the quit command aborting, and the files being untouched.
  1062. .LI r
  1063. Reply.  Reply to the author of the current message.  If
  1064. the autocopy flag is not specified, the program will 
  1065. prompt 'Copy Message? (y/n)' to which the user can specify 
  1066. whether a copy of the source message is to be copied into the edit
  1067. buffer, or not.  If copied in, all lines from the message are 
  1068. prepended with the prefix character sequence, as specified in
  1069. the users ".msgrc" file.
  1070. .LI s
  1071. Save to file.  As demonstrated in the above example, this command
  1072. allows the current message to be copied into an arbitrary file.
  1073. If there is anything in the file currently the
  1074. message is appended to the end, otherwise the file is created
  1075. containing only the message.  The prompt for this command
  1076. is 'Save to file : '.  A response of <return> cancels the command
  1077. and returns the user to the system prompt.
  1078. After saving a file, the message is marked for deletion and
  1079. the current message pointer is incremented.
  1080. There are two available meta-characters when specifying a 
  1081. filename too - '~' as the first character expands to your
  1082. home directory, and '=' as the first character expands to
  1083. the mail folder directory defined via the 'maildir' 
  1084. variable in the users ".msgrc" file.
  1085. .LI t
  1086. Time.  This simply displays the current date and time in a nice
  1087. readable format.
  1088. .LI v
  1089. Variables.  This is also a small subsystem of the 
  1090. .I msg
  1091. system allowing you to alter the value of various 
  1092. .I msg
  1093. variables.  The variables that you can change are
  1094. the 'EDITOR' variable which determines what editor to 
  1095. use when you compose a message,
  1096. the 'MAILBOX' variable which indicates where mail is
  1097. to be put after being read, and
  1098. the 'USERNAME' variable.  (Note that only the superuser
  1099. can change their username within the program)
  1100. .LI x
  1101. Exit.  This is functionally the same as answering 'n'o to the 
  1102. .I quit
  1103. command prompt, and simply leaves the program in the quickest
  1104. possible manner.  This command can also occur from typing
  1105. DELETE, control-Q or control-Z, all of which are also 
  1106. .I exit
  1107. commands.
  1108. .LE
  1109. .sp 2
  1110. .H 1 "Special Outgoing Mail Processing"
  1111. .sp
  1112. .P
  1113. There are a few extra features that the mailer offers on
  1114. outgoing mail that are worthy of mention;
  1115. .sp
  1116. .P
  1117. The first, and probably the most exciting feature, is the
  1118. ability to send \fBencrypted\fR mail!  To do this is 
  1119. extremely simple:  You need merely to have two 'key lines'
  1120. "[encode]" and "[clear]" in the message body.
  1121. .P
  1122. Consider the following outgoing message:
  1123. .nf
  1124.  
  1125.     Joe,
  1126.         Remember that talk we had about Amy?  Well,
  1127.     I talked to my manager about it and he said...
  1128.  
  1129.     uhh...better encrypt this...the usual 'key'...
  1130.  
  1131.     [encode]
  1132.  
  1133.         He said that Amy was having family problems
  1134.     and that it had been affecting her work.
  1135.  
  1136.         Given this, I went and talked to her, and 
  1137.     told her I was sorry for getting angry.  She said
  1138.     that she understood.
  1139.  
  1140.         We're friends again!!
  1141.     [clear]
  1142.     
  1143.         Exciting stuff, eh?   
  1144.  
  1145.                      Mike
  1146.  
  1147. .fi
  1148. While this is obviously quite readable while being typed into 
  1149. the editor, as soon as the message is confirmed as wanting
  1150. to be sent, the \fImsg\fR mailer prompts with;
  1151. .nf
  1152.  
  1153.     Enter encryption key: @
  1154.  
  1155. .fi
  1156. and accepts a key (or series of 8 or less characters) without
  1157. echoing them to the screen.  After entry, it will ask for the
  1158. same key again to confirm it, then *poof* it will encrypt and
  1159. send the mail!
  1160. .P
  1161. If you have the "copy" option enabled, the program will save
  1162. your copy of the message encrypted too.  (This is to ensure
  1163. the privacy and security of your archived mail too!)
  1164. .P
  1165. If the mailer doesn't ask for the encryption key, it's because
  1166. you don't have the '[encode]' entered as the first 8 characters
  1167. of the line.  It MUST be so for this to work!!
  1168. .P
  1169. On the other end, a person receiving this mail (they must also
  1170. be using \fImsg\fR to receive it, since this mailer has a
  1171. unique encryption program) will be reading the
  1172. message and then suddenly be prompted;
  1173. .nf
  1174.  
  1175.     Enter decryption key: @
  1176.  
  1177. .fi
  1178. and will again be asked to re-enter it to confirm.  The
  1179. program will then on-the-fly decrypt the mail and display
  1180. each line as it is decoded.  The '[clear]' line signifies
  1181. that the block to encrypt is done.
  1182. .P
  1183. For those sites not running \fImsg\fR, I also have
  1184. available the encryption code as a separate program
  1185. suitable for a filter for use with other mailers...
  1186. .sp
  1187. .P
  1188. The other option on outgoing mail is the ability to
  1189. specify what section of the message you want to have
  1190. archived (assuming "copy" is enabled) and what section
  1191. you don't.  This is most useful for sending out source
  1192. file listings and so on...
  1193. .P
  1194. To indicate the end of the section that should be
  1195. saved in the archive, you need merely to have the
  1196. line
  1197. .nf
  1198.  
  1199.     [no save]
  1200.  
  1201. .fi
  1202. appear by itself on a line.  This will be removed from 
  1203. the outgoing mail, and will indicate the last line of
  1204. the message in the saved mail.
  1205. .sp 2
  1206. .H 1 "The Mail Archive File"
  1207. .sp
  1208. .P
  1209. The format of the mail saved to the archive file is also
  1210. worth a quick discussion.  Unlike the usual exact copy
  1211. of the entire header section, the archived mail has the
  1212. following header;
  1213. .nf
  1214.  
  1215.     From To:<name> 15 Jan 1985 4:54:30 MST
  1216.     Original-To: <address>
  1217.     Subject: <subject>
  1218.  
  1219.     <message body>
  1220.  
  1221. .fi
  1222. The first line, the 'From' line, is deliberately mangled
  1223. with the occurance of the 'To:<name' to ensure that when
  1224. you are perusing your archive file with the mailer that
  1225. you see WHO the message was TO, since they're all going
  1226. to be FROM you!!  The <name> will either be the machine!login
  1227. of the person, or, if used as an alias, it will be the 
  1228. alias name.
  1229. .P
  1230. To read this file, you can use the mailer, choosing the 
  1231. "C)hange mailbox" command, or start up specifying your
  1232. archive file as the mailbox to read.
  1233. .sp 2
  1234. .H 1 "Using MSG with the Notes System"
  1235. .sp
  1236. .P
  1237. A new and innovative feature in the 3.0 release of the 
  1238. .B msg
  1239. program is the ability to read files saved by the notes
  1240. system and display them as individual messages.  Unfortunately,
  1241. the notes software does not currently save a note with
  1242. the subject line, however, so the mailer uses the next best
  1243. thing and displays each note in the form:
  1244. .nf
  1245.  
  1246.     1  Apr 5  hplabs!kundler    Note from group net.unix-wizards
  1247.     2  Apr 7  hplabs!richards    Note from group net.unix-wizards
  1248.  
  1249. .fi
  1250. and so on.  The individual notes can be replied to by using the
  1251. .I reply
  1252. command, as with normal mail, and the mailer will modify it's
  1253. behaviour to work with this particular brand of mail file.
  1254. .P
  1255. How does the mailer know if it's reading a file that contains
  1256. normal mail versus a saved set of notes?  By checking the
  1257. first line of the file - if it's the header line that notes
  1258. emits (ie "/***** host:login / notesgroup / date **/") then
  1259. the file is considered to be a notes file.  If not, the default
  1260. for unknown files is to assume they're mail files.
  1261. .sp 2
  1262. .H 1 "The Alias System"
  1263. .sp
  1264. .P
  1265. As mentioned previously, there exists in the
  1266. .I msg
  1267. system a set of aliases that associate
  1268. an arbitrary word (such as a persons name) to a complex
  1269. address or group.  
  1270. The advantages are readily apparent; rather than
  1271. remembering an address of the form;
  1272. .P 0
  1273. machine1!machine2!machine3! ... !machineN!account
  1274. .P 0
  1275. the user merely has to remember a single word.  
  1276. .P
  1277. Two alias tables are available for a each
  1278. user within 
  1279. .I msg,
  1280. namely the system alias file and the users' alias file.  The
  1281. system alias file is created and maintained (by the system administrator)
  1282. by editing the file '/usr/mail/.alias_text' as described
  1283. in the documentation with the 
  1284. .I newalias
  1285. command, then running the 
  1286. .I newalias 
  1287. program.
  1288. .P
  1289. An individual user can also have an alias file which works
  1290. in conjunction with the system aliases.  To do this, they
  1291. need merely to peruse the documentation for the 
  1292. .I newalias
  1293. command and create a file as indicated therein.  After 
  1294. executing the program, the aliases will be available
  1295. for using from within 
  1296. .I msg.
  1297. .P
  1298. The command 
  1299. .I checkalias
  1300. is also useful to ensure that the aliases
  1301. are installed correctly.
  1302. .P
  1303. Within
  1304. .I msg,
  1305. however, the alias system acts as an entirely different program, with
  1306. it's own commands and own mini-menu.  The menu replaces the
  1307. standard mini-menu with;
  1308. .sp
  1309. .DS
  1310. .nf
  1311. .ce
  1312. ---------------------------------------------------------------------
  1313. .sp
  1314. .ce
  1315. Alias commands
  1316. .sp
  1317. .ce
  1318. A)lias current message, C)heck alias, M)ake user alias, R)eturn
  1319. .sp 2
  1320. Alias: @
  1321. .ce
  1322. ---------------------------------------------------------------------
  1323. .sp
  1324. .DE
  1325. .fi
  1326. .P 0
  1327. The commands are;
  1328. .VL 10 3
  1329. .LI a
  1330. Alias current message.  
  1331. This allows the user to create an alias that has the
  1332. return address of the current message as the address field of
  1333. the alias.  It prompts for a unique alias name.   Important
  1334. note: when you alias an address in this fashion, the mailer
  1335. will try to minimize the amount it needs to store by
  1336. iteratively comparing machine names in the path with the
  1337. machines in the pathalias database.  Once it finds an entry
  1338. the address will be saved at that point.   For further 
  1339. information, please see the "Msg Alias System Guide".
  1340. .LI c
  1341. Check alias.  This is a simple way of checking what is in the alias
  1342. database - it prompts for an alias name, and returns the address
  1343. associated with that name or the error message 'alias not found'
  1344. as appropriate.  
  1345. .LI m
  1346. Make user alias.  This will prompt for a unique alias name and
  1347. then for an address.  The information provided will be added
  1348. to your individual alias_text file ($home/.alias_text) and 
  1349. then added to the database.
  1350. .LI r
  1351. Return.  Return to the main level of the 
  1352. .I msg
  1353. program.
  1354. .LE
  1355. .sp 2
  1356. .H 1 "While We're Talking Aliases..."
  1357. .P
  1358. Another feature worthy of discussion, since it's been getting
  1359. lots of veiled references throughout this document, is the system
  1360. alias section.  This is implemented using the uucp pathalias 
  1361. database, with a file (whose location is specified in the hdrs/sysdefs.h
  1362. file - see the Configuration Guide) in the format:
  1363. .nf
  1364.  
  1365.   hostname <tab> address!%s
  1366.  
  1367. .fi
  1368. The actual details of the file are, suprise suprise, located in 
  1369. the Alias System Users Guide.
  1370. .P
  1371. Anyway, to use them is quite simple...when specifying the address
  1372. of someone, you can either have an alias for them already, resond
  1373. to their mail to you, or use the system alias feature!
  1374. .P
  1375. Enough hype, right?  Okay...to use this feature, you specify an
  1376. address by either "machine!person" ignoring if your specific
  1377. machine can talk directly to the machine specified, or, if you
  1378. prefer the ARPANET addressing scheme, "person@machine".  When
  1379. you enter the address as specified, the mailer will quickly
  1380. search through the pathalias database file and expand the
  1381. specified address to be a legitimate routing address.
  1382. .P
  1383. What's really nice about this is that the address that we're
  1384. going to send to can be either on ARPA, CSNET, BITNET, uucp,
  1385. or any other network.  The method of specifying the basic
  1386. address is the same regardless!
  1387. .P
  1388. For example, mail to me could be sent as either "hpfcla!d_taylor"
  1389. (or "hpfcla!hpcnof!d_taylor", with the first machine name being
  1390. expanded) or "d_taylor@hpfcla".  \fBmsg\fR will expand them
  1391. both in the same manner.
  1392. .P
  1393. As the song goes, check the alias guide...
  1394. .sp 2
  1395. .H 1 "Expert Mail Users and Debugging the Mailer"
  1396. .P
  1397. There are some additional facilities available in the
  1398. .I msg
  1399. mailer for those people who are knowledgable about 
  1400. mail protocols, or trying to debug/track down a 
  1401. problem.
  1402. .P
  1403. The 'h' command at the outermost level of the mailer
  1404. will display the current message ignoring the current
  1405. setting of the 'weed' option.  This is most useful
  1406. for answering questions of the form "I wonder what
  1407. this guy put in his header?" and such.  This command
  1408. does not show up on the mini-menu because it is somewhat
  1409. esoteric, but it DOES appear on the '?' help screen (can
  1410. you find it there?).
  1411. .P
  1412. The '@' command at the outermost level of the mailer
  1413. will output a screen of debugging information,
  1414. including the number of lines and 
  1415. offsets of each of the message in the current mailbox.
  1416. .P
  1417. The '#' command at the outermost level of the mailer
  1418. will display the entire stored 'record structure' for
  1419. the current message.
  1420. .P
  1421. The '%' command at the outermost level of the mailer
  1422. will display the full computed return address of the
  1423. current message.
  1424. .P
  1425. Starting up 
  1426. .I msg
  1427. with the "-d" debug option will create a file called
  1428. .B Msg.debug.info
  1429. in your home directory and contain a wealth of useful
  1430. information (to me, at least!) to aid in tracking down
  1431. what errors are occuring and why.  With this option
  1432. on, most everything acts the same with the exception
  1433. of when you get new mail while in the mailer - it will
  1434. indicate "New mail: N bytes" rather than the usual
  1435. "New mail has arrived...hang on...".
  1436. .sp
  1437. .P
  1438. If there are any problems with the mailer,  please try
  1439. to recreate the error with the debug option enabled
  1440. before sending defect reports my way.
  1441. .P
  1442. .sp
  1443. One final note: all error numbers reported by the program
  1444. are defined in the HP-UX Reference Manual in Errno(2).
  1445. .sp
  1446. .H 1 "Credits and so on"
  1447. .P
  1448. This mailer has been evolving over the past year or so with
  1449. some extremely valuable input from the following people at
  1450. Hewlett Packard;
  1451. Mark Laubach, Walt Underwood, Tw Cook, Larry Fenske, Rob Sartin,
  1452. and of course Carl Dierschow.
  1453. There have been many others, to numerous to mention, that
  1454. have inspired me with questions like "why can't the 
  1455. mailer..." or "why does it do that?"
  1456. .P
  1457. Also helpful was the ability to have my 'own' machine to 
  1458. close up the many many iterative loops that this software
  1459. has gone through - since being on a big multi-user machine
  1460. tends to slow it down to a standstill...
  1461. .P
  1462. Finally, it's also been a very useful experience overall,
  1463. confirming my beliefs that iterative software design and
  1464. keeping a close watch on users (not to mention an open
  1465. mind and mailbox!) improves a product manyfold.  
  1466. .P
  1467. Incidentally, this entire mail system, including this
  1468. documentation, is 
  1469. .nf
  1470.  
  1471. .ce
  1472. (C) Copyright 1986 Dave Taylor
  1473. END-OF-FILE
  1474.  
  1475. size=`wc -c < doc/Msg.guide`
  1476.  
  1477. if [ $size != 44850 ]
  1478. then
  1479.   echo Warning: doc/Msg.guide changed - should be 44850 bytes, not $size bytes
  1480. fi
  1481.  
  1482. chmod 644 doc/Msg.guide
  1483.  
  1484. if [ ! -d hdrs ]
  1485. then
  1486.   echo creating directory hdrs
  1487.   mkdir hdrs
  1488. fi
  1489.  
  1490. # ---------- file hdrs/curses.h ----------
  1491.  
  1492.  
  1493. if [ -f hdrs/curses.h ]
  1494. then
  1495.   echo File 'hdrs/curses.h' already exists\!
  1496.   exit 1
  1497. fi
  1498.  
  1499. echo extracting file hdrs/curses.h...
  1500. cat << 'END-OF-FILE' > hdrs/curses.h
  1501. /***             curses.h            ***/
  1502.  
  1503. /*** (C) Copyright 1986 Dave Taylor            ***/
  1504.  
  1505.      /*** Include file for seperate compilation.  ***/
  1506.  
  1507. #define OFF        0
  1508. #define ON         1
  1509.  
  1510. int  InitScreen(),      /* This must be called before anything else!! */
  1511.  
  1512.      ClearScreen(),      CleartoEOLN(),
  1513.  
  1514.      MoveCursor(),       PutLine(),
  1515.      CursorUp(),         CursorDown(), 
  1516.      CursorLeft(),       CursorRight(), 
  1517.  
  1518.      StartBold(),        EndBold(), 
  1519.      StartUnderline(),   EndUnderline(), 
  1520.      StartHalfbright(),  EndHalfbright(),
  1521.      StartInverse(),     EndInverse(),
  1522.     
  1523.      transmit_functions(),
  1524.  
  1525.      Raw(),              ReadCh();
  1526.  
  1527. char *return_value_of();
  1528. END-OF-FILE
  1529.  
  1530. size=`wc -c < hdrs/curses.h`
  1531.  
  1532. if [ $size != 637 ]
  1533. then
  1534.   echo Warning: hdrs/curses.h changed - should be 637 bytes, not $size bytes
  1535. fi
  1536.  
  1537. chmod 644 hdrs/curses.h
  1538.  
  1539. # ---------- file hdrs/defs.h ----------
  1540.  
  1541.  
  1542. if [ -f hdrs/defs.h ]
  1543. then
  1544.   echo File 'hdrs/defs.h' already exists\!
  1545.   exit 1
  1546. fi
  1547.  
  1548. echo extracting file hdrs/defs.h...
  1549. cat << 'END-OF-FILE' > hdrs/defs.h
  1550. /**        defs.h            **/
  1551.  
  1552. /**  define file for msg mail system.  **/
  1553.  
  1554. /**  (C) Copyright 1985 Dave Taylor    **/
  1555.  
  1556. #include "sysdefs.h"    /* system/configurable defines */
  1557.  
  1558. #define VERSION        "3.2"    /* version number! */
  1559.  
  1560. #define SLEN        256    /* long for ensuring no overwrites... */
  1561. #define SHORT        5    /* super short strings!              */
  1562. #define NLEN        20    /* name length for aliases            */
  1563. #define SHORT_SLEN      40
  1564. #define LONG_SLEN    250    /* for mail addresses from remote machines! */
  1565. #define LONG_STRING    500    /* even longer string for group expansion   */
  1566. #define VERY_LONG_STRING 2500    /* huge string for group alias expansion    */
  1567.  
  1568. #define BREAK        (char)  0    /* default interrupt    */
  1569. #define BACKSPACE    (char)  8    /* backspace character  */
  1570. #define TAB        (char)  9       /* tab character        */
  1571. #define RETURN        (char) 13    /* carriage return char */
  1572. #define LINE_FEED    (char) 10    /* line feed character  */
  1573. #define COMMA        ','        /* comma character      */
  1574. #define SPACE        ' '        /* space character      */
  1575. #define DOT        '.'        /* period/dot character */
  1576. #define BANG        '!'        /* exclaimation mark!   */
  1577. #define AT_SIGN        '@'        /* at-sign character    */
  1578. #define PERCENT        '%'        /* percent sign char.   */
  1579. #define ESCAPE        (char) 27    /* the escape        */
  1580.  
  1581. #define STANDARD_INPUT  0        /* file number of stdin */
  1582.  
  1583. #ifndef TRUE
  1584. #define TRUE        1
  1585. #define FALSE        0
  1586. #endif
  1587.  
  1588. #define OUTGOING    0        /* defines for lock file   */
  1589. #define INCOMING    1        /* creation..see lock()    */
  1590.  
  1591. #define SH        0        /* defines for system_call */
  1592. #define USER_SHELL    1        /* to work correctly!      */
  1593.  
  1594. #define EXECUTE_ACCESS    01        /* for access() call        */
  1595. #define ACCESS_EXISTS    00        /* for access(2)           */
  1596.  
  1597. #define BIG_NUM        999999        /* big number!             */
  1598. #define BIGGER_NUM    9999999     /* bigger number!          */
  1599.  
  1600. #define START_ENCODE    "[encode]"
  1601. #define END_ENCODE    "[clear]"
  1602.  
  1603. #define DONT_SAVE    "[no save]"
  1604.  
  1605. #define alias_file    ".aliases"
  1606. #define group_file    ".groups"
  1607. #define system_file    ".systems"
  1608.  
  1609. #define JANUARY        0            /* months of the year */
  1610. #define FEBRUARY    1
  1611. #define MARCH        2
  1612. #define APRIL        3
  1613. #define MAY        4
  1614. #define JUNE        5
  1615. #define JULY        6
  1616. #define AUGUST        7
  1617. #define SEPTEMBER    8
  1618. #define OCTOBER        9
  1619. #define NOVEMBER    10
  1620. #define DECEMBER    11
  1621.  
  1622. #define equal(s,w)    (strcmp(s,w) == 0)
  1623. #define min(a,b)    a < b? a : b
  1624. #define ctrl(c)            c - 'A' + 1    /* control character mapping */
  1625. #define plural(n)    n == 1 ? "" : "s"
  1626. #define lastch(s)    s[strlen(s)-1]
  1627. #define no_ret(s)    if (lastch(s) == '\n') lastch(s) = '\0' 
  1628. #define first_word(s,w) (strncmp(s,w, strlen(w)) == 0)
  1629. #define ClearLine(n)    MoveCursor(n,0); CleartoEOLN()
  1630. #define whitespace(c)    (c == ' ' || c == '\t')
  1631. #define quote(c)    (c == '"' || c == '\'') 
  1632. #define onoff(n)    (n == 0 ? "OFF" : "ON")
  1633.  
  1634. /** a few for the usage of function keys... **/
  1635.  
  1636. #define f1    1
  1637. #define f2    2
  1638. #define f3    3
  1639. #define f4    4
  1640. #define f5    5
  1641. #define f6    6
  1642. #define f7    7
  1643. #define f8    8
  1644.  
  1645. #define MAIN    0
  1646. #define ALIAS   1
  1647. #define YESNO    2
  1648. #define CHANGE  3
  1649. #define READ    4
  1650.  
  1651. /* wouldn't it be nice to have variable argument macros... */
  1652.  
  1653. #define dprint0(s)         if (debug) { \
  1654.                 fprintf(debugfile, s); fflush(debugfile); }
  1655. #define dprint1(s,a)         if (debug) { \
  1656.                 fprintf(debugfile, s, a);  fflush(debugfile); }
  1657. #define dprint2(s,a,b)         if (debug) { \
  1658.                     fprintf(debugfile, s, a, b); fflush(debugfile);}
  1659. #define dprint3(s,a,b,c)     if (debug) { fprintf(debugfile, \
  1660.                 s, a, b, c); fflush(debugfile); }
  1661. #define dprint4(s,a,b,c,d)   if (debug) { fprintf(debugfile, \
  1662.                 s, a, b, c, d); fflush(debugfile); }
  1663. #define dprint5(s,a,b,c,d,e) if (debug) { fprintf(debugfile, \
  1664.                     s, a, b, c, d, e); fflush(debugfile); }
  1665.  
  1666. #define dprint6(s,a,b,c,d,e,f) if (debug) { fprintf(debugfile, \
  1667.                     s, a, b, c, d, e, f); fflush(debugfile); }
  1668.  
  1669. /* I guess this corrects it, though.  Wretched stuff though! */
  1670.  
  1671. struct date_rec {
  1672.     int  month;        /** this record stores a **/
  1673.     int  day;        /**   specific date and  **/
  1674.     int  year;        /**     time...         **/
  1675.     int  hour;
  1676.     int  minute;
  1677.        };
  1678.  
  1679. struct header_rec {
  1680.     int  lines;        /** # of lines in the message  **/
  1681.     int  priority;        /** Urgent message?  (flag)    **/
  1682.     int  delete;        /** is message to be deleted?  **/
  1683.     long offset;        /** offset in bytes of message **/
  1684.     struct date_rec received; /** when msg received here   **/
  1685.     char from[SLEN];    /**   when                **/
  1686.     char dayname[8];    /**      the                   **/
  1687.     char month[10];        /**        message             **/
  1688.     char day[3];        /**          was            **/
  1689.     char year[5];        /**            sent            **/
  1690.     char time[NLEN];    /**              to you!       **/
  1691.     char subject[SLEN];        /** The subject of the msg     **/
  1692.        };
  1693.  
  1694. struct alias_rec {
  1695.     char   name[NLEN];    /* alias name                  */
  1696.     long   byte;        /* offset into data file for address */
  1697.        };
  1698.  
  1699. struct lsys_rec {
  1700.     char   name[NLEN];    /* name of machine connected to      */
  1701.     struct lsys_rec *next;    /* linked list pointer to next       */
  1702.        };
  1703.  
  1704. struct addr_rec {
  1705.      char   address[NLEN];    /* machine!user you get mail as      */
  1706.      struct addr_rec *next;    /* linked list pointer to next       */
  1707.     };
  1708. END-OF-FILE
  1709.  
  1710. size=`wc -c < hdrs/defs.h`
  1711.  
  1712. if [ $size != 5028 ]
  1713. then
  1714.   echo Warning: hdrs/defs.h changed - should be 5028 bytes, not $size bytes
  1715. fi
  1716.  
  1717. chmod 644 hdrs/defs.h
  1718.  
  1719. # ---------- file hdrs/headers.h ----------
  1720.  
  1721.  
  1722. if [ -f hdrs/headers.h ]
  1723. then
  1724.   echo File 'hdrs/headers.h' already exists\!
  1725.   exit 1
  1726. fi
  1727.  
  1728. echo extracting file hdrs/headers.h...
  1729. cat << 'END-OF-FILE' > hdrs/headers.h
  1730. /**        headers.h        **/
  1731.  
  1732. /**  header file for msg mail system.  **/
  1733.  
  1734. /**  (C) Copyright 1985, Dave Taylor   **/
  1735.  
  1736. #include <stdio.h>
  1737. #include <fcntl.h>
  1738.  
  1739. #include "curses.h"
  1740. #include "defs.h"
  1741.  
  1742. /******** global variables accessable by all pieces of the program *******/
  1743.  
  1744. extern int current;        /* current message number  */
  1745. extern int header_page;         /* current header page     */
  1746. extern int last_header_page;    /* last header page        */
  1747. extern int message_count;    /* max message number      */
  1748. extern int total_lines_in_file;    /* number of lines in file */
  1749. extern int headers_per_page;    /* number of headers/page  */
  1750. extern char infile[SLEN];    /* name of current mailbox */
  1751. extern char hostname[SLEN];    /* name of machine we're on*/
  1752. extern char username[SLEN];    /* return address name!    */
  1753. extern char full_username[SLEN];/* Full username - gecos   */
  1754. extern char home[SLEN];        /* home directory of user  */
  1755. extern char folders[SLEN];    /* folder home directory   */
  1756. extern char mailbox[SLEN];    /* mailbox name if defined */
  1757. extern char editor[SLEN];    /* default editor for mail */
  1758. extern char printout[SLEN];    /* how to print messages   */
  1759. extern char savefile[SLEN];    /* name of file to save to */
  1760. extern char prefixchars[SLEN];    /* prefix char(s) for msgs */
  1761. extern char shell[SLEN];    /* default system shell    */
  1762. extern char batch_subject[SLEN];/* subject buffer for batchmail */
  1763.  
  1764. extern char start_highlight[SLEN],
  1765.         end_highlight[SLEN]; /* to delimit urgent messages */
  1766.  
  1767. extern char backspace,        /* the current backspace char  */
  1768.         kill_line;        /* the current kill_line char  */
  1769.  
  1770. extern char up[SHORT], 
  1771.         down[SHORT];    /* cursor control seq's    */
  1772. extern int  cursor_control;    /* cursor control avail?   */
  1773.  
  1774.  
  1775. /** the following two are for arbitrary weedout lists.. **/
  1776.  
  1777. extern char weedlist[MAX_IN_WEEDLIST][NLEN];
  1778. extern int  weedcount;        /* how many headers to check?        */
  1779.  
  1780. extern int  file_changed;    /* flag: true iff infile changed      */
  1781. extern int  mini_menu;        /* flag: display menu?               */
  1782. extern int  mbox_specified;     /* flag: specified alternate mailbox? */
  1783. extern int  check_first;    /* flag: verify mail to be sent!      */
  1784. extern int  auto_copy;        /* flag: auto copy source into reply? */
  1785. extern int  filter;        /* flag: weed out header lines?          */
  1786. extern int  resolve_mode;    /* flag: resolve before moving mode?  */
  1787. extern int  auto_cc;        /* flag: mail copy to yourself?       */
  1788. extern int  noheader;        /* flag: copy + header to file?       */
  1789. extern int  title_messages;    /* flag: title message display?       */
  1790. extern int  edit_outbound;    /* flag: edit outbound headers?       */
  1791. extern int  read_aliases;    /* flag: read in alias files??          */
  1792. extern int  hp_terminal;    /* flag: are we on an hp terminal?    */
  1793. extern int  hp_softkeys;    /* flag: are there softkeys?          */
  1794. extern int  save_by_name;      /* flag: save mail by login name?     */
  1795. extern int  notesfile;        /* flag: is input file from notes?    */
  1796. extern int  mail_only;        /* flag: send mail then leave?        */
  1797. extern int  check_only;        /* flag: check aliases and leave?     */
  1798. extern int  move_when_paged;    /* flag: move when '+' or '-' used?   */
  1799.  
  1800. extern int debug;        /** debugging mode on?  **/
  1801.  
  1802. extern int mailbox_defined;    /** specified mailbox?  **/
  1803.  
  1804. extern int LINES;        /** lines per screen    **/
  1805. extern int COLUMNS;        /** columns per line    **/
  1806.  
  1807. extern int size_of_pathfd;    /** size of pathfile, 0 if none **/
  1808.  
  1809. extern FILE *mailfile;        /* current mailbox file    */
  1810. extern FILE *debugfile;        /* file for debut output   */
  1811. extern FILE *pathfd;        /* path alias file         */
  1812.  
  1813. extern struct header_rec header_table[MAX_HEADERS];
  1814.  
  1815. extern struct alias_rec user_hash_table  [MAX_UALIASES];
  1816. extern struct alias_rec system_hash_table[MAX_SALIASES];
  1817.  
  1818. extern struct date_rec last_read_mail;
  1819.  
  1820. extern struct lsys_rec *talk_to_sys;    /* who do we talk to? */
  1821.  
  1822. extern struct addr_rec *alternative_addresses;    /* how else do we get mail? */
  1823.  
  1824. extern int system_files;    /* do we have system aliases? */
  1825. extern int user_files;        /* do we have user aliases?   */
  1826.  
  1827. extern int system_data;        /* fileno of system data file */
  1828. extern int user_data;        /* fileno of user data file   */
  1829.  
  1830. extern int userid;        /* uid for current user          */
  1831. extern int progid;        /* euid for program          */
  1832. END-OF-FILE
  1833.  
  1834. size=`wc -c < hdrs/headers.h`
  1835.  
  1836. if [ $size != 4253 ]
  1837. then
  1838.   echo Warning: hdrs/headers.h changed - should be 4253 bytes, not $size bytes
  1839. fi
  1840.  
  1841. chmod 644 hdrs/headers.h
  1842.  
  1843. # ---------- file hdrs/msg.h ----------
  1844.  
  1845.  
  1846. if [ -f hdrs/msg.h ]
  1847. then
  1848.   echo File 'hdrs/msg.h' already exists\!
  1849.   exit 1
  1850. fi
  1851.  
  1852. echo extracting file hdrs/msg.h...
  1853. cat << 'END-OF-FILE' > hdrs/msg.h
  1854. /**        msg.h            **/
  1855.  
  1856. /**  header file for msg mail system.  **/
  1857.  
  1858. /**  (C) Copyright 1986, Dave Taylor   **/
  1859.  
  1860. #include <stdio.h>
  1861. #include <fcntl.h>
  1862.  
  1863. #include "../hdrs/curses.h"
  1864. #include "../hdrs/defs.h"
  1865.  
  1866. /******** static character string containing the copyright notice  *******/
  1867.  
  1868. static char copyright[] = { "(C) Copyright 1986, Dave Taylor" };
  1869.  
  1870. /******** global variables accessable by all pieces of the program *******/
  1871.  
  1872. int current = 0;        /* current message number  */
  1873. int header_page = 0;         /* current header page     */
  1874. int last_header_page = -1;         /* last header page        */
  1875. int message_count = 0;        /* max message number      */
  1876. int total_lines_in_file;        /* number of lines in file */
  1877. int headers_per_page;        /* number of headers/page  */
  1878. char infile[SLEN];        /* name of current mailbox */
  1879. char hostname[SLEN];        /* name of machine we're on*/
  1880. char username[SLEN];        /* return address name!    */
  1881. char full_username[SLEN];    /* Full username - gecos   */
  1882. char home[SLEN];        /* home directory of user  */
  1883. char folders[SLEN];        /* folder home directory   */
  1884. char mailbox[SLEN];        /* mailbox name if defined */
  1885. char editor[SLEN];        /* editor for outgoing mail*/
  1886. char printout[SLEN];        /* how to print messages   */
  1887. char savefile[SLEN];        /* name of file to save to */
  1888. char prefixchars[SLEN];        /* prefix char(s) for msgs */
  1889. char shell[SLEN];        /* current system shell    */
  1890. char batch_subject[SLEN];    /* subject buffer for batchmail */
  1891.  
  1892. char start_highlight[SLEN],
  1893.      end_highlight[SLEN];    /* to delimit urgent msgs  */
  1894.  
  1895. char backspace,            /* the current backspace char */
  1896.      kill_line;            /* the current kill-line char */
  1897.  
  1898. char up[SHORT], down[SHORT];    /* cursor control seq's    */
  1899. int  cursor_control = FALSE;    /* cursor control avail?   */
  1900.  
  1901. char weedlist[MAX_IN_WEEDLIST][NLEN];
  1902. int  weedcount;
  1903.  
  1904. int file_changed = 0;        /* flag: true if infile changed     */
  1905. int mini_menu = 1;        /* flag: menu specified?        */
  1906. int mbox_specified = 0;        /* flag: specified alternate mbox?  */
  1907. int check_first = 1;        /* flag: verify mail to be sent!    */
  1908. int auto_copy = 0;        /* flag: automatically copy source? */
  1909. int filter = 0;            /* flag: weed out header lines?        */
  1910. int resolve_mode = 1;        /* flag: delete saved mail?        */
  1911. int auto_cc = 0;        /* flag: mail copy to user?        */
  1912. int noheader = 0;        /* flag: copy + header to file?     */
  1913. int title_messages = 0;        /* flag: title message display?     */
  1914. int edit_outbound = 0;        /* flag: edit outbound headers?        */
  1915. int read_aliases = 1;        /* flag: read in alias files?        */
  1916. int hp_terminal = 0;        /* flag: are we on HP term?        */
  1917. int hp_softkeys = 0;        /* flag: are there softkeys?        */
  1918. int save_by_name = 0;        /* flag: save mail by login name?   */
  1919. int notesfile = 0;        /* flag: is input file from notes?  */
  1920. int mail_only = 0;        /* flag: send mail then leave?      */
  1921. int check_only = 0;        /* flag: check aliases then leave?  */
  1922. int move_when_paged = 0;    /* flag: move when '+' or '-' used? */
  1923.  
  1924. int debug = 0;             /** default is no debug! **/
  1925.  
  1926. int mailbox_defined = 0;    /** mailbox specified?    **/
  1927.  
  1928. int LINES=23;            /** lines per screen      **/
  1929. int COLUMNS=80;            /** columns per page      **/
  1930.  
  1931. int size_of_pathfd;        /** size of pathfile, 0 if none **/
  1932.  
  1933. FILE *mailfile;            /* current mailbox file    */
  1934. FILE *debugfile;        /* file for debug output   */
  1935. FILE *pathfd;            /* path alias file         */
  1936.  
  1937. struct header_rec header_table[MAX_HEADERS];
  1938.  
  1939. struct alias_rec user_hash_table[MAX_UALIASES];
  1940. struct alias_rec system_hash_table[MAX_SALIASES];
  1941.  
  1942. struct date_rec last_read_mail; /* last time we read mailbox  */
  1943.  
  1944. struct lsys_rec *talk_to_sys;   /* what machines do we talk to? */
  1945.  
  1946. struct addr_rec *alternative_addresses;    /* how else do we get mail? */
  1947.  
  1948. int system_files = 0;        /* do we have system aliases? */
  1949. int user_files = 0;        /* do we have user aliases?   */
  1950.  
  1951. int system_data;        /* fileno of system data file */
  1952. int user_data;            /* fileno of user data file   */
  1953.  
  1954. int userid;            /* uid for current user          */
  1955. int progid;            /* euid for program          */
  1956. END-OF-FILE
  1957.  
  1958. size=`wc -c < hdrs/msg.h`
  1959.  
  1960. if [ $size != 3982 ]
  1961. then
  1962.   echo Warning: hdrs/msg.h changed - should be 3982 bytes, not $size bytes
  1963. fi
  1964.  
  1965. chmod 644 hdrs/msg.h
  1966.  
  1967. # ---------- file hdrs/sysdefs.h ----------
  1968.  
  1969.  
  1970. if [ -f hdrs/sysdefs.h ]
  1971. then
  1972.   echo File 'hdrs/sysdefs.h' already exists\!
  1973.   exit 1
  1974. fi
  1975.  
  1976. echo extracting file hdrs/sysdefs.h...
  1977. cat << 'END-OF-FILE' > hdrs/sysdefs.h
  1978. /**            sysdefs.h            **/
  1979.  
  1980. /**  System level, configurable, defines for the MSG mail system.  **/
  1981.  
  1982. /**  (C) Copyright 1986 Dave Taylor                                **/
  1983.  
  1984. /** define the following if you think that the information in messages
  1985.     that have "Reply-To:" and/or "From:" fields with addresses will
  1986.     contain valid addressing information.  If this isn't defined, the
  1987.     calculated return address will ALWAYS be used instead.  (note that
  1988.     this doesn't necessarily proclude the use of G)roup replies).
  1989.  
  1990. #define USE_EMBEDDED_ADDRESSES    
  1991.  
  1992. **/
  1993.  
  1994. #define FIND_DELTA    10        /* byte region where the binary search
  1995.                        on the path alias file is fruitless 
  1996.                                            (can't be within this boundary)    */
  1997.  
  1998. #define MAX_HEADERS    500    /* max number of messages in one file!   */    
  1999. #define MAX_SALIASES    503    /* number of system aliases allowed      */
  2000. #define MAX_UALIASES    251    /* number of user aliases allowed      */
  2001. #define MAX_IN_WEEDLIST 50    /* max headers to weed out               */
  2002.  
  2003. #define MAX_HOPS    35    /* max hops in return addr to E)veryone  */
  2004.  
  2005. #define MAX_ATTEMPTS    6    /* #times to attempt lock file creation */
  2006.  
  2007. /** see leavembox.c to determine if this should be defined or not....The 
  2008.     default is to NOT have it defined.
  2009.  
  2010. #define REMOVE_AT_LAST
  2011.  
  2012. **/
  2013.  
  2014. #define DEFAULT_BATCH_SUBJECT  "no subject (file transmission)"
  2015.  
  2016. /** If you want to have the mailer know about valid mailboxes on the
  2017.     host machine (assumes no delivery agent aliases) then you should
  2018.     undefine this (the default is to have it defined)...
  2019.  
  2020. #define NOCHECK_VALIDNAME
  2021.  
  2022. **/
  2023.  
  2024. #define NOTES_HEADER        "/***** "
  2025. #define NOTES_FOOTER        "/* ---------- */"
  2026.  
  2027. #ifdef BSD
  2028. # define system_hash_file    "/usr/spool/mail/.alias_hash"
  2029. # define system_data_file    "/usr/spool/mail/.alias_data"
  2030. #else
  2031. # define system_hash_file    "/usr/mail/.alias_hash"
  2032. # define system_data_file    "/usr/mail/.alias_data"
  2033. #endif
  2034.  
  2035. #define pathfile        "/usr/lib/nmail.paths"
  2036.  
  2037. #define Lsys            "/usr/lib/uucp/L.sys"
  2038.  
  2039. /** where to put the output of the msg -d command... (in home dir) **/
  2040. #define DEBUG        "Msg.debug.info"
  2041.  
  2042. #define temp_file    "/tmp/snd."
  2043. #define temp_mbox    "/tmp/mbox."
  2044. #define temp_print      "/tmp/print."
  2045. #define mailtime_file    ".last_read_mail"
  2046.  
  2047. #ifdef BSD
  2048. # define default_editor    "/usr/ucb/vi"
  2049. # define mailhome    "/usr/spool/mail/"
  2050. #else
  2051. # define default_editor    "/usr/bin/vi"
  2052. # define mailhome    "/usr/mail/"
  2053. #endif
  2054.  
  2055. #define sendmail    "/usr/lib/sendmail"
  2056. #define sendmailflags    "-oi"
  2057. #define mailer        "/bin/rmail"
  2058. #define mailx        "/usr/bin/mailx"
  2059.  
  2060. #define cutfile        "/usr/local/bin/cutfile"
  2061.  
  2062. #define helphome    "/usr/local/lib/"
  2063. #define helpfile    "msg-help.main"
  2064.  
  2065. #define msgrcfile    "/.msgrc"
  2066. #define mailheaders    ".msgheaders"
  2067. #define unedited_mail    "emergency.mbox"
  2068. #define newalias    "newalias 1>&2 > /dev/null"
  2069.  
  2070. #define remove        "/bin/rm -f"        /* how to remove a file */
  2071. #define cat        "/bin/cat"        /* how to display files */
  2072. END-OF-FILE
  2073.  
  2074. size=`wc -c < hdrs/sysdefs.h`
  2075.  
  2076. if [ $size != 2882 ]
  2077. then
  2078.   echo Warning: hdrs/sysdefs.h changed - should be 2882 bytes, not $size bytes
  2079. fi
  2080.  
  2081. chmod 644 hdrs/sysdefs.h
  2082.  
  2083. echo done
  2084.  
  2085. exit 0
  2086.  
  2087.  
  2088.  
  2089.  
  2090.