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.
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/".
|NOTE||The "%" represents your shell's prompt.|
You may specify more than one mail folder to process on the command-line:
% mhonarc path/inbox1 path/inbox2 ...
You may also specify standard input, "-", as the source of mail folder. This is useful if want to use MHonArc in a pipe:
% mhonarc -- - path/inbox
The "--" (two hyphens) is required to terminate command-line option parsing so "-" will not be treated as the start of an option. The example also illustrates that you can still specify regular mail folders with standard input. In this example, MHonArc will process standard input and then path/inbox.
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 Windows): 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 defined resources.
Other: Depending on the content-types of the e-mail messages converted, other files may be created for images, videos, binaries, etc.
The actual filenames may differ depending on the settings of various resources.
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 Converting messages to . Reading /mnt/ehood/mail/inbox .......... Writing mail ... Writing ./maillist.html ... Writing ./threads.html ... Writing database ... 10 messages
By default, MHonArc prints out information about its progress. This can be disable if you specify the -quiet option.
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 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
MHonArc has the ability to process a single mail message independent of creating, or modifying, an 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