Sun 02 Jan 2011 08:57:49 AM UTC, comment #5:
For mail-archive.com, the following can be used so addresses
inside a URL is not modified. This could be generalized
to handle other contextual scenarious as desired.
I'm going to mark this item a "Wont Fix" since I see
no practical solution with existing mhonarc resources,
and the technique mentioned below can be used to get
desired results.
--------------------------------------------------------------
This method utilizes mhasiteinit.pl:
http://www.mhonarc.org/MHonArc/doc/install.html#sitelib
You need to make sure MODIFYBODYADDRESSES is disabled. If
you have a master resource file, you can add the following
at the end to ensure this:
<NOMODIFYBODYADDRESSES>
Or use the -nomodifybodyaddresses command-line option.
Then, you can have a mhasiteinit.pl like the following:
# START of mhasiteinit.pl
#------------------------
## Set package to something other than "mhonarc" to protect ourselves
## from unintentionally screwing with MHonArc's internals
package mhonarc_site_init;
## Mail-archive.com text pre-filter to not munge m-a links.
## IMPORTANT: Make sure MODIFYBODYADDRESSESS is NOT enabled since
## we obscure the addresses here. If set, our function
## will not get called.
$readmail::TextPreFilter = sub {
my $fields = shift;
my $data_r = shift;
# do not rewrite cid: URLs.
$$data_r =~ s{
((?:cid:)?|(?:(?:http://(?:www\.)?)?mail-archive\.com/)?)($mhonarc::AddrExp)
}{
($1 eq "") ? mhonarc::rewrite_raw_address($2) : $1.$2;
}gieox;
};
##---------------------------------------------------------------------------##
## Make sure to return a true value for require().
##---------------------------------------------------------------------------##
1;
_END_
|