[mod.sources] Msg docs preformatted

sources-request@panda.UUCP (03/15/86)

Mod.sources:  Volume 4, Issue 35

If your site has the "mm" macro package, then you don't need this, the
formatted documentation for the Msg mail system.

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	Alias.fmtd
#	Config.fmtd
# This archive created: Sat Mar 15 10:06:15 1986
export PATH; PATH=/bin:$PATH
echo shar: extracting "'Alias.fmtd'" '(13394 characters)'
if test -f 'Alias.fmtd'
then
	echo shar: will not over-write existing file "'Alias.fmtd'"
else
cat << \SHAR_EOF > 'Alias.fmtd'







                   A Users Guide to the
                      MSG Alias System

                   (C) Copyright 1986, by
                        Dave Taylor

                       March 15, 1986


     This document is intended as a supplement  to  the  Msg
Users  Guide and is only of interest to those users desiring
more knowledge about how aliases  work  and  how  to  create
strange  and exciting aliases for their systems (alright, so
it's not that exciting!)


     This document is broken up into the following sections;
user  aliases,  group  aliases,  system aliases, editing and
installing new aliases, the machine  routing  database,  and
general warnings and other chitchat.



1.  User Aliases

     The most simple sort of aliases in the Msg  system  are
individual user aliases.  These are made up of three parts;

        <aliasname list> : <username> : <address>

Where the alias list is either a single aliasname* or a list
of aliasnames separated by commas.

     Username is currently a comment field, and is  used  to
indicate  the  full  "real name" that the alias is for.  For
example, if you had an alias for "dat" to  get  to  me,  the
username  field would contain "Dave Taylor" or perhaps "Dave
Taylor, HP" or some other permutation of that.  In a  future
release of the mailer, the alias system will know about this
field and include it in outgoing messages AND as  a  supple-
ment to the usual list of aliasnames.

     Address  is  either  the  users  full  electronic  mail
address  or,  if  the machine routing database is installed,


__________

  * Please see the appendix for a full definition of what
    exactly an aliasname consists of.




Page 1











the minimum address needed to specify the destination.   For
example,  say  our routing database contained information on
how to get to machine "hp-sdd"  and  I  wanted  to  have  an
address  for  my friend Ken there - I could have his address
specified as  simply  "ken@hp-sdd"  (or  alternatively  "hp-
sdd!ken" since the two are functionally equivalent).


Let's get on to some examples, shall we?

Consider this excerpt from my own .alias_text file;

 wunder,walt   : Walt Underwood  : wunder@hpcea
 laubach       : Mark Laubach    : laubach@hpcea
 mary          : Mary Hsia-Coron : hsia@hpindla
 decot         : Dave Decot      : decot@hpda

 jeff          : Jeff Wu         : hpcnoe!j_wu
 dave          : Dave Barrett    : hpcnof!d_barrett

Note that the alias for Walt Underwood  has  two  aliasnames
associated  with  it, "wunder" and "walt".  Also notice that
the first four aliases use the ARPA style naming  convention
(user@machine)  but  the last two use the UUCP style conven-
tion (machine!user).  In this context it is independent.

     The only time when it  does  make  a  difference  which
notation  you  use  is  if you have to specify more than the
machine that the user is receiving mail on.  That is, say we
have  a  friend  who  receives  mail  at  a  machine  called
"twinkie"  and  our  best  connection  is  through   Georgia
Tech...Then our alias for them could be;

  buddy         : Our friend      : gatech!twinkie!buddy

or

  buddy2        : Our friend      : gatech!buddy@twinkie

but not;

  buddy         : Our friend      : buddy@twinkie@gatech

(however, buddy%twinkie@gatech will also  work,  but  that's
far  too  bizarre  a  notation to be recommended!!) (besides
there's no guarantee that "gatech" will  like  it,  nor  the
"buddy2" alias above!)

     Anyway, suffice to say that if  you  must  specify  any
sort  of route that you should use the uucp notation as much
as possible to  ensure  that  the  Msg  system  expands  the



Page 2











correct machine name.



2.  Group Aliases

     After the confusion of user aliases, group aliases  are
even more fun!  For the most part the notation is very simi-
lar;

        <aliasname list> : <groupname> : <list of people>

Where aliasname list and groupname are exactly equivalent to
the corresponding fields in user aliases.

     The interesting part is the list of people field!  This
field  is  actually  in  the  same notation as the aliasname
list, so it's not quite as  strange  as  I've  lead  you  to
believe.  It's best to illustrate by example;

friends, mypals, gang : The Gang of Six : joe, larry, mary, joanna,
                                          nancy, michael

(Notice that you can continue onto as many  lines  as  you'd
like  so  long  as  each additional line start with either a
SPACE or a TAB character)

     The significant limitation with group aliases  is  that
each  of the people in the list must be a previously defined
aliasname in either the existing alias file  or  the  system
alias file or a valid destination on the current machine.

     What does this mean?  This  means  that  the  following
excerpt from an alias file;

hawaii : The Hawaiian Twins : joe@RIT-CS.ARPA, maoa
maoa   : Maoa Lichtenski Jr : maoa@Hawaii.cs.uh.ARPA

will fail for two reasons - not only does the group list  of
people  contain  a  complex address, but it also contains an
aliasname that is defined later in the .alias_text file!  **
BEWARE!!! **

     The correct way to have the previous alias in the  file
is to have it like;

joe    : Joe Lichtenski     : joe@RIT-CS
maoa   : Maoa Lichtenski Jr : maoa@Hawaii
hawaii : The Hawaiian Twins : joe, maoa

which will then work correctly.



Page 3











This isn't too hard now, is it?

Fortunately, while this seems pretty tough, if you  run  the
newalias  command  to install your new aliases, it will give
you nice meaningful error messages that will  help  you  fix
the list up correctly!



3.  System Aliases

     System aliases are functionally equivalent to the indi-
vidual  Msg alias lists each Msg user has (both user aliases
and group aliases) but are "read only" for everyone but  the
Msg  administrator.   The format of the file is identical to
the users file, and the only difference is that this file is
expected  to  be  located in the directory that contains the
"system_hash_file" and "system_data_file" files (see the Msg
Configuration Guide for more details on these variables).

     Simply create a .alias_text file in the specific direc-
tory as you would a normal file, and install it the same way
(see the following section for more details on that).

     Voila!!



4.  Editing and Installing New Aliases

     To install new aliases, you need merely to  create,  or
modify,  your  .alias_text file in your home directory until
you're satisfied with  it  and  it  meets  the  requirements
stated  above.  You can then try to install it with the com-
mand;

        $ newalias

which  will  either  report  back  the  number  of   aliases
installed  into  the system or will report errors indicative
of the changes that the program expects before it can accept
the alias list.

     Note that blank lines are no problem and that  comments
are  not only allowed but actually encouraged, and must have
# as the first character of each comment line.

Finally, if you find  that  you're  hitting  the  "Too  many
aliases"  error,  then you'll need to reconfigure the entire
Msg system (again, see the  Msg  Configuration  Guide  espe-
cially  the  discussion on "MAX_UALIASES" and "MAX_SALIASES"



Page 4











therein).



5.  The Hostname Routing Database

     Floating about on the  various  networks  is  a  rather
nifty  program by a number of people, including Peter Honey-
man and  Steve  Bellovin,  called  "pathalias".   What  this
incredibly  handy  program does is take the strange postings
in groups like "mod.map" and massage them into a file of the
form;

  <hostname>    <address>

which is then sorted alphabetically and stored in  the  file
pointed  to  by  "pathfile"  (guess  where  to look for more
information!) for Msg to use.

     If you don't have the program, or don't want to use it,
you  can  simulate this file by listing machines in the same
format.  The exact format expected is;

  <hostname><tab><machine-address>

where hostname is a limited identifier (no  special  charac-
ters)  and  machine-address  MUST  contain the sequence "%s"
(and consequently any other percent signs that appear in the
address  must  be  paired)  so  that the call in the program
"sprintf(buffer, machine-address, username)" will generate a
valid return address.

By way of example, here are a few entries from my own file;

 HPL        hplabs!%s
 PARC       hplabs!%s@Xerox.PA.COM
 amc-hq     hplabs!%s@AMC-HQ.ARPA
 imsss      hplabs!%s%%IMSSS@SU-AI.ARPA
 infopro    hpfcla!ihnp4!astrovax!infopro!%s
 interleaf  hpfcdc!hpda!sun!interleaf!%s
 jpl-vax    hplabs!%s@jpl-vax

As you can see, the addresses can get  pretty  complicated!!
In  fact it's due purely to the complication that a database
file of this sort can be so wonderful!!

If you'd like further information on the pathalias  program,
try  keeping  track  of  the entries in "mod.sources" - it's
posted about once a year or so...





Page 5











6.  Other Stuff not Covered Yet

     Probably the biggest question you  have  in  your  mind
right  now is "But how the heck does this relate to the 'ole
mailx aliases and the snazzo sendmail alias system??"  Well,
rest assured, sendmail fans, that if you REALLY want to have
your aliases down in the transport  you  can.   No  problem.
All  you'll need to do is to turn off the address validation
routine in Msg by defining the  "NOCHECK_VALIDNAME"  defini-
tion (I'm not even going to bother to tell you where to look
for this one!!).

     For those mailx fanatics out there, you  can  translate
your  aliases into the format that Msg wants by running them
through the awk script listed in Appendix Two.


     Finally, if you have any  problems  or  questions,  try
looking  in the newalias manual entry, or dropping me a line
at the "usual" email address (ask your administrator!).


































Page 6











                        Appendix One

              A BNF of the Alias File Grammar


In this listing, items in  <>  brackets  are  non-terminals,
items  in {} are optional, and items in bold face are termi-
nals.



<alias_file>  ::=  <line> { <alias_file> }

<line>        ::=  <comment> | <empty> | <alias>

<comment>     ::=  .. any sequence of characters starting with '#' ..

<empty>       ::=  .. an empty line ..

<alias>       ::=  <user alias> | <group alias>

<user alias>  ::=  <aliaslist> : { <comment> : }
                   {<whitespace>} <address>

<group alias> ::=  <aliaslist> : { <comment> : }
                   {<whitespace>} <list of addresses>

<aliaslist>   ::=  <aliasname> { , <aliaslist> }

<aliasname>   ::=  <alpha-char> { <sequence-of-chars> }

<comment>     ::=  .. anything other than ":" ..

<address>     ::=  <username> | <arpa-address> | <uucp-address> |
                   <complex-address>

<list-of-addresses> ::= <aliasname> { , <whitespace> }
                        { <list-of-addresses> }

<username>    ::=  .. any valid mailbox name on the system ..

<arpa-address> ::= <username> ( @ <hostname> | <postfix> )

<hostname>    ::=  .. any legal host machine name ..

<uucp-address> ::= <hostname> ! <username>

<complex-address> ::= <prefix> ( <uucp-address> | <arpa-address> )

<prefix>      ::= <hostname> ! { <prefix> }




Page 7











<postfix>     ::= % <hostname> { <postfix> } @
                  <hostname>

<sequence-of-chars> ::= .. any characters other than space, tab,
                           return, or colon ..

<whitespace> ::= .. space, tab or newline followed by space or tab ..















































Page 8











                        Appendix Two

                     An AWK Script for
                 Translating Aliases from a
                   ".mailrc" Format to a
                         Msg Format


-------------------------------------------------------------------

BEGIN {
        print "# MSG alias_text file, from a .mailrc file..."
        print ""
      }

next_line == 1 {

        next_line = 0;
        group = ""
        for (i = 1; i <= NF; i++) {
          if (i == NF && $i == "\\") sep = ""
          else                       sep = ", "

          if ($i == "\\") {
            group = sprintf("%s,", group)
            next_line = 1;
          }
          else if (length(group) > 0)
            group = sprintf("%s%s%s", group, sep, $i);
          else
            group = $i;
          }
          print "\t" group

        }

$1 ~ /[Aa]lias|[Gg]roup/ {

        if ( NF == 3)
          print $2 " : user alias : " $3;
        else {
          group = ""
          for (i = 3; i <= NF; i++) {
            if (i == NF && $i == "\\") sep = ""
            else        sep = ", "

            if ($i == "\\") {
              group = sprintf("%s,", group)
              next_line = 1;
            }
            else if (length(group) > 0)



Page 9











              group = sprintf("%s%s%s", group, sep, $i);
            else
              group = $i;
            }
            print $2 " : group alias : " group;
          }
        }

-------------------------------------------------------------------

     Note: this script is contained in the release under the
name "mailrc.awk" in the utilities directory "utils".










































Page 10




SHAR_EOF
if test 13394 -ne "`wc -c < 'Alias.fmtd'`"
then
	echo shar: error transmitting "'Alias.fmtd'" '(should have been 13394 characters)'
fi
fi
echo shar: extracting "'Config.fmtd'" '(11466 characters)'
if test -f 'Config.fmtd'
then
	echo shar: will not over-write existing file "'Config.fmtd'"
else
cat << \SHAR_EOF > 'Config.fmtd'







                    Configuration Guide
                           to the
                      MSG Mail System

                   (C) Copyright 1986, by
                        Dave Taylor

                     February 28, 1986


     This document is intended as a supplement  to  the  Msg
Users  Guide  and  is  only  of interest to sites having the
source code to the msg system.


     Virtually all of the installation dependent definitions
are  contained  in  the  file  'hdrs/sysdefs.h', as detailed
below;


-------------------------------------------------------------
#define USE_EMBEDDED_ADDRESSES

#define FIND_DELTA      10      /* for binary searches in path database  */

#define MAX_HEADERS     500     /* max number of messages in one file!   */
#define MAX_SALIASES    503     /* number of system aliases allowed      */
#define MAX_UALIASES    251     /* number of user aliases allowed        */
#define MAX_IN_WEEDLIST 50      /* max headers to weed out               */

#define MAX_HOPS        35      /* max hops in return addr to E)veryone  */

#define MAX_ATTEMPTS    6       /* #times to attempt lock file creation */

#define REMOVE_AT_LAST          /* see leavembox.c */

#define DEFAULT_BATCH_SUBJECT   "no subject (file transmission)"

#define NOCHECK_VALIDNAME       /* see validname.c */

#define NOTES_HEADER            "/***** "
#define NOTES_FOOTER            "/* ---------- */"

#ifdef BSD
# define system_hash_file       "/usr/spool/mail/.alias_hash"
# define system_data_file       "/usr/spool/mail/.alias_data"
#else
# define system_hash_file       "/usr/mail/.alias_hash"
# define system_data_file       "/usr/mail/.alias_data"
#endif




Page 1











#define pathfile                "/usr/lib/nmail.paths"

#define Lsys                    "/usr/lib/uucp/L.sys"

#define DEBUG           "Msg.debug.info"

#define temp_file       "/tmp/snd."
#define temp_mbox       "/tmp/mbox."
#define temp_print      "/tmp/print."
#define mailtime_file   ".last_read_mail"
#ifdef BSD
#  define default_editor        "/usr/ucb/vi"
#  define mailhome              "/usr/spool/mail/"
#else
#  define default_editor        "/usr/bin/vi"
#  define mailhome              "/usr/mail/"
#endif

#define sendmail        "/usr/lib/sendmail"
#define sendmailflags   "-oi"
#define mailer          "/bin/rmail"
#define mailx           "/usr/bin/mailx"

#define helphome        "/usr/local/lib/"
#define helpfile        "main.help"

#define msgrcfile       "/.msgrc"
#define mailheaders     ".msgheaders"
#define unedited_mail   "emergency.mbox"
#define newalias        "newalias 1>&2 > /dev/null"

#define remove          "/bin/rm -f"            /* how to remove a file */
#define cat             "/bin/cat"              /* how to display files */

-------------------------------------------------------------



USE_EMBEDDED_ADDRESSES This controls the mailers response to
               messages  that contain "Reply-To:" or "From:"
               lines that actually contain a return address.
               If  it's  defined, the mailer will attempt to
               use the  address  specified  (overriding  the
               return  address  built from the path that the
               mail took).  It will look the address  up  in
               the pathalias database (see the documentation
               on the alias system)  for  incomplete  paths,
               but it is still recommended that this be left
               undefined.





Page 2











                    This will, of course,  make  the  mailer
               not be a standard 'RFC-822' mailer, since the
               mail system is defined to use the reply-to if
               included rather than the return address, but,
               at least for addresses on the  ARPA  net,  it
               ain't going to work a lot of the time!

FIND_DELTA     This is the delta that the binary  search  of
               the  pathalias database will use to determine
               when it's slicing up a  single  line,  rather
               than  a  multitude  of lines.   Ideally, this
               should be set to 1 byte less than  the  shor-
               test  line  in  the  file...the default is 10
               bytes.

MAX_HEADERS      The maximum number of messages allowed in a
               single mailbox.

MAX_SALIASES     The number of system aliases allowed.   (It
               is recommended that this be a prime number to
               improve the performance of the hashing  func-
               tion (it's a complicated proof!))

MAX_UALIASES   The number of user aliases allowed.   (should
               be a prime number - see the comment above)

MAX_IN_WEEDLIST The maximum number of headers  that  can  be
               specified  in  the weedout list of the .msgrc
               file.  A suggested  alternative  approach  if
               this  number  is too small is to specify ini-
               tial  substrings  in  the  file  rather  than
               increasing  the number.  For example, say you
               want to weedout the headers  "Latitude:"  and
               "Latitudinal-Coords:",   you   could   simply
               specify  "Latitud"  and  match   them   both!
               Furthermore  you  could  also specify headers
               like "X-" and remove  all  the  user  defined
               headers!

MAX_HOPS       When replying to a G)roup, this is  the  max-
               imum  number  of hops that a message can have
               taken.  This is used to try to  optimize  the
               return  address  (remove  cyclic loops and so
               on) and regular  use  should  show  that  the
               default of 35 is plenty more than you'll ever
               need!

MAX_ATTEMPTS   When   reading   in   the   default   mailbox
               (/usr/mail/$username)  the  mailer  creates a
               file  called  "/usr/mail/$username.lock"   to
               ensure  that  no  mail  is  added to the file



Page 3











               while it's being either read, or replaced (ie
               written  to).   Occasionally,  this lock file
               will already be in  place  since  someone  is
               currently  sending you mail.  If this occurs,
               the mailer will wait a few seconds and try to
               create  the  lock file again.  This parameter
               defines the number of tries the mailer should
               take before giving up.

REMOVE_AT_LAST When it does decide to give up  after  trying
               to  create  the lock file, (see MAX_ATTEMPTS,
               above) this will define how to act.  If  it's
               defined,  the  mailer  will attempt to remove
               the lock file after the MAX_ATTEMPTS timeout.
               On  the  other hand, if it's not defined (the
               recommended  state)  it'll  simply  quit  the
               mailer,  telling  the  user to try again in a
               few minutes.

DEFAULT_BATCH_SUBJECT What the subject should be on messages
               that are from redirected input but don't have
               a subject specified...

NOCHECK_VALIDNAME This disables the checking  of  validnames
               on  the  existing  machine.  On machines that
               run a system such as  sendmail  and  use  the
               sendmail   alias   feature,  this  should  be
               defined.  On other  systems  this  should  be
               left  as  the  default (not defined) to avoid
               users generating "dead.letter" files...

NOTES_HEADER   This defines the first  "word"  of  the  line
               that a notes file entry would contain.

NOTES_FOOTER   This  defines  the  footer  line   (in   it's
               entirety).

system_hash_file This is the file that contains  the  hashed
               version  of  the  system aliases.  It is also
               used in the newalias command.  (note that  it
               is defined differently if you're running on a
               Berkeley system)

system_data_file This is the other file the newalias command
               installs  in  the  system  alias area.  (Note
               this is defined differently if you're runnnig
               a bsd system)

pathfile       This  defines  the  location  of  the   alias
               datafile.   This  file  is in the format that
               pathalias generates, that is;



Page 4












                   machine <tab> address

               For further information, please see  the  Msg
               Alias System documentation.

Lsys           This defines where the system L.sys  file  is
               kept.  This is used for the mailer to quickly
               know what machines the  current  machine  can
               talk  to  directly (to avoid trying to search
               the pathalias database to route mail to these
               machines).

DEBUG          The name of the file to put in the users home
               directory  if  they  choose  to  use the "-d"
               debug option.

temp_file      Temporary file for sending outbound messages.
               Place  to  keep  copy  of incoming mailbox to
               avoid collisions with newer mail.

temp_print     File to use when creating  a  printout  of  a
               message.

mailtime_file  File to compare date to  to  determine  if  a
               given  message is New since the last time the
               mail was read or not.

default_editor If no editor is specified in the users .msgrc
               file, this is which editor to use.  ENSURE IT
               IS A VALID EDITOR  ON  THIS  MACHINE!!   (Not
               that  the  default home for "vi" is different
               on BSD machines)

mailhome       Where all the  incoming  mailboxes  are,  and
               also  where  the  'lock' files have to be put
               for the mailer to know not to  add  new  mail
               while  we're  reading/writing  the  mailfile.
               (note that mail is kept in a different direc-
               tory on Berkeley systems)

sendmail       Defines where sendmail is (if you have it  on
               your system).

sendmailflags  Defines the flags to hand to sendmail if  and
               when the program chooses to use it.

mailer         If you  don't  have  sendmail,  this  is  the
               mailer that'll be used.





Page 5











mailx          If all else fails, this mailer can be used in
               a rather dumb way.

helphome       Where the help file is kept (soon to be  help
               files!)

helpfile       The name of the main helpfile (kept in  "hel-
               phome").

msgrcfile      The  name  of  the  automatic  control   file
               (currently ".msgrc")

mailheaders      The name of the optional  file  that  users
               may have that will be included in the headers
               of each outbound message.

unedited_mail  In the strange case when the mailer  suddenly
               finds  all  the  directories it uses shut off
               (like /usr/mail and /tmp) then it'll put  the
               current  mailbox  into this file in the users
               home directory.

newalias       How to install new aliases..

remove         How to remove a file.

cat            How to display a file to stdout.



























Page 6




SHAR_EOF
if test 11466 -ne "`wc -c < 'Config.fmtd'`"
then
	echo shar: error transmitting "'Config.fmtd'" '(should have been 11466 characters)'
fi
fi
exit 0
#	End of shell archive

sources-request@panda.UUCP (03/15/86)

Mod.sources:  Volume 4, Issue 36

If your site has the "mm" macro package, then you don't need this, the
formatted documentation for the Msg mail system.

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	Guide.fmtd
# This archive created: Sat Mar 15 10:06:24 1986
export PATH; PATH=/bin:$PATH
echo shar: extracting "'Guide.fmtd'" '(50526 characters)'
if test -f 'Guide.fmtd'
then
	echo shar: will not over-write existing file "'Guide.fmtd'"
else
cat << \SHAR_EOF > 'Guide.fmtd'







                    Msg 3.1 Users Guide


                        Dave Taylor


                       March 15, 1986





1.  Introduction

     The UNIX operating system was originally written  on  a
small  PDP  machine  to  work  with teletypewriters.  Conse-
quently, all the original software for the operating  system
was  written  with  a  'tty'  in  mind  - they were all line
oriented, rather than screen oriented.

     Gradually this began to change, and, with the  addition
of  the  Berkeley vi visual shell to the ed line editor, the
trend was brought to the attention of certain  UNIX  systems
designers.

     This, however, seemingly hasn't been enough, as vi  and
notes  are still the only screen oriented software available
(other than games, which are a taboo subject  with  managers
and  the like!).  Consequently, after becoming more and more
frustrated with the existing electronic mail  facilities  on
the  system  ('mail'  and  'mailx', both of which are essen-
tially line-editors) I decided to write my own!

     This document discusses the msg mailer, and includes  a
set  of  example  screens  and a discussion of configuration
(for systems administrators).  It is broken  down  into  the
following   general  sections;  The  .msgrc  file,  starting
options of msg, the main system level, responses of  various
commands, the alias system, and system configuration.

     Any comments or problems with either this  document  or
the program itself are welcome: all installed systems should
have an alias that will ensure that I receive any mail  sent
to 'msg'.










Page 1







Msg Users Guide                                  Version 3.2



2.  The .msgrc File

     The msg mailer has the ability to automatically read in
a  configuration  file at each invocation.  The file must be
called ".msgrc" and reside in your home directory for it  to
be read in, and can have any of the following entries in any
order (note that the first four entries replace  environment
variables  of  the  same  name, and the four boolean options
supplement required starting parameters);

fullname  This is the name the mailer will use when  sending
          mail  from you.  It is highly recommended that you
          use your full name and nothing strange or unusual,
          as  that  can  appear  extremely  rude  to  people
          receiving your mail.

maildir   This is the default mail folder.  It  is  used  to
          expand  filenames  in  the  mailer  when specified
          using the '=' metacharacter.  That is, if you save
          to file "=/stuff" then the '=' will be expanded to
          the current value of maildir.

mailbox   This is where to put incoming  mail  after  you've
          read  it.   When  you  answer  'y' to the "save to
          mailbox?" prompt, this is where the messages go!

editor    The editor to use when typing in message  to  peo-
          ple.

print     This indicates how to print out a message.   There
          are two possible formats for this string, either a
          command that can have a filename affixed to (as  a
          suffix) and then sent to the system for execution,
          or a string that contains the  meta-sequence  '%s'
          which will be replaced by the name of the file and
          then also sent to the  shell.   Examples  of  each
          are;

                  print = print -formfeed
                  print = pr %s | lpr


prefix    When you reply to a message or forward  a  message
          to  another person, you can optionally include the
          original message.  Defining the prefix value  here
          allows  you  to  indicate  what the prefix of each
          included line should be.  The default is "> "  and
          is fairly standard in the Unix community.

savemail  This is where  outgoing  mail  will  have  a  copy
          silently  (and  quickly) saved.  This will only be



Page 2







Msg Users Guide                                  Version 3.2



          used if the flag 'copy' is turned on.   Also  note
          that if the 'savename' flag is turned on then this
          line is ignored since  each  outgoing  message  is
          saved according to whom it's being sent to.

shell     This defines the  shell  to  use  when  doing  '!'
          escapes  and  such.   Note  that  the program also
          reads the  $SHELL  variable  out  of  the  current
          environment,  but that defining this in the .msgrc
          file will override the environment definition.

weedout   This is something new and exciting!  When specify-
          ing this option, you can then list as many headers
          of messages that you don't want to  see  when  you
          are read mail.  This list can continue for as many
          lines as desired, as long as the  continued  lines
          all have leading indentation.

alternatives This is a list of other machine/username combi-
          nations  that  you  receive mail from (forwarded).
          This is used when  the  G)roup  reply  feature  is
          invoked  to  ensure that you don't send yourself a
          copy of the outbound message.

autocopy  This is a boolean flag, and if set will  automati-
          cally  copy the text of each message being replied
          to into the edit buffer.  This is the same as  the
          '-a' starting parameter.

copy      This, in combination with the "savemail" filename,
          will allow you to have silent copies of all outgo-
          ing mail made on the outbound step.

resolve   This is a boolean flag that defines the  behaviour
          of  the program for such actions as deletion, sav-
          ing a message and so on.

weed      This is a boolean flag that, in  combination  with
          the  "weedout"  list,  allows you to custom define
          the set of headers you  would  like  to  not  have
          displayed  while  reading  messages.  The defaults
          are listed further into the document.

noheader  This boolean flag tells the mailer not to  include
          the  headers  of  messages  when copying a message
          into a file buffer for replying to or forwarding.

titles    This boolean flag allows you to have each page  of
          a message to be titled with:
          Message #N from username        Mailed date at time
          where all  the  information  has  been  previously



Page 3







Msg Users Guide                                  Version 3.2



          extracted  from  the  message.  This is especially
          useful if you weed out all  the  headers  of  each
          message with a large 'weedout' list...

Two more things: the format for each of the lines is;

        variable = value

and for boolean variables, value can be 'ON' or 'OFF' only.

For a better idea of how this all works,  here's  my  .msgrc
file.   While  looking  through it, notice that you can have
lots of comments and blank lines for  readability  and  that
you can also use 'shell variables' and the '~' metacharacter
for your home directory, and they are  expanded  accordingly
when read in by the mailer.

  #
  # .msgrc - automatic variable defines for the 'msg' mailer.
  #
  # Personalized for Dave Taylor
  #

  fullname = Dave Taylor

  # where to save my mail to, default directory
  maildir  = ~/Mail

  # where to save messages to, default file
  mailbox  = ~/Mail/mailbox

  # what editor to use
  editor   = $EDITOR

  # where to save mail if not specified somewhere else
  savemail = ~/Mail/mail.sent

  # how to print a message ('%s' is the filename)
  print    = /usr/local/bin/print -p lpn -f %s

  # prefix sequence for including message text in other messages...
  prefix = >

  # what headers I DON'T want to see, ever.

  weedout  = "Via:"  "Sent:"  "Date:"  "Status:"  "Original"
             "From"  "Phase"  "Subject:"  "Fruit"  "Sun"
             "Lat"  "Buzzword"  "Return"  "Posted" "Telephone"
             "Postal-Address" "Origin" "X-Sent-By-Nmail-V"
             "Resent" "X-Location"  "Source" "Mood"  "Neuron"
             "Libido" "To:" "X-Mailer:"  "Full-Name:" "X-HPMAIL"



Page 4







Msg Users Guide                                  Version 3.2



             "Cc:" "cc:" "Mmdf" "Network-"

  # automatically copy message being replied to into buffer?
  autocopy = OFF

  # save a copy of all outbound messages?
  copy     = ON

  # emulate the mailx message increment mode (only increment after something
  # has been 'done' to a message, either saved or deleted)
  resolve  = ON

  # enable the weedout list to be read...
  weed     = ON

  # when messages are copied into the outbound buffer, don't include headers
  noheader = ON

  # display message title when displaying pages of message
  titles         = ON

  # alternative addresses that I could receive mail from (usually a
  # forwarding mailbox)

  alternatives = hpcnof!dat,  hpcnof!d_taylor,   hpcnou!d_taylor,
                 hpcnou!root, hpcnou!postmaster, hpcnoe!d_taylor,
                 hpcnoe!dat,  hpcnoa!d_taylor,   hpcnoa!dat,
                 hpfcla!d_taylor

Along with this, there is still an environment variable that
the  mailer  checks  for,  namely  "EDITOR",  which can also
define what editor to use when entering messages.   As  with
the shell variable, having an editor specified in the .msgrc
file  will  override  anything  read  in  from  the  current
environment.




3.  The Starting Parameters

     There are a number of starting options to the msg  pro-
gram, with only one that needs to be remembered: '-?'or '-h'
for help.

The flags are;

   -d     Debug.  Useful for debugging the msg program.  The
          results  of  using  the  debug option is much less
          drastic than in the previous versions of the  pro-
          gram  -  it  creates a file in your home directory



Page 5







Msg Users Guide                                  Version 3.2



          called "Msg.debug.info" and  creates  a  (verbose)
          log of activity as the program is used.

   -f <file> File.  Read  specified  file  rather  than  the
          default input mailbox.

   -h or -? Help.  Gives a short list of all  these  options
          and exit.

   -k     Keypad - This option, when used, lets the msg pro-
          gram  know  that  you're on an HP terminal, and it
          can then interpret the PREV  NEXT  and  HOME/DOWN-
          HOME  keys  accordingly.   If you are not on an HP
          terminal, it is recommended that you  do  NOT  use
          this option.

   -s     Softkeys.  The msg mailer can, to a rather limited
          extent, use the HP softkeys as an alternative form
          of input.  If you specify this option be sure that
          you're on an HP terminal that can accept the stan-
          dard 2622 terminal escape sequences!

   -z     Zero.  This causes the mailer not to be started if
          you  don't  have  any  mail.    This  emulates the
          behaviour of programs like 'mailx'.

   -S <subject> In batch mode, this is how to  indicate  the
          subject  of the resulting message.  Please see the
          section  on  "Non-Interactive  Uses  of  Msg"  for
          further information.

     All the above flags default to reasonable  options,  so
there is usually no need to use them.




4.  Non-Interactive Uses of Msg

     Before we discuss the main mail system, it's worth not-
ing  that  there  are  a couple of other ways to use the msg
mail system, namely to 'send only' and to send files (batch-
mail).

     To send a message to someone without any of the associ-
ated  overhead  of  the  main  system  being loaded, you can
invoke the mailer with the name(s) of the people to send to.
The  mailer  will  then prompt for Subject, Copies, and then
drop you in your (defined in the ".msgrc"  file)  editor  to
compose  the  message.    When  composition is complete, the
program verifies transmission then terminates.  For example;



Page 6







Msg Users Guide                                  Version 3.2



  $ msg dat
  To: ihnp4!hpfcla!d_taylor
  Subject: this is a test
  Copies To: <return>

  <invokes editor, message composed, then>

  Are you sure you want to send this? (y/n) y

  mail sent.

  $

Note that the user input is in bold face,  so  you  can  see
that the mailer verified the alias expansion too!


     The mailer also supports batch type mailing,  of  files
and so on, by using the following starting sequence;

  $ msg -S "File help.c" dat < help.c

which will read in the file and transmit it to the specified
user  with  the specified subject.  Note that the program is
intelligent enough to check to see what the  stdin  is  from
this invocation, so a command of the form

  $ msg -S "file help.c" dat

would result in the following sequence (since the program is
reading the "standard in" for information;

  $ msg -S "file help.c" dat
  To: ihnp4!hpfcla!d_taylor
  Subject: file help.c

  Enter your message, ending with ^D

  this is the message
  Please don't ask me why I used this wierd mode!

  ^D
  <end-of-message>

  $

which is reasonable behaviour!!  (not only that, but this is
almost exactly what /bin/mail does in the same situation!!)






Page 7







Msg Users Guide                                  Version 3.2



     Enough of this foolishness, however, let's get onto the
real stuff;




5.  The Main System

     Upon entry to the program,  the  main  screen  will  be
displayed as below;


-----------------------------------------------------------------
Mailbox is '/usr/mail/mymail' with 13 messages.  [Version 3.0]

   1<-   Apr 3  rob             Doing anything tonight?
   2     Apr 5  hplabs!joe      bug in gammon game
   3     Apr 5  root
   4     Apr 6  root            (continuation of previous message)
U  5     Apr 8  decvax!mouse    Re: net.music article decvax:495
   6     Apr 13 John Jacobs      How can you hate RUSH?
   7     Apr 15 kevin           More software requests
N  8     Apr 18 games           Hi there
N  9     Apr 18 Dave Taylor     EditFile.c source...
N 10     Apr 23 veeger!carl     More silly stuff


|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern
A)lias, C)hange mailbox, D)elete, F)orward, G)roup reply, M)ail,
N)ext, P)rint, R)eply, S)ave to file, Q)uit, U)ndelete, or eX)it

