[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automatic linking to a mhonarc archive



Earl Hood wrote:

> To get what you want you will need to use the
> $mhonarc::CBMessageHeadRead callback since the message header is
> "htmlized" right afterwords.
> 
> What you will need to do is the following:
> 
> * In CBMessageHeadRead:
> 
>   Change $fields->{'subject'} directly.  Remember, that the values
>   of the $fields hash are array references (excluding the special
>   x-mha-... values).  Something like the following should do:
> 
>     $fields->{'subject'}[0] =~ s/\b([134]\d{6})\b/bugid($1)/ge;

Tried that already - however the subsequent htmlificaton then goes on to
convert the html link I put in the subject by escaping all the < and >
charaters - aagh!

> I wonder if having a CBRawMessageHeadRead may be worth adding.
> The callback would be called after a message header is parsed, but
> before MHonArc extracts in data from it.  Of course, you would not
> have the x-mha-... fields defined at this stage since it would
> be before MHonArc processes the header.

I've come to the conclusion that what I want isn't that sensible anyway - I
can just create a resource variable with the html link in it and then stick
that on the generated pages as normal.

What might be more generally useful is a way of overriding the 'sort by
subject' function - for example in my case I could look in the subject for a
bugid, so that mails would sort as I require even if the bugid wasn't the
first word in the subject.

-- 
Alan Burlison
--
$ head -1 /dev/bollocks
definitively target massively-scalable turnkey road maps

---------------------------------------------------------------------
To sign-off this list, send email to majordomo@mhonarc.org with the
message text UNSUBSCRIBE MHONARC-USERS


[Index of Archives]     [Bugtraq]     [Yosemite News]     [Mhonarc Home]