The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
<html>
<head>
<title>MHonArc Reference -- Common Tasks</title>
<link rel="stylesheet" type="text/css" href="docstyles.css">
</head>
<body>

<!--X-NavButtons-Start-->
<table width="100%">
<tr valign="top">
<td align="left"><nobr><a href="quickstart.html"><img src="prev.png"border=0 alt="[Prev]"></a>&nbsp;&nbsp;&nbsp;</nobr></td><td align="center" width="99%"><a href="mhonarc.html"><img src="up.png" border=0 alt="[TOC]"></a><a href="faq/faq.html"><img src="faq.png" border=0 alt="[FAQ]"></a><a href="app-bugs.html"><img src="bug.png" border=0 alt="[Bugs]"></a><a href="http://www.mhonarc.org/"><img src="home.png" border=0 alt="[Home]"></a></td><td align="right"><nobr>&nbsp;&nbsp;&nbsp;<a href="layout.html"><img src="next.png" border=0 alt="[Next]"></a></nobr></td></tr></table>
<!--X-NavButtons-End-->

<!-- *************************************************************** -->
<HR>
<H1><a name="commontasks">Common Tasks</a></H1>

<p>The following section describes how to perform some common tasks with
MHonArc, beyond those mentioned in
<a href="quickstart.html"><cite>Quick Start</cite></a>.
To get a complete picture of the capabilities of MHonArc, see the
<a href="resources.html"><cite>Resources</cite></a> section.
</p>

<!--X-TOC-Start-->
<ul>
<li><a href="#chgtitle">Setting the Index Title</a>
<li><a href="#chg-idx-order">Changing Index Listing Order</a>
<li><a href="#rmm">Removing Messages</a>
<ul>
<li><small><a href="#autormm">Automatic Removal</a></small>
<li><small><a href="#manualrmm">Manual Removal</a></small>
</ul>
<li><a href="#layout">Customizing Page Layout</a>
</ul>
<!--X-TOC-End-->

<!-- *************************************************************** -->
<hr>
<h2><a name="chgtitle">Setting the Index Title</a></h2>

<p>If you tested MHonArc out on some of your mail,
you may have noticed that the titles of the main (date)
and thread index pages are not very descriptive: "Mail Index"
and "Mail Thread Index", respectively.
MHonArc allows you to change the titles via the
<a href="resources/title.html"><tt>-title</tt></a> and
<a href="resources/ttitle.html"><tt>-ttitle</tt></a> options so the
index page titles provide a better reflection of the type of mail
archived.
</p>
<p>The <a href="resources/title.html"><tt>-title</tt></a> option sets
main index title, and the
<a href="resources/ttitle.html"><tt>-ttitle</tt></a> option sets
the thread index title.  Example:
</p>
<table border=1 width="100%"><tr><td><pre class="shell">
prompt&gt; <b>mhonarc <a class="shell" href="resources/title.html">-title</a> "The Widget List Archive" \
	       <a class="shell" href="resources/ttitle.html">-ttitle</a> "The Widget List Thread Archive"</b> ...
</pre></td></tr></table>

<!-- *************************************************************** -->
<hr>
<h2><a name="chg-idx-order">Changing Index Listing Order</a></h2>

<p>By default, messages are listed in chronological order on
the main and thread index pages.
</p>
<table class="note" width="100%">
<tr valign=top>
<td><strong>NOTE:</strong></td>
<td width="100%"><p>The chronological order in the thread index is based on
the root messages of each thread.
</p>
</td>
</tr>
</table>
<p>For many, the default listing order is
not what is desired.  A common desire is to have
messages in the main index listed in reverse chronological order;
ie. the most recent messages are listed first while the oldest
are listed last.  Or, one may want to list messages by author
since the target audience is more interested in looking up messages
by certain authors than by date.
</p>
<p>Following is the list options available for changing the
listing order on index pages:
</p>

