mhonarc-users

Re: Qn about a interesting but slight mis-use of mhonarc

2002-05-01 10:14:30
On April 30, 2002 at 23:44, Jym Dyer wrote:

=v= Okay, I've put the rough cut script below.  It's got a lot
of stuff hardcoded into it, and does hacky things like grabbing
info out of comments that is better gotten from variables.  I'm
working on a rewrite that uses mhamain.pl and also does other
fancy things, but this is what I whipped together in one hour.

Here are some (hopefully) helpful tips for you or anyone wanted
to leverage MHonArc via the API or its internals:

. Some of the MHonArc API is documented in an appendix section
  of the documentation.  I think it is a place to start initially
  for doing any custom work.

. Most of the MHonArc core code is in the "mhonarc" namespace
  (the lowercase name is one of the many left-overs from
  Perl 4).  The exceptions are:

    readmail.pl:
        The core mail parsing code is in the "readmail" namespace.

    The various content filters:
        The filters (aka MIMEFILTERS) are all in their own namespace.

. If you want a summary of MHonArc variables, have a look at
  mhinit.pl.  There are comments giving descriptions of the many
  variables used.  This can be helpful if you want to directly
  access some of the information.

. Examine the following library files for various utility routines
  before rolling your own for accessing MHonArc data: ewhutil.pl,
  mhutil.pl, mhfile.pl, mhtime.pl, mhthread.pl, and of course,
  mhamain.pl.

. If parsing MHonArc message pages, see mhmsgfile.pl for extracting
  the initial comment declaration information.  mha-dbrecover
  uses this library to help do its job.

. The mhaadmin.cgi program in the admin/ directory of the
  distribution uses much of the internals of MHonArc, and when I
  wrote years ago, it drove some of the API work that exists now.
  Therefore, it may be worth looking at, along with source for the
  commands mhonarc, mha-dbedit, mha-dbrecover, and mha-decode.

  I have not touched mhaadmin.cgi in long time, so I cannot attest
  on how funtional, or accurate, it still is.

Of course, the code base for MHonArc could be much better.  It
suffers from its initial Perl 4 heritage, so much of what exists
now has been patch work to make MHonArc more friendly for embedded
usage.

One goal is to extend the callback API described in the docs
to provide callbacks to most key events that occur in archive
processing.  This will hopefully satisfy most developer-based
needs of some users (e.g. hooks into a RDBMS).

The ultimate goal is for a complete rewrite.

--ewh