Mail :@
-----------------------------------------------------------------



     There are a number  of  things  to  notice  about  this
screen;

   o The top line always displays the current mail file, the
     number  of  messages  in  the file, and the current msg
     version number.

   o On the left side of each message is the message  number
     which is unique for each message in the file.

   o The arrow ('<-') always points to the current  message.
     This  is  the  message that the commands having default
     message numbers (such as D)elete, and N)ext) will  work
     with.




Page 8







Msg Users Guide                                  Version 3.2



   o The date associated with each message is the  date  the
     person  sent  the  message.  This is obtained by either
     the oldest of the ">From" line dates, or, if  possible,
     by parsing the "Date:" line.

   o The  third  field  displayed  is  a  truncated   'from'
     address,  and  will  indicate whom the message is from.
     Note that on the sixth and ninth  messages  full  names
     appear instead of the usual machine!login format.  This
     is because these messages have a From line of the form:

             From: fullname <address>
     or      From: address (fullname)

     which the mailer reads and displays if  possible.   The
     msg mailer (version 2.1 and beyond) also generates this
     header line on outgoing mail.

   o The final field is the (optional) subject of  the  mes-
     sage.  Note that message 3 has no subject.

   o Message five is an 'Urgent' message  (it  contains  the
     header

             Priority: Urgent

     to make it urgent) that should be read immediately.

   o Messages 8 thru 10 are new since the last time the user
     read  their mail - the "N" in the leftmost margin indi-
     cates this.

   o A maximum of ten messages are displayed at  one  time*.
     Further  into  the  document  we'll learn how to change
     'pages' in the mailbox.

   o The three line mini-menu will always indicate what com-
     mands are available at the current moment.

   o Finally, the '@' character indicates where  the  cursor
     would be, awaiting your input.

     The typical action at this point is to use the <return>
