[*] Hypermail 1.02



What is Hypermail?

Hypermail is a program that takes a file of mail messages in UNIX mailbox format and generates a set of cross-referenced HTML documents. Each file that is created represents a separate message in the mail archive and contains links to other article s, so that the entire archive can be browsed in a number of ways by following links. Archives generated by Hypermail can be incrementally updated, and Hypermail is set by default to only update archives when changes are detected.

Each HTML file that is generated for a message contains (where applicable):

In addition, Hypermail will convert references in each message to email addresses and URLs to hyperlinks so they can be selected. Email addresses can be converted to mailto: URLs or links to a CGI mail program. Note that not all World-Wide We b browsers support the mailto: URL yet.

To complement each set of HTML messages, four index files are created which sort the articles by date received, thread, subject, and author. Each entry in these index files are links to the individual articles and provide a bird's-eye view of every archiv ed message.

Hypermail was originally developed and designed by Tom Gruber for Enterprise Integration Technologies (EIT) in Common Lisp. It was later rewritten in C by Kevin Hughes at EIT.


Usage

  usage: /usr/local/etc/httpd/wwwlib/hypermail -upix [-m "mbox"] [-l "label"] [-d "dir"]
         [-a "URL"] [-b "URL"] [-c "file"]
options: -m : Mail archive to read in
         -l : What to name the output archive
         -d : The directory to save HTML files in
         -a : URL to other archives
         -b : URL to archive information
         -c : Configuration file to read in
         -x : Overwrite previous messages
         -i : Read messages from standard input
         -u : Update archive by one article
         -p : Show progress

Using the flags -z, -h, or -? with Hypermail will display this usage summary.


Command-Line Options

Input and Output Options:
-i, -m "mailbox", -d "directory", -c "file"

To tell Hypermail what mailbox to read in, use the -m option. If articles will be sent to Hypermail through standard input, use the -i option. Note that the -m and -i options can't be used together! By default, Hypermail will l ook for a file called mbox to read its articles in from.

The -d option specifies the directory to put the HTML files and index files that are created into. If the directory doesn't exist, a new one will be created with the name that is specified. If the -d option isn't used, Hypermail will look fo r a directory with the same name as the mailbox or will create one if needed.

   example 1: hypermail -m "www-talk" -d "/archives/www-talk"
   example 2: cat "/var/spool/mail/foo" | hypermail -i

  1. This example reads the articles in www-talk and will save the output in the /archives/www-talk directory.

  2. This reads the file /var/spool/mail/foo from standard input and will save the output in a directory called archive in the same directory Hypermail was run from.

Note that Hypermail can only read messages in the UNIX mailbox format! Such archives are typically RFC 822 mail messages appended to each other that look similar to this:

   From john@foo.com  Mon Jan  1 00:01:30 1994
   Date: Mon, 1 Jan 1994 00:01:15 PDT
   From: john@foo.com
   To: everyone@foo.com
   Subject: Hello, world!

   Hi, everyone, just saying hello!

   From someone.else@foo.com  Mon Jan  1 00:02:00 1994
   Date: Mon, 1 Jan 1994 00:01:45 PDT
   ...

The messages are typically separated by lines in this format:

   From www-talk@www0.cern.ch  Fri Jul  1 00:18:20 1994

The -c option tells Hypermail to read in settings from a configuration file. By default, the program will attempt to read settings from a file called .hmrc in the user's home directory if it exists.

In the configuration file, variables are set in the following manner:

   set hm_variable = number
   set hm_variable = "string"
The complete set of variables that Hypermail recognizes is described in the Configuration Options section.

Archive Interface Options:
-l, "label", -a "URL", -b "URL"

The -l option tells Hypermail what to call the archive - the name that is specified will be in the title of the index pages so users know what sort of messages are being archived.

The -a option includes a link labelled "Other mail archives" in the index pages to any specified URL. This way users who are looking at the archive have the opportunity to go to pointers to other mail archives. By default, this will be a pointer to the parent directory in which the archive files reside.

The -b option includes a link labelled "About this archive" in the index pages to any specified URL. This way users who are looking at the archive have the opportunity to go to information about the archive.

   example: hypermail -l "WWW-Talk Archives"
            -a "http://foo.com/archives/"
            -b "http://foo.com/archives/info.html"

In the index files for the archive, the above setting will produce something like this:

(top of page)

