[Prev][TOC][Manual][Home][Next]


Message Pages


Can I change the order the message resources are printed?

No. However, with the exceptions of the message header and body (but see next questions), those resource can be defined anyway you like. For example, I can change the TOPLINKS resource to look like the BOTLINKS resource. Or, I can change the default meaning of the resource so it really outputs something else entirely. If you look at the documentation, the resources are just defined by HTML markup and resource variables. Many of the resource variables can be used within any resource.


How can I change how message headers gets formatted?

There are several resources for controlling how message headers are converted into HTML. You can exclude fields and style fields with your own HTML markup. For example, here are resources that cause message headers to be formatted with a table:

<FIELDSBEG>
<table>
</FIELDSBEG>
<LABELBEG>
<tr>
<td align="right" valign="top">
</LABELBEG>
<LABELEND>
</td>
</LABELEND>
<FLDBEG>
<td align="left">
</FLDBEG>
<FLDEND>
</td>
</tr>
</FLDEND>
<FIELDSEND>
</table>
</FIELDSEND>

You can also control the order message fields are displayed:

<FIELDORDER>
from
subject
date
-extra-
</FIELDORDER>

The "-extra-" signifies all other message fields in alphabetic order.

You can also exclude specific message fields:

<EXCS>
x-
precendence
</EXCS>

Here, we are exluding all "X-..." fields and the Precendence field.

Consult the MHonArc documentation for more information on how to use the resources shown here and other resources for controlling message header formatting.


How can I change how message body data gets formatted?

Message body conversion are controlled by content-type filters. See the MIME section of this FAQ for more information.


Can I have the message header come after the body?

In general, no. A limitation of MHonArc is that you cannot change the relative order of the resources/message-data in the output (but see other questions in this section). MHonArc expects a specific order so it can edit archived messages when needed w/o using a bunch of logic and performance degradation (special comment declarations are used to mark off the different sections of a message). Therefore, you cannot have the body come before the message header. The best you can do is suppress the header (via EXCS) and create a bogus header via the resource variables available. For example:

<EXCS override>
.
</EXCS>
<MSGFOOT>
<ul>
<li>From: $FROM$
<li>Subject: $SUBJECTNA$
<li>Date: $DATE$
<ul>
</MSGFOOT>

In v2.6, you can include additional header fields by using the FIELDSTORE resource and the $MSGHFIELD$ resource variable. For example, say you want to include the To: field in the previous example. You can do the following:

<EXCS override>
.
</EXCS>
<FIELDSTORE>
to
</FIELDSTORE>
<MSGFOOT>
<ul>
<li>To: $MSGHFIELD(CUR;to)$
<li>From: $FROM$
<li>Subject: $SUBJECTNA$
<li>Date: $DATE$
<ul>
</MSGFOOT>

Can I make changes to message formatting on existing archived messages?

Yes, mostly. The only thing cannot be changed once converted is the message header and message body (but see note below). All other parts of the message page can be changed at any time. To make any changes appear on existing archived messages, set the EDITIDX resource. The EDITIDX resource tells MHonArc to recreate all archive pages.

NOTE:

v2.6 introduced the RECONVERT resource. With RECONVERT, you can reconvert messages if the original raw messages are available. See RECONVERT examples for more information.


What are those "<!--X-... -->"?

If you ever looked at the HTML source of converted messages, you will notice a bunch of comment declarations, "<!--X-... -->". These comment declarations are used by MHonArc to properly edit messages when needed. Therefore, DO NOT MESS WITH THEM.


Are those "<!--X-... -->" legal comments?

Yes.


Can I have footers removed from messages when archived?

The following questions are in the same class as the following:

Can I remove signatures in archived messages?
Can I remove list footers in archived messages?
Can I remove mail ads from archived messages?

Yes, but you will need to register a custom filter via the MIMEFILTERS resource.

The following custom filter will remove signatures from messages:

package my_text_plain;

sub filter {
  my($fields, $data, $is_decoded, $filter_args) = @_;

  # strip signature
  $$data =~ s/\r\n/\n/g;
  $$data =~ s/^-- \n[\s\S]*//m;

  # call mhonarc's default filter to do everything else
  require mhtxtplain.pl;
  return m2h_text_plain::filter($fields, $data, $is_decoded, $filter_args);
}

With this implementation, your customization will inherit any new capabilities (and bug fixes) of the default plain text filter without have to update your filter each time you upgrade mhonarc.

Let's assume the filter above is contained in the file my_txtplain.pl. To register the filter into MHonArc we use the MIMEFILTERS resource:

<MIMEFilters>
application/x-patch;     my_text_plain::filter;       my_txtplain.pl
message/delivery-status; my_text_plain::filter;       my_txtplain.pl
message/partial;         my_text_plain::filter;       my_txtplain.pl
text/*;                  my_text_plain::filter;       my_txtplain.pl
text/plain;              my_text_plain::filter;       my_txtplain.pl
x-sun-attachment;        my_text_plain::filter;       my_txtplain.pl
</MIMEFilters>

[Prev][TOC][Manual][Home][Next]


$Date: 2005/05/25 19:51:01 $
MHonArc
Copyright © 1997-2004, Earl Hood, mhonarc@mhonarc.org