key  to  read  the  current message.  This particular option


__________

 0. On terminals with greater than 25 lines, more messages
    will be displayed automatically.




Page 9







Msg Users Guide                                  Version 3.2



isn't noted in the  mini-menu,  but  choosing  the  '?=help'
option  will  inform  you  of a number of choices other than
those in the basic menu!

     Pressing this key will clear the screen and display the
first  page  of the message.  At the bottom of the page, the
system will write either;

Please press <space> to continue             <xx> lines left

or

Please press <space> to return

These indicate how much of  the  current  message  has  been
read: 'continue' indicates the presence of at least one more
line of information (the exact number will be  indicated  on
the  right hand side as 'xx lines left').  Pressing <return>
rather than <space> will automatically  return  you  to  the
main system level at any page of a message.

     When the message continues onto another  page  the  msg
mailer  will  also  indicate  how many lines are left in the
message...

     If resolve-mode is turned off (see the 'resolve'  flag)
the  current message pointer (the arrow) will be incremented
after reading the message and will point to the next message
in the list.

     As you can see, it would be  quite  simple  to  quickly
read  through  all  the pending mail by repeatedly using the
<return> command at the menu  level,  and  the  <space>  bar
while reading each message!

     While reading is perhaps the most fundamental  function
that  the  msg program performs, there are a number of other
options available, namely;


