This section will give you a "quick start" on using MHonArc. However, I recommend reading through the entire documentation to take full advantage of all the features of MHonArc.
Before continuing, make sure MHonArc has been installed. See Installation if MHonArc has not been installed on your machine.
Since MHonArc supports MH mail folders and UUCP/Unix mailbox files, the term "mail folder" will represent the MH mail folder or mailbox file you want to process. To convert your mail folder to an HTML archive, use the following:
% mhonarc
<path>/inbox
Where <path> represents the path to the directory that contains the mail folder
inbox. If you are in the directory that contains inbox, then you can leave out the
"<path>/
".
MHonArc prints out messages showing its progress as your e-mail is processed. When MHonArc finishes, the following files will be created:
maillist.html
: The main index file containing links to all mail
messages converted. Messages are listed with subjects and who the
messages are from. All messages are listed in sorted order by date
received/sent.
threads.html
: The file listing messages by thread.
msg*.html
: HTML versions of the mail messages, where *
represents a
message number from 0 to the number of message processed minus 1.
.mhonarc.db
(or MHONARC.DB
under MS-DOS): This database file is
needed inorder for MHonArc to perform additions of new mail messages
to the archive. Information is stored to perform mail threading updates
when new messages are added, as well as any resources set via
Environment variables, Resource File, and/or command-line Options.
Other: Depending on the content-types of the e-mail messages converted, other files may be created for images, videos, binaries, etc. See the section on MIME for more information.
The format of each converted mail message is as follows:
A <LINK REV="made" HREF="mailto:
from_address">
is inserted
in the HEAD
element of HTML mail message file. This allows readers of the
message to send comments to the author of the mail message within Web
browsers that support such functionality (like Lynx).
The title (i.e. TITLE
element) contains the subject of the message.
Hyperlinks to the previous and next messages and the index pages are located at the top of the message.
Next, the subject appears in a H1
element.
Next, follows the mail header with fields listed in a UL
element
surrounded by HR
's.
Next, the actual body of the mail message.
Next, links to any follow-up, or referenced, messages. The messages are listed by subject and who they are from. These links allows you to easily follow mail threads.
Last, are verbose links to the previous mail message, next mail message, and index pages.
The following is also done for each mail message processed:
Links are created in the "References
" and "In-Reply-To
" header
fields, and possibly the message body, if the destination message-ids are
being processed.
E-mail addresses are converted to "mailto
" hyperlinks in "To:
",
"From:
", "Cc:
", and "Sender:
" mail header fields. Currently, not all
Web browsers support the mailto
URL.
Newsgroups listed in a "Newsgroups:
" mail header field are converted
to news
hyperlinks.
MHonArc allows you to specify more than one mail folder to process on the command-line.
% mhonarc /home/ehood/mail/inbox1
/home/ehood/mail/inbox2
...
All the files created will be put into the current working directory, by default. You
can control the destination of the output location by using the -outdir
option.
% mhonarc -outdir /home/ehood/htmlarchive
/home/ehood/mail/inbox
Here is a sample session converting a mail folder:
% mhonarc ~/mail/inbox Requiring MIME filter libraries ... mhexternal.pl mhtxthtml.pl mhtxtplain.pl mhtxtsetext.pl Converting messages to ./maillist.html Reading /mnt/ehood/mail/inbox .......... Writing mail ... Writing tmp/maillist.html ... Writing tmp/threads.html ... 10 messages
If you have new messages you want to add to an existing archive, you must
utilizing the -add
command-line option. With the -add
, you can do the following:
Add a mail folder to an archive, or
Add a single message to an archive.
Adding a mail folder to an archive in the current working directory can be done like the following:
% mhonarc -add
<path>/mailfolder
If you are not in the same directory as the archive, then you can specify the location
of the archive to add to with the -outdir
option:
% mhonarc -add -outdir
<outdir_path>
<path>/mailfolder
MHonArc will skip any messages that already exist in the archive. Therefore, MHonArc can be used to rescan the same mail folder and only convert any new messages it finds.
If no mail folder arguments are specified, then MHonArc will attempt to add a single message read in from standard input.
% mhonarc -add < single.msg
Or, from a pipe:
% cat single.msg | mhonarc -add
See the section on Adding Messages for more information and examples for adding messages to an archive.
MHonArc has the ability to process a single mail message independent of creating,
or modifying, and archive. To convert a single message to HTML use the -single
command-line option. The message to process can be specified by a filename on
the command-line, or by reading the message from standard input if no file is
specified. The filtered message is sent to standard output. All formatting options
apply to the single message as with messages being processed for an archive, with
the exception of formatting related specificly to archive processing, like index links
and mail thread links.
% mhonarc -single < messagefile > file.html
% mhonarc -single messagefile > file.html