Re: changing MHonArc to display an abstract

1997-04-21 09:49:16
hi, we have the following situation, we receive mail
to a development address where 95% of the mails
have a subject like: "mr 1234 submitted" (with
a different "mr" number each).

we're currently using mhonarc and it works well, but
we'd like to replace this subject by an "Abstract:"
line that appears in the *body* of those 95% messages,
which is much more helpful. it's something like this:

Abstract: fix for client setup().

if possible, we'd like to also display the mr number above.
i.e. the link would look something like:

      mr 1234: fix for client setup().

(but just the abstract line would be fine.)

Some day in the future, I plan to have MHonArc support user
designated fields.  However, that may no occur until mhonarc
is rewritten in Perl 5.

Until then, one possible approach (WARNING! Hack! Hack!), is
to trick mhonarc on what it thinks the subject is.  Internally,
mhonarc stores all messages subjects in the %Subjects hash.
The trick is to modify this hash with the data you want so
$SUBJECT$ resource variable expands to a value you want.

The place to set %Subjects values would be in your own mime filter.
I.e.  Replace the text/plain filter with you own.  The filter can
read the message data and extract the abstract text.  Then you can
set %Subjects (make sure to use package qualification on %Subjects
so you are setting the right variable; %Subjects is in package main).
The only minor difficulty is you need to no the *key* of the message
since %Subjects are indexed by a key.  To get the proper key of the
message, use the following statement in your filter:

        $msgkey = $main'index;

Therefore, to override the %Subjects setting:

        $main'Subjects{$msgkey} = $mysubject;

Note: Under v2.0 $mysubject should NOT be htmlized.

I have not personally tested this out, but something like it
should work.

If you want to preserve the original subject along with the
abstract, you can access the messages subject via the %fields
hash passed to you mime filter.


<Prev in Thread] Current Thread [Next in Thread>
  • Re: changing MHonArc to display an abstract, Earl Hood <=