Command                  Action


   |                  Pipe current message to specified com-
                      mand.
   !                  Shell escape.
   ?                  A help screen listing commands
   +, <space>, or <NEXT> Next page of headers
   -, or <PREV>       Previous page of headers
   =, or <HOME>       Set current message to 1
   *, or <SHIFT>-<HOME> Set current to last message.



Page 10







Msg Users Guide                                  Version 3.2



   <n>                Set current message to n

   a                  Alias, change to 'alias' mode
   c                  Change current mail file
   d                  Delete current message
   f                  Forward message to specified user
   g                  Group reply - reply  to  everyone  who
                      received the current message
   h                  Display message + headers
   j                  Increment current message by one
   k                  Decrement current message by one
   m                  Mail to arbitrary user(s)
   n  or  <return>      Next  message  (Read  current,  then
                      increment)
   o                  Option.  Alter current options.
   p                  Print current message.
   r                  Reply to the author of current message
   s                  Save current message to file
   t                  The current time and date is displayed
   q                  Quit - mail deleted, saved in mbox  or
                      left.
   u                  Undelete current message
   v                  Variables.  Display current variables.
   x                  Exit - don't  record  as  read,  don't
                      save...

   ^L                 Rewrite screen.
   ^M (<return>)      Read current message
   ^Q, ^Z, DEL        Exit - don't  record  as  read,  don't
                      save...


