Re: List the recepient of the message in -LITemplate- ?

1999-07-02 11:44:28

Thanks for you help, this HACK showed me how flexible/configurable is the MHonArc system ! ( by the way it's working ! )


From: Earl Hood <ehood(_at_)hydra(_dot_)acs(_dot_)uci(_dot_)edu>
To: mhonarc(_at_)ncsa(_dot_)uiuc(_dot_)edu
Subject: Re: List the recepient of the message in -LITemplate- ?
Date: Thu, 01 Jul 1999 13:05:00 -0700

On July 1, 1999 at 09:31, "Simeon ben Nevel" wrote:

> Peter Hrobar said:
> > --> I'm using the MHonArc standard input to receive messages from qmail > > (via a .qmail file). Is there any tool which can copy ( or merge ) the TO:
> > field of the message to the SUBJECT field on the fly ?
> You can use a combination of procmail (to intercept the message) and
> formail (part of the procmail package) to manipulate the headers.
> As part of the process you can use procmail to deliver the message to
> MHonArc.  There's LOADS of procmail/formail information on the net...

This is probably the cleanest solution.

The alternative is to modify the MHonArc source to insert the to: field
value into the subject.  Or, *WARNING* *HACK* *HACK*, you can use
the SUBJECTSTRIPCODE to do this if you take advantage of some MHonArc
internals.  When SUBJECTSTRIPCODE is evaluated, you should be able
to access the parsed message header by access the %fields hash.


## Grab To: field.  We assume only one To: field defined in message.
my $to = $fields{'to'};

## Grab "human" name (use extract_email_address if you want address).
## This assumes only a single receipient in To: field.  If not, a more
## complex extraction may be required.
my $name = extract_email_name($to);

## Set Subject that MHonArc will use.  We just prepend name.
$_ = "$name: $_";


This is untested, so user beware.


Get Your Private, Free Email at

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