home *** CD-ROM | disk | FTP | other *** search
- Subject: v06i027: ELM mail system (elm), Part 02/14
- Newsgroups: mod.sources
- Approved: rs@mirror.UUCP
-
- Submitted by: Dave Taylor <pyramid!hplabs!hpldat!taylor>
- Mod.sources: Volume 6, Issue 27
- Archive-name: elm/Part02
-
- # Continuation of Shell Archive, created by hpldat!taylor
-
- # This is part 2
-
- # To unpack the enclosed files, please use this file as input to the
- # Bourne (sh) shell. This can be most easily done by the command;
- # sh < thisfilename
-
-
- if [ ! -d doc ]
- then
- echo creating directory doc
- mkdir doc
- fi
-
- # ---------- file doc/readmsg.1 ----------
-
- filename="doc/readmsg.1"
-
- if [ -f $filename ]
- then
- echo File \"$filename\" already exists\! Skipping...
- filename=/dev/null # throw it away
- else
- echo extracting file doc/readmsg.1...
- fi
-
- cat << 'END-OF-FILE' > $filename
- .TH READMSG 1L
- .ad b
- .SH NAME
- readmsg - read messages from incoming mail
- .SH SYNOPSIS
- .B readmsg
- [\fB-p\fR]
- [\fB-n\fR]
- [\fB-f filename\fR]
- [\fB-h\fR]
- .br
- .B readmsg
- [\fB-p\fR]
- [\fB-n\fR]
- [\fB-f filename\fR]
- [\fB-h\fR]
- number [number ...]
- .br
- .B readmsg
- [\fB-p\fR]
- [\fB-n\fR]
- [\fB-f filename\fR]
- [\fB-h\fR]
- pattern
- .br
- .SH HP-UX COMPATIBILITY
- .TP 10
- Level:
- HP-UX/STANDARD
- .TP
- Origin:
- Hewlett-Packard
- .SH DESCRIPTION
- .I Readmsg
- is a program that gives the \fBElm\fR user the functionality of
- the mailx "~r" command from the editor of their choice. There
- are three different ways of using the program;
- .P
- First off, if you're actually creating a reply to a message
- from within the \fBElm\fR system then \fIreadmsg\fR without any
- arguments will include a summary of the headers and the body
- of the message being replied
- to. If you aren't currently editing a message the program will
- return an error.
- .P
- Secondly, if you want to include certain messages, you can
- specify them by listing their ordinal locations in the
- mail file (that is, their "message numbers")
- up to 25 at a time. The \fImeta-\fRnumber '$' is understood to mean
- the last message in the mailfile.
- .P
- Finally, you can also specify a pattern that occurs in one of
- the messages as a way of including it. This pattern can be
- typed in directly (no quotes) if the words are separated by a
- single space in the actual message. The pattern matching is case
- sensitive, so "Hello" and "hello" are NOT the same thing!!
- .sp
- .P
- The \fB-f\fR flag indicates that you'd rather use the file specified
- for the operations specified rather than the default mailbox (see
- the way \fBElm\fR implements printing multiple messages for more
- information on this...)
- .P
- The \fB-h\fR flag instructs the program to include the entire header
- of the matched message or messages when displaying their
- text. (default is to display the From: Date: and Subject: lines
- only)
- .P
- The \fB-n\fR flag instructs the program to exclude \fIall\fR
- headers. This is used mostly for extracting files mailed and
- such.
- .P
- Finally, the \fB-p\fR flag indicates that the program should
- put form-feeds (control-L) between message headers.
- .sp
- .SH "EXAMPLES"
- First off, to use this from within \fBvi\fR to include the text of the
- current message at the end of the current message, you could
- use the command;
- .nf
-
- !!readmsg
-
- .fi
- (as you hit the 'G' the editor will put you at the bottom of the screen
- with the '!' prompt).
- .sp 2
- Let's look at something more interesting, however;
- .sp
- Suppose you have the mailfile;
- .nf
-
- From joe Jun 3 1986 4:45:30 MST
- Subject: hello
-
- Hey Guy! Wanta go out and have a milk this evening?
-
- Joe
-
- From john Jun 3 1986 4:48:20 MST
- Subject: Dinner at Eight
- From: John Dinley <xyz!john>
-
- Remember you should show up about eight, okay?
-
- - John D -
-
- From xxzyz!cron Jun 3 1986 5:02:43 MST
-
- Cannot connect to server: blob
- Job 43243 deleted from queue.
-
- .fi
- The following commands will result in;
- .nf
-
- $ readmsg 2
- [ display the second message, from John ]
-
- $ readmsg
- [ an error, unless we're calling from \fBElm\fR ]
-
- $ readmsg BLOB
- [ no match - case sensitive! ]
-
- $ readmsg -h connect to server
- [ displays third message, including headers ]
-
- .fi
- .SH FILES
- /usr/mail/<username> The incoming mail
- .br
- $home/.readmsg The temp file from \fBElm\fR
- .SH AUTHOR
- Dave Taylor, Hewlett-Packard Laboratories
- .SH SEE\ ALSO
- newmail(1L), Elm(1L)
- END-OF-FILE
-
- if [ "$filename" != "/dev/null" ]
- then
- size=`wc -c < $filename`
-
- if [ $size != 3454 ]
- then
- echo $filename changed - should be 3454 bytes, not $size bytes
- fi
-
- chmod 644 $filename
- fi
-
- # ---------- file doc/Elm.coversheet ----------
-
- filename="doc/Elm.coversheet"
-
- if [ -f $filename ]
- then
- echo File \"$filename\" already exists\! Skipping...
- filename=/dev/null # throw it away
- else
- echo extracting file doc/Elm.coversheet...
- fi
-
- cat << 'END-OF-FILE' > $filename
- .PH ""
- \"
- \" Cover sheet for the ELM mail system...
- \" format with 'troff -mm Elm.coversheet > Coversheet.fmtd'
- \" or something similar.
- \" (C) Copyright 1986 Dave Taylor
- \"
- .PF ""
- .ds HF 3 3
- .ds HP 12 12
- .SA 1
- .nr Hy 1
- .nr Pt 1
- .nr Pi 8
- .lg 1
- .HM 1 1
- .rs
- .sp 11
- .ce 99
- .ps 25
- \fBThe \s26Elm\s25 Mail System\fR
- .sp 2
- .ps 14
- \fIA Replacement Mailer for All Unix Systems\fR
- .sp 8
- Dave Taylor
- .sp 2
- Hewlett-Packard Laboratories
- 1501 Page Mill Road
- Palo Alto CA
- 94304
- .sp 2
- email: taylor\s12@\s14hplabs \ or \ hplabs!taylor
- END-OF-FILE
-
- if [ "$filename" != "/dev/null" ]
- then
- size=`wc -c < $filename`
-
- if [ $size != 526 ]
- then
- echo $filename changed - should be 526 bytes, not $size bytes
- fi
-
- chmod 666 $filename
- fi
-
- # ---------- file doc/Config.guide ----------
-
- filename="doc/Config.guide"
-
- if [ -f $filename ]
- then
- echo File \"$filename\" already exists\! Skipping...
- filename=/dev/null # throw it away
- else
- echo extracting file doc/Config.guide...
- fi
-
- sed 's/^X//' << 'END-OF-FILE' > $filename
- X.PH ""
- X\"
- X\" A guide to the configuration of the Elm mail system
- X\" format with 'troff -mm Config.guide > Config.format'
- X\" or something similar.
- X\" (C) Copyright 1986 Dave Taylor
- X\"
- X\" Last modification: April 25th, 1986
- X\"
- X.SA 1
- X.nr Hy 1
- X.nr Pt 1
- X.nr Pi 8
- X.lg
- X.HM 1 1
- X.rs
- X.ds HF 3 3
- X.ds HP 12 12 10 10 10
- X.PF ""
- X.ce 99
- X.sp 13
- X.ps 20
- X\fBElm Configuration Guide\fR
- X.sp 4
- X.ps 12
- X\fIHow to install and customize the Elm mailer\fR
- X.sp 2
- XDave Taylor
- X.sp
- XHewlett-Packard Laboratories
- X1501 Page Mill Road
- XPalo Alto CA
- X94304
- X.sp
- Xemail: taylor@hplabs or hplabs!taylor
- X.sp 7
- X.ps 18
- X\fB\(co\fR\s12 Copyright 1986 by Dave Taylor
- X.ps 10
- X.SK
- X.sp 5
- X.ps 14
- X\fBElm Configuration Guide\fR
- X.PH "'Elm Configuration Guide''version 1.1'
- X.PF "''Page \\\\nP''"
- X.nr P 1
- X.sp
- X.ps 10
- X(version 1.1)
- X.sp 2
- XDave Taylor
- X.sp
- XHewlett-Packard Laboratories
- X1501 Page Mill Road
- XPalo Alto CA
- X94304
- X.sp
- Xemail: taylor@hplabs or hplabs!taylor
- X.sp 2
- X\*(DT
- X.ce 0
- X.sp 3
- X.P
- XThis document is intended as a supplement to the \fIElm Users Guide\fR
- Xand is only of interest to those people at a site either installing
- Xor maintaining the source code to the \fBElm\fR mail system.
- X.sp 2
- X.P
- XThe first thing that needs to be decided when you're ready to install
- Xthe program is what sort of operating system you're running on...
- Xcurrently the choices are;
- X.VL 14 3
- X.LI "System V"
- XThis is the default configuration, and should work on all Bell
- XSystem V Unix
- X.FS ' '
- X.br
- XUnix is a Trademark of AT&T Bell Laboratories.
- X.br
- XHP-UX and SPECTRUM are Trademarks of Hewlett-Packard Company.
- X.br
- XUTS is a Trademark of Amdahl Corporation.
- X.FE
- Xsystems, including HP-UX (and the \fISPECTRUM\fR series!) or simulations thereoXf.
- X.LI "BSD"
- XThis is for the Berkeley breed of Unix.
- X.LI "UTS"
- XThis is for the Amdahl version of Unix.
- X.LI "SUN"
- XThis is for the Sun workstations (This is a superset of the BSD
- Xdefinition as the Sun appears to have some major crises when it
- Xis asked to perform string functions and handed \fInull\fR addresses,
- Xas opposed to a \fIpointer\fR to a \fInull\fR...)
- X.LI "PYRAMID"
- XThis is for the Pyramid 90x machines (This is the same as the
- XBSD definition)
- X.LE
- X.sp
- XOnce you've decided which is appropriate, edit the Makefile file
- Xin the top level directory and alter the "DEFINE" there (about
- Xline 33 or so) accordingly. (Note: also use the associated
- X"LIB2" define that's associated with each of the systems to ensure
- Xthat the program uses the correct libraries when linking together!)
- X.sp
- XAn analogous change should be made in the Makefile in 'src' and 'utils'
- Xtoo if you're planning on actually working on the programs rather than
- Xjust installing them...
- X.sp
- XWhile you're at it, if you happen to be running \fIACSNET\fR, then
- Xyou need to add the relevent define in the main Makefile and the
- XMakefile in directory `src' too!
- X.sp 2
- XOnce that's done, all of the other installation dependent definitions
- Xare contained in the file \fIhdrs/sysdefs.h\fR and are as follows;
- X.sp
- X.nf
- X.ce
- XContents of file \fIsysdefs.h\fR
- X.ce
- X-------------------------------------------------------------------------------X------
- X
- X/** sysdefs.h **/
- X
- X/** System level, configurable, defines for the ELM mail system. **/
- X
- X/** (C) Copyright 1986 Dave Taylor **/
- X
- X/** define the following if you think that the information in messages
- X that have "Reply-To:" and/or "From:" fields with addresses will
- X contain valid addressing information. If this isn't defined, the
- X calculated return address will ALWAYS be used instead. (note that
- X this doesn't necessarily preclude the use of G)roup replies).
- X
- X#define USE_EMBEDDED_ADDRESSES
- X
- X**/
- X
- X#define FIND_DELTA 10 /* byte region where the binary search
- X on the path alias file is fruitless
- X (can't be within this boundary) *X/
- X
- X#define MAX_HEADERS 500 /* max number of messages in one file! */
- X#define MAX_SALIASES 503 /* number of system aliases allowed */
- X#define MAX_UALIASES 251 /* number of user aliases allowed */
- X#define MAX_IN_WEEDLIST 50 /* max headers to weed out */
- X
- X#define MAX_HOPS 35 /* max hops in return addr to E)veryone */
- X
- X#define MAX_ATTEMPTS 6 /* #times to attempt lock file creation */
- X
- X/** see leavembox.c to determine if this should be defined or not....The
- X default is to NOT have it defined.
- X
- X#define REMOVE_AT_LAST
- X
- X**/
- X
- X#define DEFAULT_BATCH_SUBJECT "no subject (file transmission)"
- X
- X/** If you want to have the mailer know about valid mailboxes on the
- X host machine (assumes no delivery agent aliases) then you should
- X undefine this (the default is to have it defined)...
- X
- X**/
- X
- X#define NOCHECK_VALIDNAME
- X
- X/** If your machine doesn't have virtual memory (specifically the vfork()
- X command) then you should define the following....
- X
- X#define NO_VM
- X
- X**/
- X
- X/** If you want the mailer to check the pathalias database BEFORE it
- X looks to see if a specified machine is in the L.sys database (in
- X some cases routing is preferable to direct lines) then you should
- X define the following...
- X
- X#define LOOK_CLOSE_AFTER_SEARCH
- X
- X**/
- X
- X/** If you'd rather the program automatically used the 'uuname' command
- X to figure out what machines it talks to (instead of trying to get
- X it from L.sys first) then define the following...
- X
- X#define USE_UUNAME
- X
- X**/
- X
- X/** If you'd like "newmail" to automatically go into background when you
- X start it up (instead of the "newmail &" junk with the process id output,
- X then define the following...
- X
- X#define AUTO_BACKGROUND
- X
- X**/
- X
- X/** If you'd rather your mail transport agent (ie sendmail) put the From:
- X line into the message, define the following...
- X
- X**/
- X
- X#define DONT_ADD_FROM
- X
- X/**
- X**/
- X
- X/** If your machine prefers the Internet notation of user@host for the
- X From: line and addresses, define the following...(the default is to
- X use this rather than the USENET notation - check your pathalias file!)
- X
- X**/
- X#define INTERNET_ADDRESS_FORMAT
- X
- X/**
- X**/
- X
- X/** If you're on a machine that prefers UUCP to Internet addresses, then
- X define the following (the basic change is that on a machine that
- X receives messages of the form <path>!user@<localhost> the displayed
- X address will be <path>!user instead of user@<localhost>.
- X
- X BOGUS_INTERNET is the localhost address that is appended to the
- X mail. The algorithm is simply to see if the given address has
- X at least two machines indicated, and if so to completely strip
- X off the bogus-internet address. This is horrible. *sigh*
- X**/
- X
- X#define PREFER_UUCP
- X#define BOGUS_INTERNET "@hplabs.HP.COM"
- X
- X/**
- X**/
- X
- X/** If you're running ACSNET and/or want to have your domain name
- X attached to your hostname on outbound mail then you can define
- X the following (default are not defined)
- X
- X#define USE_DOMAIN
- X#define DOMAIN "<enter your domain here>"
- X
- X**/
- X
- X/** If you are going to be running the mailer with setgid mail (or
- X something similar) you'll need to define the following to ensure
- X that the users mailbox in the spool directory has the correct
- X group (NOT the users group)
- X**/
- X
- X#define SAVE_GROUP_MAILBOX_ID
- X
- X/**
- X**/
- X
- X/** If you want a neat feature that enables scanning of the message
- X body for entries to add to the users ".calendar" (or whatever)
- X file, define this.
- X**/
- X
- X#define ENABLE_CALENDAR
- X#define dflt_calendar_file "calendar" /* in HOME directory */
- X
- X/**
- X**/
- X.fi
- X.TS
- Xl l l.
- X#define NOTES_HEADER "/***** "
- X#define NOTES_FOOTER "/* ---------- */"
- X.TE
- X.nf
- X
- X.fi
- X.TS
- Xl l l.
- X#ifdef BSD
- X# define system_hash_file "/usr/spool/mail/.alias_hash"
- X# define system_data_file "/usr/spool/mail/.alias_data"
- X#else
- X# define system_hash_file "/usr/mail/.alias_hash"
- X# define system_data_file "/usr/mail/.alias_data"
- X#endif
- X.TE
- X.sp
- X.TS
- Xl l l.
- X#define pathfile "/usr/lib/nmail.paths"
- X#define domains "/usr/lib/domains"
- X
- X#define Lsys "/usr/lib/uucp/L.sys"
- X.TE
- X.nf
- X
- X/** where to put the output of the elm -d command... (in home dir) **/
- X.fi
- X.TS
- Xl l l.
- X#define DEBUG "ELM:debug.info"
- X
- X#define temp_file "/tmp/snd."
- X#define temp_mbox "/tmp/mbox."
- X#define temp_print "/tmp/print."
- X#define mailtime_file ".last_read_mail"
- X#define readmsg_file ".readmsg"
- X#define signature_file ".signature"
- X.TE
- X.nf
- X
- X.fi
- X.TS
- Xl l l.
- X#ifdef BSD
- X# define default_editor "/usr/ucb/vi"
- X# define mailhome "/usr/spool/mail/"
- X# define default_pager "/usr/ucb/page"
- X#else
- X# define default_editor "/usr/bin/vi"
- X# define mailhome "/usr/mail/"
- X# define default_pager "/usr/bin/more"
- X#endif
- X.TE
- X.sp
- X.TS
- Xl l l.
- X#define sendmail "/usr/lib/sendmail"
- X#define smflags "-oi"
- X#define mailer "/bin/rmail"
- X#define mailx "/usr/bin/mailx"
- X
- X#define cutfile "/usr/local/bin/cutfile"
- X
- X#define helphome "/usr/local/lib"
- X#define helpfile "elm-help.main"
- X
- X#define elmrcfile "/.elmrc"
- X#define mailheaders ".elmheaders"
- X#define unedited_mail "emergency.mbox"
- X#define newalias "newalias -q 1>&2 > /dev/null"
- X#define readmsg "readmsg"
- X#define printmail "printmail"
- X
- X#define remove "/bin/rm -f" /* how to remove a file */
- X#define cat "/bin/cat" /* how to display files */
- X#define uuname "uuname" /* how to get a uuname */
- X.TE
- X.ce
- X-------------------------------------------------------------------------------X------
- X.sp
- X.VL 15 0
- X.LI "USE_EMBEDDED_ADDRESSES"
- XThis controls the mailers response to messages that contain
- X"Reply-To:" or "From:" lines that actually contain a return
- Xaddress. If it's defined, the mailer will attempt to use
- Xthe address specified (overriding the return address built from the path that
- Xthe mail took). It will look the address up in the pathalias
- Xdatabase (see the documentation on the alias system) for
- Xincomplete paths, but it is still recommended that this be left
- Xundefined.
- X.P
- XThis will, of course, make the mailer not be a standard 'RFC-822'
- Xmailer, since the mail system is defined to use the reply-to
- Xif included rather than the return address, but, at least for
- Xaddresses on the Internet, it ain't going to work a lot of the time!
- X.LI "FIND_DELTA"
- XThis is the delta that the binary search of the pathalias database
- Xwill use to determine when it's slicing up a single line, rather than
- Xa multitude of lines. Ideally, this should be set to 1 byte less
- Xthan the shortest line in the file...the default is 10 bytes.
- X.LI MAX_HEADERS
- XThe maximum number of messages allowed in a single mailbox.
- X.LI MAX_SALIASES
- XThe number of system aliases allowed. (It is recommended that
- Xthis be a prime number to improve the performance of the
- Xhashing function (it's a complicated proof!))
- X.LI MAX_UALIASES
- XThe number of user aliases allowed. (should be a prime number -
- Xsee the comment above)
- X.LI MAX_IN_WEEDLIST
- XThe maximum number of headers that can be specified in the weedout
- Xlist of the .elmrc file. A suggested alternative approach if this
- Xnumber is too small is to specify initial substrings in the file
- Xrather than increasing the number. For example, say you want to
- Xweedout the headers "Latitude:" and "Latitudinal-Coords:", you
- Xcould simply specify "Latitud" and match them both! Furthermore
- Xyou could also specify headers like "X-" and remove all the user
- Xdefined headers!
- X.LI MAX_HOPS
- XWhen replying to a G)roup, this is the maximum number of hops that
- Xa message can have taken. This is used to try to optimize the
- Xreturn address (remove cyclic loops and so on) and regular use
- Xshould show that the default of 35 is plenty more than you'll
- Xever need!
- X.LI MAX_ATTEMPTS
- XWhen reading in the default mailbox (\fI/usr/mail/$username\fR) the mailer
- Xcreates a file called \fI/usr/mail/$username.lock\fR to ensure that no
- Xmail is added to the file while it's being either read, or replaced
- X(ie written to). Occasionally, this lock file will already be in
- Xplace since someone is currently sending you mail. If this occurs,
- Xthe mailer will wait a few seconds and try to create the lock file
- Xagain. This parameter defines the number of tries the mailer should
- Xtake before giving up.
- X.LI REMOVE_AT_LAST
- XWhen it does decide to give up after trying to create the lock file,
- X(see MAX_ATTEMPTS, above) this will define how to act. If it's
- Xdefined, the mailer will attempt to remove the lock file after the
- XMAX_ATTEMPTS timeout. On the other hand, if it's not defined (the
- Xrecommended state) it'll simply quit the mailer, telling the user
- Xto try again in a few minutes.
- X.LI DEFAULT_BATCH_SUBJECT
- XWhat the subject should be on messages that are from redirected input
- Xbut don't have a subject specified...
- X.LI NOCHECK_VALIDNAME
- XThis disables the checking of validnames on the existing machine.
- XOn machines that run a system such as \fIsendmail\fR and use the
- Xsendmail alias feature, this should be defined. On other systems
- Xthis should be left as the default (not defined) to avoid users
- Xgenerating \fIdead.letter\fR files...
- X.LI NO_VM
- XThis disables the calls to "vfork()" and replaces them will calls
- Xto "fork()". On machines where vfork() is available, this should
- Xbe left undefined, as the virtual call is considerably faster (and
- Xis only used when the spawned process doesn't need ALL the stuff
- Xfrom the calling process!)
- X.LI LOOK_CLOSE_AFTER_SEARCH
- XSome systems are set up in such a way as to have direct connections
- Xto machines, but to have multi-machine hops be preferable for
- Xrouting messages to/through that machine (an example is a connection
- Xto "nbires" for the monthly mod.map information, but only connected
- Xto once a month!). If this option is defined, then the system will
- Xtry to find a suitable path to the machine \fIbefore\fR it checks
- Xagainst the \fIL.sys/uuname\fR list of systems that it can connect to.
- X.LI USE_UUNAME
- XThe mailer tries to get the list of machines that's its connected
- Xto by looking in the \fIL.sys\fR file. If it fails usually, it will
- Xthen try to do a \fIuuname\fR command and then read the output of
- Xthat command. If this is defined, however, it will skip the \fIL.sys\fR
- Xreading and immediately try the \fIuuname\fR call.
- X.LI AUTO_BACKGROUND
- XIf this is defined then the \fInewmail\fR program automatically puts
- Xitself into background as soon as it's invoked. Otherwise, the
- Xuser needs to have a trailing ampersand (as in \fBnewmail &\fR) to
- Xget the same functionality. (it seems reasonable to assume that
- Xno-one would ever run the utility as a \fIforeground\fR process!!!)
- X.LI DONT_ADD_FROM
- XSome mail systems (like my own) add From: lines that are
- Xactually different than the "default". That is, the machine
- XI send mail from is "hpldat" so my From: line would normally
- Xbe "hpldat!taylor" but it should actually be "taylor@hplabs".
- XMy sendmail will add this correctly, so this allows \fBElm\fR
- Xto defer the addition until then. This should only be used
- Xif your system is running sendmail in such a way that it will
- Xadd this header as needed ONLY!
- X.LI INTERNET_ADDRESS_FORMAT
- XFor systems that prefer the Internet addressing notation in the
- XFrom: line, defining this will force that. The default is
- Xto use Usenet notation (\fIhostname!username\fR) - this will change
- Xit to Internet notation (\fIusername@hostname\fR).
- X.LI PREFER_UUCP
- XOn some mail systems, the local host automatically appends their
- Xidentification \fIin Internet format\fR to the addresses you
- Xreceive (e.g. ``ihnp4!snsvax!joe@hplabs.HP.COM'' is an address
- Xform I see, being directly connection to HPLABS, all too often).
- XThis will simple ensure that when displaying the return address
- Xof the message it will ignore the Internet part if there's also
- Xa UUCP part. (This is a kludge. One should never have to
- Xdeal with this in a mail system... *sigh*)
- X.LI BOGUS_INTERNET
- XAfter some serious thought, I came to the conclusion that the
- Xeasiest way to deal with the dumb configuration here is to
- Xsimply strip off the local address part entirely whenever
- Xpossible. Hence, this field defines the local address that
- Xis added to the message addresses needlessly. This is probably
- Xthe single worst solution imaginable, but it works...
- X.LI USE_DOMAIN
- XDefine if you want to have the \fIDOMAIN\fR field added to the
- X\fIhostname\fR in the From: field on outbound mail (note that this
- Xonly makes sense on Internet mail...)
- X.LI DOMAIN
- XIf you choose to have the USE_DOMAIN define set, you
- X\fIMUST DEFINE THIS ACCORDINGLY!!!\fR
- XA typical entry would be;
- X.DS
- X#define DOMAINS ".HP.COM"
- X.DE
- X.LI SAVE_GROUP_MAILBOX_ID
- XIf you're running the mailer set group id (usually "setgid mail") then
- Xthis'll ensure that the users mailbox, when altered, will always retain
- Xits group id (obtained by the "getegid()" call, for those gurus out
- Xthere who care).
- X.LI ENABLE_CALENDAR"
- XIf you want to have users able to scan their mail for calendar entries
- X(see the \fIElm Reference Guide\fR) then define this and the following
- Xtoo. (There is no reason not to have this, but power corrupts, right?)
- X.LI "dflt_calendar_file"
- XThe name of the default "calendar" file if the user doesn't specify
- Xone in their \fI.elmrc\fR file.
- X.LI NOTES_HEADER
- XThis defines the first "word" of the line that a \fInotes\fR file entry
- Xwould contain.
- X.LI NOTES_FOOTER
- XThis defines the footer line (in it's entirety).
- X.LI system_hash_file
- XThis is the file that contains the hashed version of the system
- Xaliases. It is also used in the \fInewalias\fR command. (note that
- Xit is defined differently if you're running on a Berkeley system)
- X.LI system_data_file
- XThis is the other file the \fInewalias\fR command installs in the system
- Xalias area. (Note this is defined differently if you're runnnig
- Xa bsd system)
- X.LI pathfile
- XThis defines the location of the pathalias datafile. This file is in
- Xthe format that \fIpathalias\fR generates, that is;
- X.nf
- X
- X machine <tab> address
- X
- X.fi
- XFor further information, please see the \fIElm Alias System\fR documentation.
- X.LI domains
- XThis defines the location of the the domains database file. The format
- Xfor this file and so on are fully discussed in the \fIElm Alias System\fR
- Xdocument.
- X.LI Lsys
- XThis defines where the system \fIL.sys\fR file is kept. This is used for the
- Xmailer to quickly know what machines the current machine can talk to
- Xdirectly (to avoid trying to search the pathalias database to route mail
- Xto these machines).
- X.LI DEBUG
- XThe name of the file to put in the users home directory if they choose to
- Xuse the `-d' debug option.
- X.LI temp_file
- XTemporary file for sending outbound messages.
- X.LI temp_mbox
- XPlace to keep copy of incoming mailbox to avoid collisions with newer
- Xmail.
- X.LI temp_print
- XFile to use when creating a printout of a message.
- X.LI mailtime_file
- XFile to compare date to to determine if a given message is New
- Xsince the last time the mail was read or not.
- X.LI readmsg_file
- XFile to use when communicating with the \fIreadmsg\fR program (see
- Xthat program for more information)
- X.LI signature_file
- XThe name of the file to search for in the users home directory
- Xif they have \fIsignature\fR enabled in their \fI.elmrc\fR file.
- X.LI default_editor
- XIf no editor is specified in the users .elmrc file, this is which
- Xeditor to use. \s12 Ensure it is a valid editor on this machine!!\s10
- X(Note that the default home for \fIvi\fR is different on BSD machines)
- X.LI mailhome
- XWhere all the incoming mailboxes are, and also where the 'lock'
- Xfiles have to be put for the mailer to know not to add new
- Xmail while we're reading/writing the mailfile.
- X(note that mail is kept in a different directory on Berkeley
- Xsystems)
- X.LI default_pager
- XThis is the standard pager to use for reading messages.
- X.LI sendmail
- XDefines where \fIsendmail\fR is (if you have it on your system).
- X.LI smflags
- XDefines the flags to hand to \fIsendmail\fR if and when the program
- Xchooses to use it.
- X.LI mailer
- XIf you don't have \fIsendmail\fR, this is the mailer that'll be used.
- X.LI mailx
- XIf all else fails, this mailer can be used in a rather dumb way.
- X.LI helphome
- XWhere the help file is kept (soon to be help files!)
- X.LI helpfile
- XThe name of the main helpfile (kept in \fIhelphome\fR).
- X.LI elmrcfile
- XThe name of the automatic control file (currently \fI.elmrc\fR)
- X.LI mailheaders
- XThe name of the optional file that users may have that will be
- Xincluded in the headers of each outbound message.
- X.LI unedited_mail
- XIn the strange case when the mailer suddenly finds all the directories
- Xit uses shut off (like \fI/usr/mail\fR and \fI/tmp\fR)
- Xthen it'll put the current
- Xmailbox into this file in the users home directory.
- X.LI newalias
- XHow to install new aliases..(note: you MUST have the '-q' flag!)
- X.LI remove
- XHow to remove a file.
- X.LI cat
- XHow to display a file to stdout.
- X.LI uuname
- XHow to get a \fIuuname\fR listing (ie a listing of the machines that this
- Xmachine connects to)
- X.LE
- END-OF-FILE
-
- if [ "$filename" != "/dev/null" ]
- then
- size=`wc -c < $filename`
-
- if [ $size != 20499 ]
- then
- echo $filename changed - should be 20499 bytes, not $size bytes
- fi
-
- chmod 644 $filename
- fi
-
- # ---------- file doc/helpfile ----------
-
- filename="doc/helpfile"
-
- if [ -f $filename ]
- then
- echo File \"$filename\" already exists\! Skipping...
- filename=/dev/null # throw it away
- else
- echo extracting file doc/helpfile...
- fi
-
- cat << 'END-OF-FILE' > $filename
-
- Command Action
-
- | Pipe current message to ...
- ! Shell escape
- ? This screen of information
- +, <SPACE> Next page of headers
- - Previous page of headers
- = Set current message to 1
- * Set current message to last message
- <n> Set current message to n
- / Search from/subjects for pattern
- // Search entire message bodies for pattern
- > Save current message or tagged to file
- < Scan current message for calendar entries
-
- a Alias, change to 'alias' mode
- b Bounce (remail) current message
- c Change current mail file
- d Delete current message
- e Edit the current mailbox
- f Forward message to specified user
- g Group (all recipients) reply to message
- h Headers displayed with message
- j Increment current message by one
- k Decrement current message by one
- m Mail to arbitrary user(s)
- n Next message (Read current, then increment)
- o Change Elm options
- p print current message
- q Quit - mail deleted, saved in mbox or left.
- r Reply to current message
- s Save message to specified file
- t Tag a message for further operations
- u Undelete current message
- x Exit - don't record as read, don't save...
-
- ^L Rewrite screen.
- <RETURN> Read current message
- ^Q, DEL Exit - don't record as read, don't save...
- END-OF-FILE
-
- if [ "$filename" != "/dev/null" ]
- then
- size=`wc -c < $filename`
-
- if [ $size != 1674 ]
- then
- echo $filename changed - should be 1674 bytes, not $size bytes
- fi
-
- chmod 644 $filename
- fi
-
- # ---------- file doc/Alias.guide ----------
-
- filename="doc/Alias.guide"
-
- if [ -f $filename ]
- then
- echo File \"$filename\" already exists\! Skipping...
- filename=/dev/null # throw it away
- else
- echo extracting file doc/Alias.guide...
- fi
-
- cat << 'END-OF-FILE' > $filename
- .PH ""
- \"
- \" A guide to the ELM alias system and so on.
- \" format with 'nroff -mm Config.guide > Config.format'
- \" or something similar.
- \" (C) Copyright 1986 Dave Taylor
- \"
- \" Last modification: March 13th, 1986
- \"
- .SA 1
- .nr Hy 1
- .nr Pt 1
- .nr Pi 8
- .lg
- .HM 1 1
- .rs
- .ds HF 3 3
- .ds HP 12 12 10 10 10
- .PF ""
- .ce 99
- .sp 5
- .ps 20
- \fBELM Alias Users Guide\fR
- .sp 4
- .ps 12
- \fIWhat aliases are and how to use them
- in the \fBElm\fP mail system\fR
- .sp 2
- Dave Taylor
- .sp
- Hewlett-Packard Laboratories
- 1501 Page Mill Road
- Palo Alto CA
- 94304
- .sp
- email: taylor@hplabs or hplabs!taylor
- .sp 7
- .ps 18
- \fB\(co\fR\s12 Copyright 1986 by Dave Taylor
- .ps 10
- .SK
- .sp 5
- .ps 14
- \fBElm Alias Users Guide\fR
- .PH "'Alias Users Guide''version 1.1'
- .PF "''Page \\\\nP''"
- .nr P 1
- .sp
- .ps 10
- (version 1.1)
- .sp 2
- Dave Taylor
- .sp
- Hewlett-Packard Laboratories
- 1501 Page Mill Road
- Palo Alto CA
- 94304
- .sp
- email: taylor@hplabs or hplabs!taylor
- .sp 2
- \*(DT
- .ce 0
- .sp 3
- .P
- This document is intended as a supplement to the \fIElm Users Guide\fR
- 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 \fIthat\fR exciting!)
- .sp
- .P
- This document is broken up into the following sections;
- user aliases,
- group aliases,
- system aliases,
- editing and installing new aliases,
- the machine routing database,
- the domain routing database,
- and general warnings and other chitchat.
- .sp
- .H 1 "User Aliases"
- The most simple sort of aliases in the \fBElm\fR system are individual
- user aliases. These are made up of three parts;
- .nf
-
- \fIaliasname list\fR : \fIusername\fR : \fIaddress\fR
-
- .fi
- Where the \fIaliasname list\fR is either a single aliasname*
- .FS *
- Please see the appendix for a full definition of what exactly an
- aliasname consists of.
- .FE
- or a list of aliasnames separated by commas.
- .P
- \fIUsername\fR 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 \fIusername\fR 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 supplement to the usual list of aliasnames.
- .P
- \fIAddress\fR is either the users full electronic mail address or, if
- the machine routing database is installed, 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).
- .sp
- .P 0
- Let's get on to some examples, shall we?
- .sp
- Consider this excerpt from my own \fI.alias_text\fR file;
- .nf
-
- 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
-
- .fi
- Note that the alias for Walt Underwood has two \fIaliasnames\fR associated
- with it, \fIwunder\fR and \fIwaltf\R. Also notice that the first four aliases
- use the Internet style naming convention (\fIuser@machine\fR) but the last two
- use the UUCP style convention (\fImachine!user\fR). In this context it is
- independent.
- .P
- The only time when it \fIdoes\fR 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 \fBtwinkie\fR and our best connection is through Georgia
- Tech...Then our alias for them could be;
- .nf
-
- buddy : Our friend : gatech!twinkie!buddy
-
- or
-
- buddy2 : Our friend : gatech!buddy@twinkie
-
- .fi
- but not;
- .nf
-
- buddy : Our friend : buddy@twinkie@gatech
-
- .fi
- (however, buddy%twinkie@gatech \fIwill\fR 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!)
- .P
- 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 \fBElm\fR system expands the correct machine name.
- .sp
- .H 1 "Group Aliases"
- After the confusion of user aliases, group aliases are even more
- fun! For the most part the notation is very similar;
- .nf
-
- \fIaliasname list\fR : \fIgroupname\fR : \fIlist of people\fR
-
- .fi
- Where \fIaliasname list\fR and \fIgroupname\fR are exactly equivalent
- to the corresponding fields in user aliases.
- .P
- The interesting part is the \fIlist of people\fR 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;
- .nf
-
- friends, mypals, gang : The Gang of Six : joe, larry, mary, joanna,
- nancy, michael
-
- .fi
- (Notice that you can continue onto as many lines as you'd like so
- long as each additional line start with either a \s8SPACE\s10 or a \s8TAB\s10
- character)
- .P
- The significant limitation with group aliases is that each of the
- people in the list must be a \fIpreviously defined aliasname in either the
- existing alias file or the system alias file\fR or a valid destination
- on the current machine.
- .P
- What does this mean? This means that the following excerpt from an
- alias file;
- .nf
-
- hawaii : The Hawaiian Twins : joe@\s8RIT-CS.ARPA\s10, maoa
- maoa : Maoa Lichtenski Jr : maoa@Hawaii.cs.uh.\s8ARPA\s10
-
- .fi
- will fail for two reasons - not only does the group \fIlist of people\fR
- contain a complex address, but it also contains an aliasname that is
- defined \fIlater\fR in the \fI.alias_text\fR file! \fB** \s8BEWARE\s10!!! **\fR
- .P
- The correct way to have the previous alias in the file is to have it like;
- .nf
-
- joe : Joe Lichtenski : joe@\s8RIT-CS\s10
- maoa : Maoa Lichtenski Jr : maoa@Hawaii
- hawaii : The Hawaiian Twins : joe, maoa
-
- .fi
- which will then work correctly.
- .P 0
- This isn't too hard now, is it?
- .sp
- Fortunately, while this seems pretty tough, if you run the \fInewalias\fR
- command to install your new aliases, it will give you nice meaningful
- error messages that will help you fix the list up correctly!
- .sp
- .H 1 "System Aliases"
- System aliases are functionally equivalent to the individual \fBElm\fR
- alias lists each \fBElm\fR user has (both user aliases and group aliases)
- but are "read only" for everyone but the \fBElm\fR 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 \fIsystem_hash_file\fR and \fIsystem_data_file\fR files (see the
- \fIElm Configuration Guide\fR for more details on these variables).
- .P
- Simply create a \fI.alias_text\fR file in the specific directory
- as you would a normal file, and install it the same way (see the
- following section for more details on that).
- .P
- Voila!!
- .sp
- .H 1 "Editing and Installing New Aliases"
- To install new aliases, you need merely to create, or modify,
- your \fI.alias_text\fR 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 command;
- .nf
-
- $ \fBnewalias\fR
-
- .fi
- 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.
- .P
- Note that blank lines are no problem and that comments are not only
- allowed but actually encouraged, and must have `\fB#\fR' as the first
- character of each comment line.
- .sp
- Finally, if you find that you're hitting the ``Too many aliases'' error,
- then you'll need to reconfigure the entire \fBElm\fR system (again,
- see the \fIElm Configuration Guide\fR especially the discussion on
- \fIMAX_UALIASES\fR and \fIMAX_SALIASES\fR therein).
- .sp
- .H 1 "The Hostname Routing Database"
- Floating about on the various networks is a rather nifty program by
- a number of people, including Peter Honeyman and Steve Bellovin,
- called \fIpathalias\fR. What this incredibly handy program does is
- take the strange postings in netnews groups like "mod.map" and massage
- them into a file of the form;
- .nf
-
- \fIhostname\fR \fIaddress\fR
-
- .fi
- which is then sorted alphabetically and stored in the file
- pointed to by \fIpathfile\fR (guess where to look for more information!)
- for \fBElm\fR to use.
- .P
- 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;
- .nf
-
- \fIhostname\fR<tab>\fImachine-address\fR
-
- .fi
- where \fIhostname\fR is a limited identifier (no special characters) 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.
- .P 0
- By way of example, here are a few entries from my own file;
- .nf
-
- \s8HPL\s10 hplabs!%s
- \s8PARC\s10 hplabs!%s@Xerox.\s8PA.COM\s10
- amc-hq hplabs!%s@\s8AMC-HQ.ARPA\s10
- imsss hplabs!%s%%\s8IMSSS@SU-AI.ARPA\s10
- infopro hpfcla!ihnp4!astrovax!infopro!%s
- interleaf hpfcdc!hpda!sun!interleaf!%s
- jpl-vax hplabs!%s@jpl-vax
-
- .fi
- 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!!
- .sp
- If you'd like further information on the pathalias program, try
- keeping track of the entries in the netnews group \fImod.sources\fR -
- it's posted about once a year or so...
- .sp
- .H 1 "The Domain Routing Database"
- One of the more interesting features of the 3.2 and above
- \fBElm\fR mailer is the domain routing database. This is
- the same database (in the same strange format) as used by
- the most recent version of the \fIuumail\fR program.
- .P
- In a nutshell, the file contains information of the form;
- .nf
-
- \fIdomain\fR \fIpathtogateway\fR \fIrewrite-template\fR
-
- .fi
- The \fIdomain\fR field must begin with a leading `.' and
- should be ordered in the same notation as the standard
- domain information (that is, "\s8.HP.COM\s10" not "\s8.COM.HP\s10").
- .P
- \fIPathtogateway\fR is routing information on how to get
- to the particular gateway that this domain expects, and
- always is a machine/host name (to be found in the pathalias
- database, see the previous section) preceeded by a `>'
- character.
- .P
- \fIRewrite-template\fR is the most interesting of the
- three, and is akin to a printf string for C. The
- changes are that instead of `%s' `%d' and so on, the
- actual "percent" values represent various parts of
- the address, namely;
- .nf
-
- Symbol Represents
- ------ ----------
- %U The username in the To: address
- %N The remote machine name
- %D %N + domain information
- %R path to %N from pathalias
- %P \fIpathtogateway\fR entry
- %S Obsolete!
- %% The `%' character
-
- .fi
- with this very intuitive setup, let's look at a few entries
- from the domains database and see how they work;
- .nf
-
- .ps 8
- .EUR.UUCP,,,%R!%U
- .ATT.UUCP,>\s10ihnp4\s8,,%P!%D!%U
- .HP.COM,,,%R!%U
- .UUCP,,,%R!%U
- .COM,>\s10hplabs\s8,,%P!%U@%D
- .CSNET,>\s10hplabs\s8,,%P!%U%%%D@CSNET-RELAY.ARPA
- .ARPA,>\s10hplabs\s8,,%P!%U@%D
- .ps 10
-
- .fi
- (Note the presence of a third field that is always null. This is
- for compatability with the "uumail" program, but this field is
- now always \fI\s8NULL\s10\fR)
- .P
- To see how it all works, let's suppose that we want to send a message
- to "jad@Purdue.\s8ARPA\s10". This would break down into the following fields:
- .nf
-
- %U = jad
- %N = Purdue
- %D = Purdue.\s8ARPA\s10
-
- .fi
- When the \fBelm\fR program matches the ".\s8ARPA\s10" entry
- .nf
-
- .\s8ARPA\s10,>hplabs,,%P!%U@%D
-
- .fi
- the other fields instantiated would be:
- .nf
-
- %P = <path to hplabs>
- template = %P!%U@%D
-
- .fi
- As is hopefully obvious, if our path to hplabs was "hpcnoe!hplabs" then
- the fully expanded address would be;
- .nf
-
- hpcnoe!hplabs!jad@Purdue.\s8ARPA\s10
-
- .fi
- And so on.
- .sp
- .P
- What does this mean to the average user? It means that you can
- for the most part send mail to people on different gateways by
- simply usnig their full domain information, so that mail to
- addresses like "Jack@\s8MIT.MIT.EDU\s10" will work, and mail
- to "SueAnn@\s8BBN.MAILNET\s10"
- will work and so on!!
- .sp
- .H 1 "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 \fImailx\fR
- aliases and the snazzo \fIsendmail\fR alias system??" Well,
- rest assured, \fIsendmail\fR fans, that if you \fIreally\fR 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 \fBElm\fR
- by defining the \fINOCHECK_VALIDNAME\fR definition (I'm not even going to
- bother to tell you where to look for this one!!).
- .P
- For those \fImailx\fR fanatics out there, you can translate your
- aliases into the format that \fBElm\fR wants by running them
- through the \fIawk\fR script listed in Appendix Two.
- .sp
- .P
- Finally, if you have any problems or questions, try looking in
- the \fInewalias\fR manual entry, or dropping me a line at the
- "usual" email address (ask your administrator!).
- .SK
- .ce 99
- Appendix One
-
- A BNF of the Alias File Grammar
- .ce 0
- .sp 2
- In this listing, items in <> brackets are non-terminals, items in {}
- are optional, and items in \fBbold face\fR are terminals.
- .sp 2
- .nf
-
- <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> \fB:\fR { <comment> \fB:\fR }
- {<whitespace>} <address>
-
- <group alias> ::= <aliaslist> \fB:\fR { <comment> \fB:\fR }
- {<whitespace>} <list of addresses>
-
- <aliaslist> ::= <aliasname> { \fB,\fR <aliaslist> }
-
- <aliasname> ::= <alpha-char> { <sequence-of-chars> }
-
- <comment> ::= .. anything other than ":" ..
-
- <address> ::= <username> | <arpa-address> | <uucp-address> |
- <complex-address>
-
- <list-of-addresses> ::= <aliasname> { \fB,\fR <whitespace> }
- { <list-of-addresses> }
-
- <username> ::= .. any valid mailbox name on the system ..
-
- <arpa-address> ::= <username> ( \fB@\fR <hostname> | <postfix> )
-
- <hostname> ::= .. any legal host machine name ..
-
- <uucp-address> ::= <hostname> \fB!\fR <username>
-
- <complex-address> ::= <prefix> ( <uucp-address> | <arpa-address> )
-
- <prefix> ::= <hostname> \fB!\fR { <prefix> }
-
- <postfix> ::= \fB%\fR <hostname> { <postfix> } \fB@\fR
- <hostname>
-
- <sequence-of-chars> ::= .. any characters other than space, tab,
- return, or colon ..
-
- <whitespace> ::= .. space, tab or newline followed by space or tab ..
-
- .fi
- .SK
- .ce 99
- Appendix Two
-
- An AWK Script for
- Translating Aliases from a
- ".mailrc" Format to a
- Elm Format
- .ce 0
- .sp 2
- .nf
- .ce
- -------------------------------------------------------------------
-
- BEGIN {
- print "# ELM 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)
- group = sprintf("%s%s%s", group, sep, $i);
- else
- group = $i;
- }
- print $2 " : group alias : " group;
- }
- }
-
- .ce
- -------------------------------------------------------------------
- .fi
- .P
- Note: this script is contained in the release under the name
- "mailrc.awk" in the utilities directory "utils".
- END-OF-FILE
-
- if [ "$filename" != "/dev/null" ]
- then
- size=`wc -c < $filename`
-
- if [ $size != 16407 ]
- then
- echo $filename changed - should be 16407 bytes, not $size bytes
- fi
-
- chmod 644 $filename
- fi
-
- # ---------- file doc/wnewmail.1 ----------
-
- filename="doc/wnewmail.1"
-
- if [ -f $filename ]
- then
- echo File \"$filename\" already exists\! Skipping...
- filename=/dev/null # throw it away
- else
- echo extracting file doc/wnewmail.1...
- fi
-
- cat << 'END-OF-FILE' > $filename
- .TH WNEWMAIL 1L
- .ad b
- .SH NAME
- wnewmail - daemon to asynchronously notify of new mail
- .SH SYNOPSIS
- .B wnewmail
- .br
- .B wnewmail
- filename
- .PP
- .SH HP-UX COMPATIBILITY
- .TP 10
- Level:
- HP-UX/STANDARD
- .TP
- Origin:
- Hewlett-Packard
- .SH DESCRIPTION
- .I Wnewmail\^
- is a daemon designed to run in \fBa window\fR on a windowing
- system (such as an HP or Sun system) and check every 10 seconds
- to see if there is any new mail for the user that
- started it up.
- .P
- If there is new mail, the program will "beep", and write to
- the window for each of the new messages;
- .nf
-
- Mail from <name> -- <subject>
-
- .fi
- where <name> is either the name of the person sending it,
- if available (the ARPA 'From:' line) or machine!login where
- machine is the machine the mail was sent from. If there
- is no subject, the message "<no subject>" will appear on
- the screen.
- .P
- This program will run forever, and can internally reset
- itself if mail is deleted from the incoming mailbox while
- trying to monitor it.
- .P
- If \fBwnewmail\fR is started up with a filename, it will
- perform exactly the same, but with the specified file as
- the one to check rather than the default users mailbox.
- .SH AUTHOR
- Dave Taylor, Hewlett-Packard Laboratories.
- .SH SEE ALSO
- notify in sh(1) or csh(1), newmail(1L)
- .SH NOTE
- This is almost identical to the program \fBnewmail\fR...
- END-OF-FILE
-
- if [ "$filename" != "/dev/null" ]
- then
- size=`wc -c < $filename`
-
- if [ $size != 1318 ]
- then
- echo $filename changed - should be 1318 bytes, not $size bytes
- fi
-
- chmod 644 $filename
- fi
-
- echo end of this archive file....
- exit 0
-
-