That are all the commands available at the main level of the
msg  program!   Now  you can see why it is nice to leave the
three-line menu displayed!



     As an example, let's enter a  series  of  commands  and
indicate what the display would be after each one;


First off, let's go to the next page of mail with '+';











Page 11







Msg Users Guide                                  Version 3.2



-----------------------------------------------------------------
Mailbox is '/usr/mail/mymail' with 13 messages.  [Version 3.0]

N 11<-    Apr 27 Jack           Wanna buy some albums cheap?
N 12      Apr 28 Jack           Cancel the previous offer!
N 13      Apr 30 sdcsvax!dx     Moving day (long)









|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern
A)lias, C)hange mailbox, D)elete, F)orward, G)roup reply, M)ail,
N)ext, P)rint, R)eply, S)ave to file, Q)uit, U)ndelete, or eX)it

Mail :@
-----------------------------------------------------------------

     We need to move the current message pointer to  message
11, so type in '11', then let's read the new current message
by using the next command (typing <return>)...


-----------------------------------------------------------------

Message #11 from Jack           Mailed December 7, 1984 at 8:45 pm

Hey Dave! I've got some old AC/DC and KISS albums, and as I know
you are a collector, do you want to buy them off of me before
I make ashtrays out of them (or frisbees...)?

                        Humourously,
                                        Jack The Gripper







