Addendum to use of mha-preview

2011-07-13 04:15:43
Non-standard Installation of Mhonarc presents several opportunities. Non server root privileges prevent perl from knowing the paths to the Mhonarc executables.

Use of mha-preview in a non-root privilege installation presents two problems.

Earl has provided a work around in the mha-preview that allows the path to the Libraries to be made known.

# Uncomment and modify the following if MHonArc libraries were not
# installed in a perl's site directory or in perl's normal search path.
#use lib qw(/path/to/mhonarc/libraries);

Uncommenting and modifying the path as written results in a runtime error. To correct the error the path has to be closed with a forward slash

use lib qw(/path/to/mhonarc/libraries/);

Initiating mha-preview to read a text file with message separators could use a command line like this:

/home/pieno/bin/mhnew/mha-preview -rcfile /home/pieno/bin/mhnew/.mhrcfile -spammode -umask 022 -msgsep "=========================================================================" -add 7B.txt -outdir /home/pieno/public_html/archive folder name/

Notice I have moved mha-preview out of the examples folder to the main folder where the .mhrcfile is located also. On some installations it is better to use KISS rather than having neat and tidy.

A good way to test your coding is to set up a test folder in a public area and feed it with spam since it is always with us. My mailing list archives are just sent once a day so tweaking rather than taking hours can take weeks.

Oh, before I forget the .mhrcfile needs a modification to be able to display the brief text.

<!-- A compact listing template  -->
<li><font color="#000000" size="4" face=times new roman,arial, helvetica, sans-serif"><strong>$SUBJECT:40$</strong> <em>($NUMFOLUP$)</em> <em>$FROMNAME$</em><br>$X-MSG-PREVIEW$</font>

The modification is the addition of the $X-MSG-PREVIEW$

In mha-preview, I reduced the length of the snippet to 128 from the default 256. Your mileage may vary.

Earl, thanks.

John Cottingham

From: "Earl Hood" <earl(_at_)earlhood(_dot_)com>
Sent: Tuesday, July 05, 2011 7:53 AM
To: <mhonarc-users(_at_)mhonarc(_dot_)org>
Subject: Re: mha-preview and RSS

On Mon, Jul 4, 2011 at 4:38 PM, John Cottingham
<ahomeboy2000(_at_)hotmail(_dot_)com> wrote:
I have upgraded from .10 to .18 and have for years looked longingly at using
mha-preview on the maillist index. The documentation seems sparse and I
haven't a clue how to implement it.

mhonarc is now called from .procmail using the .mhrcfile. About the only
switches I use in the .mhrcfile are <reverse> and <multipg>

I recommend using a cron-based invocation model vs calling mhonarc
as mail arrives.  The later does not scale well for high volume
lists and/or larger archives.

If you intend to keep your archives for an indefinite period of
time, it is recommended to break them up into periods to avoid
a single mhonarc archive getting too large.

mharc, <>, provides scripts that
already do this, but you can always roll your own.

I assume the folks that are using mha-preview are also creating an rss index

RSS is an XML format.  Do a search for "RSS" against the
mhonarc-users archive, and you will get some useful past posts on
this subject:

mha-preview is intended to be invoked just like mhonarc.  The only
real difference is it provides support for the use of the $X-MSG-PREVIEW$
resource variable in layout resources to contains the first X number
characters of the message body (defaults to 256).


 mha-preview -man

provides information about the script.

If you plan on using it, I recommend testing it out first on
some sample data.  The script has not been touched in a long


<Prev in Thread] Current Thread [Next in Thread>