<table border=0>
<tr>
<td align="right"><b>Option</b>&nbsp;</td><td><b>Description</b></td>
</tr>
<tr valign="top"><td align="right"><b><a name="authsort" href="resources/authsort.html"><tt>-authsort</tt></a></b>&nbsp;</td><td>Sort main index by author.</td></tr>
<tr valign="top"><td align="right"><b><a name="reverse" href="resources/reverse.html"><tt>-reverse</tt></a></b>&nbsp;</td><td>Reverse the listing order in the main index.</td></tr>
<tr valign="top"><td align="right"><b><a name="sort" href="resources/sort.html"><tt>-sort</tt></a></b>&nbsp;</td><td>List messages by date in main index.</td></tr>
<tr valign="top"><td align="right"><b><a name="subsort" href="resources/subsort.html"><tt>-subsort</tt></a></b>&nbsp;</td><td>List messages by subject in main index.</td></tr>
<tr valign="top"><td align="right"><b><a name="treverse" href="resources/treverse.html"><tt>-treverse</tt></a></b>&nbsp;</td><td>List thread in reverse order.</td></tr>
<tr valign="top"><td align="right"><b><a name="tsort" href="resources/tsort.html"><tt>-tsort</tt></a></b>&nbsp;</td><td>List threads by date.</td></tr>
<tr valign="top"><td align="right"><b><a name="tsubsort" href="resources/tsubsort.html"><tt>-tsubsort</tt></a></b>&nbsp;</td><td>List threads by subject.</td></tr>
</table>

<p>For example, to get a reverse chronological listing,
do the following:
</p>
<table border=1 width="100%"><tr><td><pre class="shell">
prompt&gt; <b>mhonarc <a class="shell" href="resources/sort.html">-sort</a> <a class="shell" href="resources/reverse.html">-reverse</a></b> ...
</pre></td></tr></table>

<!-- *************************************************************** -->
<hr>
<h2><a name="rmm">Removing Messages</a></h2>

<p>There are two ways to delete messages from an archive:
automatic and manual.
</p>

<h3><a name="autormm">Automatic Removal</a></h3>

<p>MHonArc supports the ability to automatically remove archive messages
older than a specified time period, older than
a specified date/time, or by exceeding a specified maximum number.
</p>

</p>For example, if you want an archive to only
contain messages that are less than a month old, do
the following:
</p>
<table border=1 width="100%"><tr><td><pre class="shell">
prompt&gt; <b>mhonarc <a class="shell" href="resources/expireage.html">-expireage</a> 2635200 <a class="shell" href="resources/add.html">-add</a> <a class="shell" href="resources/outdir.html">-outdir</a> /path/to/archive mailbox</b>
</pre></td></tr></table>
<p>Here, we used the <a href="resources/expireage.html"><tt>-expireage</tt></a>
option
to tell MHonArc to remove messages older than 2635200 seconds (30.5 days) when
adding new messages.
Having to use seconds to specify the expiration age may be cumbersome,
therefore, a table is provided in the
<a href="resources/expireage.html">EXPIREAGE</a>
reference page listing common time periods and their equivalence in seconds.
</p>

<p>A less used option that will cause automatic deletion is the
<a href="resources/expiredate.html"><tt>-expiredate</tt></a> option.
This allows
you to specify an exact date/time where any messages older 
will be automatically removed.  For example:
</p>
<table border=1 width="100%"><tr><td><pre class="shell">
prompt&gt; <b>mhonarc <a class="shell" href="resources/expiredate.html">-expiredate</a> "1 Jan 1999 00:00:00" <a class="shell" href="resources/add.html">-add</a> <a class="shell" href="resources/outdir.html">-outdir</a> /path/to/archive mailbox</b>
</pre></td></tr></table>
<p>In this example, before MHonArc adds any new messages, it will delete
any messages with a date earlier than January 1, 1999.  See the
<a href="resources/expiredate.html">EXPIREDATE</a> reference page for
more information and for the correct expiration date syntax.
</p>