Please press <space> to return: @

-----------------------------------------------------------------







Page 12







Msg Users Guide                                  Version 3.2



     Needless to say,  we  can't  let  this  message  go  by
without  replying!  So let's press the <space> bar to return
to the main menu, then use the reply command to respond.

     After pressing the 'r' key, the program asks if a  copy
of  the  source  message is desired (the character under the
cursor indicates the default if  <return>  is  pressed.   In
this case, the default is 'no');

copy source message? (y/n) @

     We choose to answer no, so press the 'n' key.  Next msg
verifies that the subject is okay;

Subject: Re: Wanna buy some albums cheap?@

Typing anything other than <return> will allow us to  change
the  subject to something more appropriate.  Furthermore, if
we choose to type our "kill line" character (the same as the
one  the  shell  uses,  probably Control-U or Control-X) the
entire line will be erased.  We decide, however, to leave it
be and press return.

Finally, we're asked if we want to send copies of this  mes-
sage  to  anyone.   We  don't, so we press <return> one more
time.

     The program then puts us in the vi editor (the default,
assuming  no other editor specified by the '.msgrc' variable
"editor") with a blank file.

     After having entered a suitable  reply,  and  left  the
editor,  the msg system then verifies that we really want to
send the message with;

Are you sure you want to send this message? (y/n) @

To which the response is 'y' for 'yes'.  It then  sends  the
message  off  to  Jack,  who will receive it hopefully quite
soon (or at least  before  he  makes  ashtrays  out  of  the
albums!)


     Also, if we have a file  called  ".msgheaders"  in  our
home directory, the mailer will include those headers in the
outbound message.  This is to  allow  custom  (personalized)
mail,  especially  headers  like  "Organization:" and "Loca-
tion:".






Page 13







Msg Users Guide                                  Version 3.2



     Message 11 is still the current message, so,  now  that
we  have  saved  it, let's mark it for deletion by using the
delete command 'd'.

     The screen is now;


-----------------------------------------------------------------
Mailbox is '/usr/mail/mymail' with 13 messages.  [Version 3.0]

N 11    * Apr 27 Jack           Wanna buy some albums cheap?
N 12<-    Apr 28 Jack           Cancel the previous offer!
N 13      Apr 30 sdcsvax!dx     Moving day (long)










|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern
A)lias, C)hange mailbox, D)elete, F)orward, G)roup reply, M)ail,
N)ext, P)rint, R)eply, S)ave to file, Q)uit, U)ndelete, or eX)it

Mail :@
-----------------------------------------------------------------



     Now lets go back to the first page of messages by typing '=';





















Page 14







Msg Users Guide                                  Version 3.2



-----------------------------------------------------------------
Mailbox is '/usr/mail/mymail' with 13 messages.  [version 2.2]

   1<-   Apr 3  rob             Doing anything tonight?
   2     Apr 5  hplabs!joe      bug in gammon game
   3     Apr 5  root
   4     Apr 6  root            (continuation of previous message)
U  5     Apr 8  decvax!mouse    Re: net.music article decvax:495
   6     Apr 13 John Jacob       How can you hate RUSH?
   7     Apr 15 kevin           More software requests
N  8     Apr 18 games           Hi there
N  9     Apr 18 Dave Taylor     EditFile.c source...
N 10     Apr 23 veeger!carl     More silly stuff



|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern
A)lias, C)hange mailbox, D)elete, F)orward, G)roup reply, M)ail,
N)ext, P)rint, R)eply, S)ave to file, Q)uit, U)ndelete, or eX)it

Mail :@
-----------------------------------------------------------------



     Gee..note five not only looks  mildly  interesting  but
it's  an  Urgent  message  too!   So let's read it by typing
'5'<return> to make that  the  current  message,  and  press
<return>  again  to  read  it.  After reading the message we
decide that this seems like a message worth keeping  in  the
'music'  mailbox,  so lets do that by using the save to file
command!

     Pressing 's' results in the msg system prompting;

Save to what file : @

to which we reply '=/music'.  The file is then saved in  the
directory  we  specified as mail home via the '.msgrc' vari-
able "maildir". After saving, the  "Mail:"  prompt  returns,
with  message  5 marked for deletion and the current message
pointer incremented to message 6.

     Before we finish up, we suddenly remember that  one  of
the  messages  was  supposed to be about how to write decent
documentation for Unix systems, so let's try to find it...

     First off, we'll move back  to  message  one  with  the
<HOME>  key (you'll need to use the "-k" starting option and
be on an HP terminal for this to work!) and then use the '/'
pattern matching command:



Page 15







Msg Users Guide                                  Version 3.2



Mail: Pattern                 / = match anywhere in messages
Match pattern: @

we'll type in 'document' and see if the system can find  it.
After  a brief second or two it returns 'pattern not found.'
Hmm...maybe it's not either the from or the subject  of  any
of  the  messages...In  case,  let's try using the new match
anywhere in message command;

Mail: @

To which we type '/' for pattern matching;

Mail: Pattern                 / = match anywhere in messages
Match pattern: @

Now we'll use '/' again to get the match  anywhere  in  file
option, and then get the prompt;

Match pattern (in entire mailbox): @

to which we respond 'document' again.

     The msg mailer then searches through each line  of  all
the  messages  in  the  file  and  moves the current message
pointer to message number 7.  A  quick  check  reveals  that
this  message  indeed contains the word 'document', but it's
not the one we want, so we're going to just get outta here!

     We've had enough mail for today, so lets  quit,  saving
all messages in our mailbox as defined in the '.msgrc' file,
except messages 5 and 11, which are marked for deletion.

     Quit prompts;

Delete messages? (y/n) @

to which we answer 'y' for yes.  The next prompt is then;

Keep mail in incoming mailbox? (y/n) @

To which we also answer yes...the program then quickly saves
the  files,  removing message 5 and 11 as it goes along, and
exits.










Page 16







Msg Users Guide                                  Version 3.2



6.  Responses...



     This section will discuss each command in the msg  pro-
gram  in  more  detail than above, including the prompts the
user can expect upon executing the command, the  meaning  of
different options etc etc.


   |      Pipe.  This command allows you to pipe the current
          message  through other filters as you desire.  The
          shell used for the entire command will  be  either
          the  one  specified  in your ".msgrc" file, or, if
          none, /bin/sh.

   !      Shell.  This allows you to send a command  to  the
          shell without leaving the program.

   ?      Help.  This command produces  a  two-page  display
          that  details  all  the  commands  available  in a
          reference guide format.

   /      Pattern match.  This command, on  the  top  level,
          allows the user to search through all the from and
          subject lines of the current mailbox  starting  at
          the  current  message  and  continuing through the
          end.  If the first character of the pattern  is  a
          '/', then the program will try to match the speci-
          fied pattern against  ANY  line  in  the  mailbox.
          Again,  this works from one after the current mes-
          sage through the end.

   <n>    Specify new current message.  Typing in any of the
          digits  one  thru nine will result in the msg pro-
          gram producing the prompt 'Set current  to  :  n',
          where 'n' is the digit entered. Note that changing
          the current  message  to  a  message  not  on  the
          current  page  of the headers will result in a new
          page of headers being displayed.

   a      Alias.  The alias system is a way  by  which  more
          complex  mail  addresses  can be shortened for the
          mail user.  For example;

          joe, blow : Joe Blow : veeger!hpcnoe!hpcfla!jblow

          which allows mail to 'joe' with the system expand-
          ing the address properly.  As is obvious, this not
          only saves remembering complex addresses, it  also
          allows  the  address to be optimized to go through



Page 17