WWW-Talk Archives

(list of indexed articles below)

Updating Options:
-x, -u

The -x option tells Hypermail to explicitly overwrite any previous HTML files that may exist. Use this option only when it is desirable to completely rewrite the entire archive.

The -u option tells Hypermail to update the archives by one message only. With this option, only one email message will be read in from a file or standard input. This message will be added to the end of the existing HTML file archive and will be in tegrated into it by links and cross-references. All archive index files will be regenerated to include the new message.

Important! - If the -u option is used and Hypermail is reading from a mailbox file, Hypermail will assume that the file contains only one article, no matter how many files the mailbox may actually contain. Make sure that Hypermail is given o nly one article when using this option.

If the mailbox that is being read from is an archive that new messages are always being added to, don't use either of these options. Hypermail will then read in all the messages given it but will only write new messages that have been appended to the mail box.

   example 1: cat "one.letter" | hypermail -i -u -d "/www-talk"
   example 2: hypermail -i -u -m "one.letter" -d "/www-talk"
   example 3: hypermail -m "mailbox" -d "/www-talk" -x
   example 4: hypermail -m "mailbox" -d "/www-talk"

  1. This tells Hypermail to take the article it receives from standard input and integrate it with the archive under the www-talk directory. If no archive exists, a new one will be created with the specified letter as the first file of the a rchive.

  2. This does the same thing, except that the letter is read in from a file that contains only that letter.

  3. With these options, Hypermail will read in the articles from mailbox and write over any existing files in the www-talk directory if they exist. If no archive exists, a new one will be created.

  4. With these options, Hypermail will read in the articles from mailbox and only write new articles - it will not overwrite any existing archive files.

Note that no matter what options are specified, the index files are always rewritten. The date when Hypermail was last run is included in index pages, so it's easy to tell when the archive was last updated.

Miscellaneous Options
-p

The -p option shows a progress report as Hypermail reads in and writes out messages - the number of files that Hypermail is reading and writing and the file names of the directory and files created are shown.


Configuration Options

Hypermail has many variables that can be set as environment variables or as variables in the specified configuration file. For instance, using the C shell, one could define variables in this manner:

   setenv HM_MBOX /home/john/my_mailbox
   setenv HM_FILEMODE 0600

In the configuration file, variables must be in lowercase and separated by their values with an equals (=) sign. Blank lines and lines beginning with the # character are skipped:

   set hm_mbox = "/home/john/my_mailbox"
   set hm_filemode = 0600

Settings are read in this order:

  1. From the program's hard-wired internal defaults,
  2. From environment variables,
  3. From command-line options,
  4. From the configuration file.

Below is a list of configuration variables that can be defined. Boolean numbers can have the value of 0 or 1.

HM_CONFIGFILE "filename"
This is the default configuration file to read settings in from. This can only be specified as an environment variable. If the first character is "~", Hypermail will look for the file under the current user's home directory.

HM_MBOX "filename"
This is the default mailbox to read messages in from. Define this with a value of "NONE" to read from standard input as the default.

HM_ARCHIVES "URL"
This will create a link in the archived index pages to the specified URL. Define as "NONE" to omit such a link.

HM_ABOUT "URL"
This will create a link in the archived index pages to the specified URL. Define as "NONE" to omit such a link.

HM_REVERSE boolean_number
Defining this variable as 1 will reverse-sort the article entries in the date and thread index files by the date they were received. That is, the most recent messages will appear at the top of the index rather than the other way around.

HM_SHOWHEADERS boolean_number
Define this as 1 to show the article header lines in the archived HTML files. These lines typically include the "To:", "From:", and "Subject:" information found in most email messages.

HM_SHOWHTML boolean_number
Define as 1 this to show the articles in a proportionally-spaced font rather than a fixed-width (monospace) font. Defining this option will also tell Hypermail to attempt to italicize quoted passages in articles.

HM_LABEL "label name"
Define this as the default label to put in archives.

HM_DIR "directory"
This is the default directory that Hypermail will look for when creating and updating archives. If defined as "NONE", the directory name will be the same name as the mailbox read in.

HM_DIRMODE octal_number
This is an octal number that new directories are set to when they are created. If the archives will be made publically available, it's a good idea to define this as 0755. If files will be updated incrementally with sendmail, this will ha ve to be 0777.