<p>An archive can also have a maximum number limit.
When the maximum number is reached, the oldest messages are automatically
removed.  The following is an example of setting the maximum size
of an archive:
</p>
<table border=1 width="100%"><tr><td><pre class="shell">
prompt&gt; <b>mhonarc <a class="shell" href="resources/maxsize.html">-maxsize</a> 500 <a class="shell" href="resources/add.html">-add</a> <a class="shell" href="resources/outdir.html">-outdir</a> /path/to/archive mailbox</b>
</pre></td></tr></table>

<h3><a name="manualrmm">Manual Removal</a></h3>

<p>Sometimes it becomes necessary to remove specific messages from archive:
Their may be some spam messages cluttering up your archive, or there
may be messages not appropriate for the archive's intended audience.
</p>
<p>To remove specific messages, use the
<a href="resources/rmm.html"><tt>-rmm</tt></a> option.  For example:
</p>
<table border=1 width="100%"><tr><td><pre class="shell">
prompt&gt; <b>mhonarc <a class="shell" href="resources/rmm.html">-rmm</a> 24 28 39 48</b>
</pre></td></tr></table>
<p>will delete messages 24, 28, 39, and 48.
</p>
<p>The number assigned to a message is part of the message's filename.
Each converted message is writting to a filename containing the number of
message.  For example, <tt>msg00024.html</tt>,
<tt>msg00028.html</tt>, <tt>msg00039.html</tt>, and <tt>msg00048.html</tt>
denote messages 24, 28, 39, and 48.
</p>
<p>Checking filenames can be awkward, an alternative is to use
the <a href="resources/scan.html"><tt>-scan</tt></a> option.  For example:
</p>
<table border=1 width="100%"><tr><td><pre class="shell">
prompt&gt; <b>mhonarc <a class="shell" href="resources/scan.html">-scan</a> <a class="shell" href="resources/outdir.html">-outdir</a> /home/ehood/html/archive</b>
Reading database ...
117 messages in /home/ehood/html/archive:
 
Msg #  YYYY/MM/DD  From             Subject                                    
-----  ----------  ---------------  -------------------------------------------
   62  1996/07/30  Kwin Kramer      Reading STDIN not from keyboard -- or, Syst
   23  1996/07/31  Christopher M.   Re: Setting <!--
-->&#64;<!--
-->INC to include my own modules 
    9  1996/08/01  Dan Kirkwood     object as hash key loses methods           
    2  1996/08/01  James F'jord Ly  Re: We're HIRING hot hackers!              
    1  1996/08/01  Christopher Cha  Curious Multi-Dimensional array behavior   
   14  1996/08/01  I R A Aggie      Re: Patch for arithmetic bug in 5.003 ?    
    3  1996/08/01  Bernard Bellon   Re: How do you grab a URL in perl?         
   38  1996/08/01  Mohammed Dewan   Help needed badly win3.1 and perl.         
   59  1996/08/01  Mohammed Dewan   Using file in perl.                        
    4  1996/08/01  Dan Gildor       Re: Threaded Discusion groups embeded in We
    5  1996/08/01  kendall shaw     addicted to emacs lisp                     
    6  1996/08/01  Ye He            Q: Sybase extension to Perl                
   83  1996/08/01  I R A Aggie      Re: Browser/Page matching CGI script       
    7  1996/08/01  Chris Schleiche  Re: Simple program looks good, but gives er
   13  1996/08/01  Steve McCullagh  Perl 5.002 and $| errors                   
...
</pre></td></tr></table>

<p>With <a href="resources/scan.html">-scan</a>, you can get a listing
of an archive to your terminal.  The listing can be used to determine
the message number for a message if you know the message's subject and
author.
</p>

<p>The <a href="resources/rmm.html"><tt>-rmm</tt></a> also supports
the ability to specify message number ranges and message-ids.  See
the <a href="resources/rmm.html">RMM</a> reference page for
more information and examples.
</p>


<!-- *************************************************************** -->
<hr>
<h2><a name="layout">Customizing Page Layout</a></h2>

<p>One of the most powerful features of MHonArc is the ability to
customize the layout of pages.  In this section, we give
a quick introduction on how customization can be done.  For more
information, see <cite><a href="layout.html">Page Layout</a></cite>.
</p>