Msg Users Guide                                  Version 3.2



          the minimum number of machines without anyone hav-
          ing to be informed of the change.  A more detailed
          discussion can be found in  the  section  entitled
          'The Alias System'.

   c      Change mailbox.  Specifying  this  command  allows
          the  user  to  change  the  mailbox  file  that is
          currently  being  read.   This  is  intended   for
          perusal and reply to previously archived messages.
          The prompt is 'Name of new mailbox : ' and  enter-
          ing <return> cancels the operation, while entering
          a filename causes the program to read that file as
          the  new  mailbox  file, if possible.  As with the
          "save" command,  this  command  expands  filenames
          with  '~'  being your home directory and '=' being
          your MAILDIR directory, if defined.  This  command
          also  allows  the special character '!' to be used
          to allow you to change  to  the  default  incoming
          mailbox.

   d, u   Delete and Undelete.  Neither of  these  two  com-
          mands  have  any prompts and indicate their action
          by either adding an asterisk to the  current  mes-
          sage  index entry (indicating deletion pending) or
          removing the asterisk (indicating that  the  dele-
          tion is cancelled).

   f      Forward.  Allows the user to forward  the  current
          message  to  another user. This copies the message
          into the edit buffer and allows the  user  to  add
          their  own  message  too.   The prompt is 'Forward
          to:' and will expand an alias if entered.

   j, k   These two keys work similarly to what  they  would
          do  in  'vi'  or  any of the other screen oriented
          programs.  The 'j' key moves the  current  message
          pointer  down  to  the  next message (going to the
          next page if needed) and the  'k'  key  moves  the
          current  message pointer back to the previous mes-
          sage (also changing pages if needed)

   m      Mail.  Send mail to a specified user.  The  prompt
          that is associated with this command is 'Send mail
          to :'.  Entering an alias name results in the full
          address  being  rewritten  in  parenthesis immedi-
          ately.  This  prompt  is  followed  by  'Subject:'
          which  allows  the  user to title their note.  The
          final field is 'Copies to: ', which  allows  other
          people specified to receive "carbon copies" of the
          message. Upon entering all three items the vi edi-
          tor  (or any other editor specified by $EDITOR) is



Page 18







Msg Users Guide                                  Version 3.2



          invoked and the message can be composed.

   n      Next message.  See above.

   o      Options.  This is a small  subsystem  of  the  msg
          system  with the various options selected by their
          first letter, '1' enabling the option,  '0'  disa-
          bling  it  and  <return> leaving it unchanged. 'r'
          returns to the main system.

   p      Print message.  This allows you to print  out  the
          current  message  to  a previously defined printer
          (see the section on the  '.msgrc'  discussing  the
          "print" variable)

   q      Quit.  This command's action is dependent  on  the
          current state of the msg program.  For example, if
          the current mailbox is  the  default  mailbox  the
          messages  that  are  not  deleted are saved in the
          file $home/mbox, whereas  if  it  is  a  specified
          mailbox  the  to-be-deleted  messages  are removed
          from the file.  The possible prompts are 'Save  to
          mailbox?' if the default mailbox is being read and
          there is at least one message to save, 'Delete all
          messages'  if  all  messages  in  any  mailbox are
          marked for deletion or 'Delete message(s)?' if not
          reading  the  default  mailbox  and there are some
          messages that should be saved.  A response of  'n'
          (no)  to any of these questions will result in the
          quit  command  aborting,  and  the   files   being
          untouched.

   r      Reply.  Reply to the author of  the  current  mes-
          sage.   If the autocopy flag is not specified, the
          program will prompt 'Copy Message? (y/n)' to which
          the  user can specify whether a copy of the source
          message is to be copied into the edit  buffer,  or
          not.  If copied in, all lines from the message are
          prepended with the prefix character  sequence,  as
          specified in the users ".msgrc" file.

   s      Save to file.  As demonstrated in the above  exam-
          ple, this command allows the current message to be
          copied into an arbitrary file.  If there  is  any-
          thing   in  the  file  currently  the  message  is
          appended to the end, otherwise the file is created
          containing  only the message.  The prompt for this
          command is 'Save to  file  :  '.   A  response  of
          <return>  cancels the command and returns the user
          to the system prompt.  After saving  a  file,  the
          message  is  marked  for  deletion and the current



Page 19







Msg Users Guide                                  Version 3.2



          message pointer is  incremented.   There  are  two
          available   meta-characters   when   specifying  a
          filename too - '~' as the first character  expands
          to your home directory, and '=' as the first char-
          acter expands to the mail folder directory defined
          via  the  'maildir' variable in the users ".msgrc"
          file.

   t      Time.  This simply displays the current  date  and
          time in a nice readable format.

   v      Variables.  This is also a small subsystem of  the
          msg  system  allowing  you  to  alter the value of
          various msg variables.  The variables that you can
          change  are the 'EDITOR' variable which determines
          what editor to use when you compose a message, the
          'MAILBOX'  variable  which indicates where mail is
          to be put after being  read,  and  the  'USERNAME'
          variable.   (Note  that  only  the  superuser  can
          change their username within the program)

   x      Exit.  This is functionally the same as  answering
          'n'o to the quit command prompt, and simply leaves
          the program in the quickest possible manner.  This
          command   can   also  occur  from  typing  DELETE,
          control-Q or control-Z, all of which are also exit
          commands.




7.  Special Outgoing Mail Processing



     There are a few extra features that the  mailer  offers
on outgoing mail that are worthy of mention;


     The first, and probably the most exciting  feature,  is
the ability to send encrypted mail!  To do this is extremely
simple:  You need merely to have two 'key lines'  "[encode]"
and "[clear]" in the message body.

     Consider the following outgoing message:

        Joe,
                Remember that talk we had about Amy?  Well,
        I talked to my manager about it and he said...

        uhh...better encrypt this...the usual 'key'...



Page 20







Msg Users Guide                                  Version 3.2



        [encode]

                He said that Amy was having family problems
        and that it had been affecting her work.

                Given this, I went and talked to her, and
        told her I was sorry for getting angry.  She said
        that she understood.

                We're friends again!!
        [clear]

                Exciting stuff, eh?

                                         Mike

While this is obviously quite  readable  while  being  typed
into  the  editor,  as  soon  as the message is confirmed as
wanting to be sent, the msg mailer prompts with;

        Enter encryption key: @

and accepts a key  (or  series  of  8  or  less  characters)
without  echoing  them  to the screen.  After entry, it will
ask for the same key again to confirm  it,  then  *poof*  it
will encrypt and send the mail!

     If you have the "copy" option enabled, the program will
save  your  copy  of the message encrypted too.  (This is to
ensure the privacy and security of your archived mail too!)

     If the mailer doesn't ask for the encryption key,  it's
because you don't have the '[encode]' entered as the first 8
characters of the line.  It MUST be so for this to work!!

     On the other end, a person receiving  this  mail  (they
must  also be using msg to receive it, since this mailer has
a unique encryption program) will be reading the message and
then suddenly be prompted;

        Enter decryption key: @

and will again be asked to re-enter it to confirm.  The pro-
gram  will then on-the-fly decrypt the mail and display each
line as it is decoded.  The '[clear]'  line  signifies  that
the block to encrypt is done.

     For those sites not running msg, I also have  available
the  encryption  code  as  a separate program suitable for a
filter for use with other mailers...




Page 21







Msg Users Guide                                  Version 3.2



     The other option on outgoing mail  is  the  ability  to
specify  what  section  of  the  message  you  want  to have
archived (assuming "copy" is enabled) and what  section  you
don't.   This  is  most  useful  for sending out source file
listings and so on...

     To indicate the end of the section that should be saved
in the archive, you need merely to have the line

        [no save]

appear by itself on a line.  This will be removed  from  the
outgoing  mail,  and will indicate the last line of the mes-
sage in the saved mail.




8.  The Mail Archive File



     The format of the mail saved to  the  archive  file  is
also  worth a quick discussion.  Unlike the usual exact copy
of the entire header section, the archived mail has the fol-
lowing header;

        From To:<name> 15 Jan 1985 4:54:30 MST
        Original-To: <address>
        Subject: <subject>

        <message body>