HM_FILEMODE octal_number
This is an octal number that new files are set to when they are created. If the archives will be made publically available, it's a good idea to define this as 0644. If files will be updated incrementally with sendmail, this will have to be 0666.

HM_OVERWRITE boolean_number
Define as 1 to make Hypermail overwrite existing archives by default.

HM_INCREMENT boolean_number
Define as 1 to read one article only and append it to existing archives by default.

HM_PROGRESS boolean_number
Define as 1 to always show a progress report as Hypermail works.

HM_THRDLEVELS number
This specifies the number of thread levels to outline in the thread index. For instance, if THRDLEVELS is 2, replies to messages will be indented once in the index, but replies to replies, etc., will only be indented once as well.

HM_DEFAULTINDEX "type"
This is the index that is intended to be the one that users see first when entering the archive. Possible values are "date", "thread", "subject", and "author".

There are a few #define options which can only be changed in the source code:

SHOWBR
When defined, <br> tags will be placed at the end of article lines. Otherwise, all non-quoted article lines will word wrap. This only takes effect if SHOWHTML is defined.

IQUOTES
When defined, Hypermail attempts to italicize quoted lines. This only takes effect if SHOWHTML is defined.

SHOWHR
When defined, horizontal rules are placed before and after articles.

EURODATE
When defined, article received dates will appear with days before months instead of months before days.

SHOWREPLIES
When defined, all replies to a message will be shown as links in article files.

MAILCOMMAND "command"
This specifies the mail command to use when converting email addresses to links. Variables can be used in constructing the command string:

If MAILCOMMAND is not defined, email addresses will not be converted to links in articles. A possible command one could use is "mailto:$TO", but this could easily be changed to specify a CGI program such as "/cgi-bin/mail?t o=$TO". A CGI mail program is included with the source which can be used for this purpose.


Other Things

Filenames: In the specified directory, articles will be read out in the order that they were read in from a mailbox or standard input. Filenames start at zero and increase in this fashion: 0000.html, 0001.html, 0002. html, etc. In the same directory:

Sorting: In the date and thread index files, note that these lists are sorted by the date the articles were received by the system's mail daemon, not by the date they were written on. The order of articles in the date index may not necessarily matc h the order in which the article files are written and linked together. Because of this, it is a good idea to make sure the mailbox is sorted by date with the most recent messages towards the bottom.

Running Hypermail automatically: All that's needed to start archiving email messages is to set up Hypermail to do incremental updates in your /etc/aliases file. Here's what an entry might look like (the last line is one unbroken line):

   # Archived mailing list
   # admin@foo.bar 1/1/94
   list: john, mary, "|/usr/local/bin/hypermail -i -u
   -d /archives/list -l \"Mailing List Archive\""

After adding the entry, make sure newaliases is run to update the mail aliases. This entry will run Hypermail and update/create the archive whenever a new message is received. Hypermail also works well as a cron job. Because sendmail may run Hypermail as different users (this is a well-known sendmail bug), you will want to make sure that archive directories and files are made readable and writeable by everyone when they are created. This will ensure that there will be no problems incrementally updating the archive.

Including HTML in messages: One can include formatted HTML in message bodies by enclosing the HTML with the <HTML> tag (in either uppercase or lowercase). This tag must be on a line by itself:

   This text will not be parsed...
   <html>
   this text will be parsed as HTML.
   </html>
   This text will not be parsed...

There is no limit to how often the <HTML> tag can be used in an article.


Getting Hypermail

All versions of Hypermail are available free of charge under a license agreement. It allows free use for noncommercial purposes, and protects against unauthorized commercial distribution. To view the agreement, open your World-Wide Web browser to http://www.eit.com/software/hypermail/license.html.

Hypermail binaries and source are available via FTP from ftp.eit.com in the /pub/web.software/hypermail directory.

Hypermail binaries are available for the following platforms:

The Common Lisp version of Hypermail has had no formal version number and differs in many ways from the current C version. Older documentation and information on this version can be found at http://gummo.stanford.edu/html/hypermail/hypermail.html. The latest documentation of the C version can always be found at http://www.eit.com/software/hypermail/hypermail.html.

Please send any feature requests, bug fixes, and comments on the C version of Hypermail to Kevin Hughes at kevinh@eit.com. Requests, fixes, and comments on the Common Lisp version should be sent to Tom Gruber at gruber@ksl.stanford.edu.


Last updated August 1, 1994