<p>In this introduction, we want to
add a footer at the bottom of each page containing
the following markup:
</p>
<pre class="code">
&lt;hr&gt;
Please visit &lt;a href="http://www.mhonarc.org"&gt;www.mhonarc.org&lt;/a&gt;.
</pre>

<p>Create a new file called 
"<tt>myresource.mrc</tt>" and edit <tt>myresource.mrc</tt> to include
the following:
</p>
<pre class="code">
&lt;!-- Define a custom resource variable representing our link. --&gt;
<b><a href="resources/definevar.html">&lt;DefineVar&gt;</a></b>
MY-FOOTER-LINK
&lt;hr&gt;
Please visit &lt;a href="http://www.mhonarc.org"&gt;www.mhonarc.org&lt;/a&gt;.
<b>&lt;/DefineVar&gt;</b>

&lt;!-- Modify appropriate resources to print our link at the bottom
     of MHonArc generated pages. Notice how the custom resource
     variable defined above can be used to include our link. --&gt;

&lt;!-- Main index pages --&gt;
<b><a href="resources/idxpgend.html">&lt;IdxPgEnd&gt;</a></b>
$MY-FOOTER-LINK$
&lt;/body&gt;
&lt;/html&gt;
<b>&lt;/IdxPgEnd&gt;</b>

&lt;!-- Thread index pages --&gt;
<b><a href="resources/tidxpgend.html">&lt;TIdxPgEnd&gt;</a></b>
$MY-FOOTER-LINK$
&lt;/body&gt;
&lt;/html&gt;
<b>&lt;/TIdxPgEnd&gt;</b>

&lt;!-- Message pages --&gt;
<b><a href="resources/msgpgend.html">&lt;MsgPgEnd&gt;</a></b>
$MY-FOOTER-LINK$
&lt;/body&gt;
&lt;/html&gt;
<b>&lt;/MsgPgEnd&gt;</b>
</pre>

<p>The file you created is formally called a
<a href="resources/rcfile.html">resource file</a>.  A resource file
is a plain text file containing resource settings affecting the
behavior of MHonArc.  In this case, the resource defined above tells
MHonArc to include our custom footer on all pages.
</p>
<p>To inform MHonArc about your resource file, you must
specify it when invoking <tt>mhonarc</tt>:
</p>
<table border=1 width="100%"><tr><td><pre class="shell">
prompt&gt; <b>mhonarc <a class="shell" href="resources/rcfile.html">-rcfile</a> myresource.mrc</b> ...
</pre></td></tr></table>

<!-- *************************************************************** -->
<HR>
<!--X-NavButtons-Start-->
<table width="100%">
<tr valign="top">
<td align="left"><nobr><a href="quickstart.html"><img src="prev.png"border=0 alt="[Prev]"></a>&nbsp;&nbsp;&nbsp;</nobr></td><td align="center" width="99%"><a href="mhonarc.html"><img src="up.png" border=0 alt="[TOC]"></a><a href="faq/faq.html"><img src="faq.png" border=0 alt="[FAQ]"></a><a href="app-bugs.html"><img src="bug.png" border=0 alt="[Bugs]"></a><a href="http://www.mhonarc.org/"><img src="home.png" border=0 alt="[Home]"></a></td><td align="right"><nobr>&nbsp;&nbsp;&nbsp;<a href="layout.html"><img src="next.png" border=0 alt="[Next]"></a></nobr></td></tr></table>
<!--X-NavButtons-End-->

<!-- *************************************************************** -->
<hr>
<address>
$Date: 2005/05/13 00:00:35 $ <br>
<img align="top" src="monicon.png" alt="">
<a href="http://www.mhonarc.org/"><strong>MHonArc</strong></a><br>
Copyright &#169; 1997-2005 <a href="http://www.mhonarc.org/~ehood/"
>Earl Hood</a>, <a href="mailto:mhonarc&#37;40mhonarc.org"
>mhonarc<!--
-->&#64;<!--
-->mhonarc.org</a><br>
</address>

</BODY>
</HTML>