The first line, the 'From'  line,  is  deliberately  mangled
with the occurance of the 'To:<name' to ensure that when you
are perusing your archive file with the mailer that you  see
WHO  the  message was TO, since they're all going to be FROM
you!!  The <name> will either be the  machine!login  of  the
person, or, if used as an alias, it will be the alias name.

     To read this file, you can use the mailer, choosing the
"C)hange  mailbox"  command,  or  start  up  specifying your
archive file as the mailbox to read.











Page 22







Msg Users Guide                                  Version 3.2



9.  Using MSG with the Notes System



     A new and innovative feature in the 3.0 release of  the
msg  program is the ability to read files saved by the notes
system and display  them  as  individual  messages.   Unfor-
tunately,  the notes software does not currently save a note
with the subject line, however, so the mailer uses the  next
best thing and displays each note in the form:

    1  Apr 5  hplabs!kundler    Note from group net.unix-wizards
    2  Apr 7  hplabs!richards   Note from group net.unix-wizards

and so on.  The individual notes can be replied to by  using
the  reply command, as with normal mail, and the mailer will
modify it's behaviour to work with this particular brand  of
mail file.

     How does the mailer know if it's reading  a  file  that
contains normal mail versus a saved set of notes?  By check-
ing the first line of the file - if  it's  the  header  line
that  notes emits (ie "/***** host:login / notesgroup / date
**/") then the file is considered to be a  notes  file.   If
not, the default for unknown files is to assume they're mail
files.




10.  The Alias System



     As mentioned previously, there exists in the msg system
a set of aliases that associate an arbitrary word (such as a
persons name) to a complex address or group. The  advantages
are  readily apparent; rather than remembering an address of
the form;

machine1!machine2!machine3! ... !machineN!account

the user merely has to remember a single word.

     Two alias tables are available for a each  user  within
msg, namely the system alias file and the users' alias file.
The system alias file is created and maintained (by the sys-
tem      administrator)      by     editing     the     file
'/usr/mail/.alias_text' as described  in  the  documentation
with  the  newalias  command, then running the newalias pro-
gram.



Page 23







Msg Users Guide                                  Version 3.2



     An individual user can also have an  alias  file  which
works  in  conjunction with the system aliases.  To do this,
they  need  merely  to  peruse  the  documentation  for  the
newalias  command  and  create  a file as indicated therein.
After executing the program, the aliases will  be  available
for using from within msg.

     The command checkalias is also useful  to  ensure  that
the aliases are installed correctly.

     Within msg,  however,  the  alias  system  acts  as  an
entirely  different  program, with it's own commands and own
mini-menu.  The menu replaces the standard mini-menu with;


---------------------------------------------------------------------

                       Alias commands

A)lias current message, C)heck alias, M)ake user alias, R)eturn


Alias: @
---------------------------------------------------------------------


The commands are;

   a      Alias current message. This  allows  the  user  to
          create an alias that has the return address of the
          current message as the address field of the alias.
          It  prompts  for  a unique alias name.   Important
          note: when you alias an address in  this  fashion,
          the  mailer  will  try  to  minimize the amount it
          needs to store by  iteratively  comparing  machine
          names  in  the  path  with  the  machines  in  the
          pathalias database.  Once it finds  an  entry  the
          address will be saved at that point.   For further
          information, please  see  the  "Msg  Alias  System
          Guide".

   c      Check alias.  This is a  simple  way  of  checking
          what  is in the alias database - it prompts for an
          alias name, and  returns  the  address  associated
          with  that  name  or  the error message 'alias not
          found' as appropriate.

   m      Make user alias.  This will prompt  for  a  unique
          alias  name and then for an address.  The informa-
          tion provided will be  added  to  your  individual
          alias_text file ($home/.alias_text) and then added



Page 24







Msg Users Guide                                  Version 3.2



          to the database.

   r      Return.  Return to the main level of the msg  pro-
          gram.




11.  While We're Talking Aliases...

     Another feature worthy of discussion, since  it's  been
getting  lots of veiled references throughout this document,
is the system alias section.  This is implemented using  the
uucp  pathalias  database,  with  a  file (whose location is
specified in the hdrs/sysdefs.h file - see the Configuration
Guide) in the format:

  hostname <tab> address!%s

The actual details of the file are, suprise suprise, located
in the Alias System Users Guide.

     Anyway, to use them is quite  simple...when  specifying
the  address  of  someone,  you can either have an alias for
them already, resond to their mail to you, or use the system
alias feature!

     Enough hype, right?  Okay...to use  this  feature,  you
specify  an  address  by either "machine!person" ignoring if
your specific machine  can  talk  directly  to  the  machine
specified,  or, if you prefer the ARPANET addressing scheme,
"person@machine".  When you enter the address as  specified,
the  mailer  will quickly search through the pathalias data-
base file and expand the specified address to be  a  legiti-
mate routing address.

     What's really nice about this is that the address  that
we're going to send to can be either on ARPA, CSNET, BITNET,
uucp, or any other network.  The method  of  specifying  the
basic address is the same regardless!

     For example,  mail  to  me  could  be  sent  as  either
"hpfcla!d_taylor"  (or  "hpfcla!hpcnof!d_taylor",  with  the
first machine name  being  expanded)  or  "d_taylor@hpfcla".
msg will expand them both in the same manner.

     As the song goes, check the alias guide...







Page 25







Msg Users Guide                                  Version 3.2



12.  Expert Mail Users and Debugging the Mailer

     There are some additional facilities available  in  the
msg  mailer for those people who are knowledgable about mail
protocols, or trying to debug/track down a problem.

     The 'h' command at the outermost level  of  the  mailer
will  display  the current message ignoring the current set-
ting of the 'weed' option.  This is most useful for  answer-
ing questions of the form "I wonder what this guy put in his
header?" and such.  This command does not  show  up  on  the
mini-menu  because  it  is  somewhat  esoteric,  but it DOES
appear on the '?' help screen (can you find it there?).

     The '@' command at the outermost level  of  the  mailer
will output a screen of debugging information, including the
number of lines and offsets of each of the  message  in  the
current mailbox.

     The '#' command at the outermost level  of  the  mailer
will  display  the  entire stored 'record structure' for the
current message.

     The '%' command at the outermost level  of  the  mailer
will display the full computed return address of the current
message.

     Starting up msg with the "-d" debug option will  create
a file called Msg.debug.info in your home directory and con-
tain a wealth of useful information (to me,  at  least!)  to
aid in tracking down what errors are occuring and why.  With
this option on, most  everything  acts  the  same  with  the
exception  of when you get new mail while in the mailer - it
will indicate "New mail: N bytes" rather than the usual "New
mail has arrived...hang on...".


     If there are any problems with the mailer,  please  try
to  recreate  the error with the debug option enabled before
sending defect reports my way.


     One final note: all error numbers reported by the  pro-
gram are defined in the HP-UX Reference Manual in Errno(2).










Page 26







Msg Users Guide                                  Version 3.2



13.  Credits and so on

     This mailer has been evolving over the past year or  so
with some extremely valuable input from the following people
at Hewlett Packard; Mark Laubach, Walt Underwood,  Tw  Cook,
Larry  Fenske,  Rob  Sartin,  and  of course Carl Dierschow.
There have been many others, to numerous  to  mention,  that
have   inspired  me  with  questions  like  "why  can't  the
mailer..." or "why does it do that?"

     Also helpful was the ability to have my  'own'  machine
to close up the many many iterative loops that this software
has gone through - since being on a big  multi-user  machine
tends to slow it down to a standstill...

     Finally,  it's  also  been  a  very  useful  experience
overall,  confirming  my  beliefs  that  iterative  software
design and keeping a close watch on users (not to mention an
open mind and mailbox!) improves a product manyfold.

     Incidentally, this entire mail system,  including  this
documentation, is

               (C) Copyright 1986 Dave Taylor






























Page 27




SHAR_EOF
if test 50526 -ne "`wc -c < 'Guide.fmtd'`"
then
	echo shar: error transmitting "'Guide.fmtd'" '(should have been 50526 characters)'
fi
fi
exit 0
#	End of shell archive