Debian Codegraph @

doc/faq/msgpgs.html

raw
1 <HTML>
2 <HEAD>
3 <TITLE>MHonArc FAQ: Message Pages</TITLE></HEAD>
4 <link rel="stylesheet" type="text/css" href="../docstyles.css">
5 <BODY>
6
7 <!--X-NavButtons-Start-->
8 <table width="100%"><tr><td align="left"><nobr>[<a href="indexpgs.html">Prev</a>]</nobr></td><td align="center" width="100%">[<a href="faq.html">TOC</a>][<a href="../mhonarc.html">Manual</a>][<a href="http://www.mhonarc.org/">Home</a>]</td><td align="right"><nobr>[<a href="threads.html">Next</a>]</nobr></td></tr></table>
9 </p>
10 <!--X-NavButtons-End-->
11
12 <!-- ===================================================================== -->
13 <hr>
14 <H2><a name="messagepages">Message Pages</a></H2>
15
16 <!--X-TOC-Start-->
17 <ul>
18 <li><a href="#msgorder">Can I change the order the message resources are printed?</a></li>
19 <li><a href="#msghead">How can I change how message headers gets formatted?</a></li>
20 <li><a href="#msgbody">How can I change how message body data gets formatted?</a></li>
21 <li><a href="#headnbody">Can I have the message header come after the body?</a></li>
22 <li><a href="#chngmesgfmt">Can I make changes to message formatting on existing archived messages?</a></li>
23 <li><a href="#msgcomms">What are those "&lt;!--X-... -->"?</a></li>
24 <li><a href="#commslegal">Are those "&lt;!--X-... -->" legal comments?</a></li>
25 <li><a href="#removingmsgfooters">Can I have footers removed from messages when archived?</a></li>
26 </ul>
27 <!--X-TOC-End-->
28
29 <!-- ??????????????????????????????????????????????????????????????? -->
30 <hr noshade size=1>
31 <table border=0>
32 <tr valign=baseline><td><img src="monicon.png" align="bottom" alt=""></td><td>
33 <h3><b><a name="msgorder">Can I change the order the message resources are printed?</a></b></h3>
34 </td></tr></table>
35
36 <p>No. However, with the exceptions of the message header and body
37 (but see next questions), those resource can be defined
38 anyway you like. For example, I can change the <a href="../resources/toplinks.html">TOPLINKS</a> resource
39 to look like the <a href="../resources/botlinks.html">BOTLINKS</a> resource. Or, I can change the
40 default meaning of the resource so it really outputs something
41 else entirely. If you look at the documentation, the resources
42 are just defined by HTML markup and resource variables. Many
43 of the resource variables can be used within any resource.
44 </p>
45
46 <!-- ??????????????????????????????????????????????????????????????? -->
47 <hr noshade size=1>
48 <table border=0>
49 <tr valign=baseline><td><img src="monicon.png" align="bottom" alt=""></td><td>
50 <h3><b><a name="msghead">How can I change how message headers gets formatted?</a></b></h3>
51 </td></tr></table>
52
53 <p>There are several resources for controlling how message headers
54 are converted into HTML. You can exclude fields and style fields
55 with your own HTML markup. For example, here are resources that
56 cause message headers to be formatted with a table:
57 </p>
58 <pre class="code">
59 <b>&lt;<a href="../resources/fieldsbeg.html">FIELDSBEG</a>&gt;</b>
60 &lt;table&gt;
61 <b>&lt;/FIELDSBEG&gt;</b>
62 <b>&lt;<a href="../resources/labelbeg.html">LABELBEG</a>></b>
63 &lt;tr&gt;
64 &lt;td align="right" valign="top"&gt;
65 <b>&lt;/LABELBEG&gt;</b>
66 <b>&lt;<a href="../resources/labelend.html">LABELEND</a>&gt;</b>
67 &lt;/td&gt;
68 <b>&lt;/LABELEND&gt;</b>
69 <b>&lt;<a href="../resources/fldbeg.html">FLDBEG</a>&gt;</b>
70 &lt;td align="left"&gt;
71 <b>&lt;/FLDBEG&gt;</b>
72 <b>&lt;<a href="../resources/fldend.html">FLDEND</a>&gt;</b>
73 &lt;/td&gt;
74 &lt;/tr&gt;
75 <b>&lt;/FLDEND&gt;</b>
76 <b>&lt;<a href="../resources/fieldsend.html">FIELDSEND</a>&gt;</b>
77 &lt;/table&gt;
78 <b>&lt;/FIELDSEND&gt;</b>
79 </pre>
80
81 <p>You can also control the order message fields are displayed:
82 </p>
83 <pre class="code">
84 <b>&lt;<a href="../resources/fieldorder.html">FIELDORDER</a>&gt;</b>
85 from
86 subject
87 date
88 -extra-
89 <b>&lt;/FIELDORDER&gt;</b>
90 </pre>
91 <p>The "-extra-" signifies all other message fields in alphabetic
92 order.
93 </p>
94
95 <p>You can also exclude specific message fields:
96 </p>
97 <pre class="code">
98 <b>&lt;<a href="../resources/excs.html">EXCS</a>&gt;</b>
99 x-
100 precendence
101 <b>&lt;/EXCS&gt;</b>
102 </pre>
103 <p>Here, we are exluding all "X-..." fields and the Precendence
104 field.
105 </p>
106
107 <p>Consult the MHonArc documentation for more information
108 on how to use the resources shown here and other resources for
109 controlling message header formatting.
110 </p>
111
112 <!-- ??????????????????????????????????????????????????????????????? -->
113 <hr noshade size=1>
114 <table border=0>
115 <tr valign=baseline><td><img src="monicon.png" align="bottom" alt=""></td><td>
116 <h3><b><a name="msgbody">How can I change how message body data gets formatted?</a></b></h3>
117 </td></tr></table>
118
119 <p>Message body conversion are controlled by content-type filters.
120 See the <a href="mime.html">MIME</a> section of this FAQ for
121 more information.
122 </p>
123
124 <!-- ??????????????????????????????????????????????????????????????? -->
125 <hr noshade size=1>
126 <table border=0>
127 <tr valign=baseline><td><img src="monicon.png" align="bottom" alt=""></td><td>
128 <h3><b><a name="headnbody">Can I have the message header come after the body?</a></b></h3>
129 </td></tr></table>
130
131 <p>In general, no. A limitation of MHonArc is that you cannot change
132 the relative order of the resources/message-data in the output (but see
133 other questions in this section). MHonArc expects
134 a specific order so it can edit archived messages when needed w/o
135 using a bunch of logic and performance degradation (special comment
136 declarations are used to mark off the different sections of a message).
137 Therefore, you cannot have the body come before the message header.
138 The best you can do is suppress the header (via <a href="../resources/excs.html">EXCS</a>) and create a
139 bogus header via the resource variables available. For example:
140 </p>
141 <pre class="code">
142 <b>&lt;<a href="../resources/excs.html">EXCS</a> override&gt;</b>
143 .
144 <b>&lt;/EXCS&gt;</b>
145 <b>&lt;<a href="../resources/msgfoot.html">MSGFOOT</a>&gt;</b>
146 &lt;ul&gt;
147 &lt;li&gt;From: $FROM$
148 &lt;li&gt;Subject: $SUBJECTNA$
149 &lt;li&gt;Date: $DATE$
150 &lt;ul&gt;
151 <b>&lt;/MSGFOOT&gt;</b>
152 </pre>
153
154 <p>In v2.6, you can include additional header fields by using the
155 <a href="../resources/fieldstore.html">FIELDSTORE</a> resource
156 and the <tt>$MSGHFIELD$</tt> resource variable. For example, say
157 you want to include the <tt>To:</tt> field in the previous example.
158 You can do the following:
159 </p>
160 <pre class="code">
161 <b>&lt;<a href="../resources/excs.html">EXCS</a> override&gt;</b>
162 .
163 <b>&lt;/EXCS&gt;</b>
164 <b>&lt;<a href="../resources/fieldstore.html">FIELDSTORE</a>&gt;</b>
165 to
166 <b>&lt;/FIELDSTORE&gt;</b>
167 <b>&lt;<a href="../resources/msgfoot.html">MSGFOOT</a>&gt;</b>
168 &lt;ul&gt;
169 &lt;li&gt;To: $MSGHFIELD(CUR;to)$
170 &lt;li&gt;From: $FROM$
171 &lt;li&gt;Subject: $SUBJECTNA$
172 &lt;li&gt;Date: $DATE$
173 &lt;ul&gt;
174 <b>&lt;/MSGFOOT&gt;</b>
175 </pre>
176
177 <!-- ??????????????????????????????????????????????????????????????? -->
178 <hr noshade size=1>
179 <table border=0>
180 <tr valign=baseline><td><img src="monicon.png" align="bottom" alt=""></td><td>
181 <h3><b><a name="chngmesgfmt">Can I make changes to message formatting on existing archived messages?</a></b></h3>
182 </td></tr></table>
183
184 <p>Yes, mostly. The only thing cannot be changed once converted
185 is the message header and message body (but see
186 <a href="#reconvert_note">note below</a>). All other parts of the
187 message page can be changed at any time. To make any changes
188 appear on existing archived messages, set the <a href="../resources/editidx.html">EDITIDX</a> resource.
189 The <a href="../resources/editidx.html">EDITIDX</a> resource tells MHonArc to recreate all archive
190 pages.
191 </p>
192 <table class="note" width="100%">
193 <tr valign="baseline">
194 <td><a name="reconvert_note"><strong>NOTE:</strong></a></td>
195 <td width="100%"><p>v2.6 introduced the
196 <a href="../resources/reconvert.html">RECONVERT</a> resource. With
197 RECONVERT, you can reconvert messages if the original raw messages
198 are available. See RECONVERT
199 <a href="../resources/reconvert.html#examples">examples</a> for
200 more information.
201 </p>
202 </td>
203 </tr>
204 </table>
205
206 <!-- ??????????????????????????????????????????????????????????????? -->
207 <hr noshade size=1>
208 <table border=0>
209 <tr valign=baseline><td><img src="monicon.png" align="bottom" alt=""></td><td>
210 <h3><b><a name="msgcomms">What are those "&lt;!--X-... -->"?</a></b></h3>
211 </td></tr></table>
212
213 <p>If you ever looked at the HTML source of converted messages,
214 you will notice a bunch of comment declarations, "&lt;!--X-... -->".
215 These comment declarations are used by MHonArc to
216 properly edit messages when needed. Therefore, <strong>DO NOT
217 MESS WITH THEM</strong>.
218 </p>
219
220 <!-- ??????????????????????????????????????????????????????????????? -->
221 <hr noshade size=1>
222 <table border=0>
223 <tr valign=baseline><td><img src="monicon.png" align="bottom" alt=""></td><td>
224 <h3><b><a name="commslegal">Are those "&lt;!--X-... -->" legal comments?</a></b></h3>
225 </td></tr></table>
226
227 <p>Yes.
228 </p>
229
230 <!-- ??????????????????????????????????????????????????????????????? -->
231 <hr noshade size=1>
232 <table border=0>
233 <tr valign=baseline><td><img src="monicon.png" align="bottom" alt=""></td><td>
234 <h3><b><a name="removingmsgfooters">Can I have footers removed from messages when archived?</a></b></h3>
235 </td></tr></table>
236
237 <p>The following questions are in the same class as the following:
238 </p>
239 <p><b>Can I remove signatures in archived messages?</b><br>
240 <b>Can I remove list footers in archived messages?</b><br>
241 <b>Can I remove mail ads from archived messages?</b>
242 </p>
243
244 <p>Yes, but you will need to register a custom filter via the
245 <a href="../resources/mimefilters.html">MIMEFILTERS</a> resource.
246 </p>
247 <p>The following custom filter will remove signatures from messages:
248 </p>
249 <pre class="code">
250 package my_text_plain;
251
252 sub filter {
253 my($fields, $data, $is_decoded, $filter_args) = @_;
254
255 # strip signature
256 $$data =~ s/\r\n/\n/g;
257 $$data =~ s/^-- \n[\s\S]*//m;
258
259 # call mhonarc's default filter to do everything else
260 require mhtxtplain.pl;
261 return m2h_text_plain::filter($fields, $data, $is_decoded, $filter_args);
262 }
263 </pre>
264 <p>With this implementation, your customization will inherit any new
265 capabilities (and bug fixes) of the default plain text filter without
266 have to update your filter each time you upgrade mhonarc.
267 </p>
268
269 <p>Let's assume the filter above is contained in the file
270 <tt>my_txtplain.pl</tt>. To register the filter into MHonArc
271 we use the <a href="../resources/mimefilters.html">MIMEFILTERS</a> resource:
272 </p>
273 <pre class="code">
274 &lt;MIMEFilters&gt;
275 application/x-patch; my_text_plain::filter; my_txtplain.pl
276 message/delivery-status; my_text_plain::filter; my_txtplain.pl
277 message/partial; my_text_plain::filter; my_txtplain.pl
278 text/*; my_text_plain::filter; my_txtplain.pl
279 text/plain; my_text_plain::filter; my_txtplain.pl
280 x-sun-attachment; my_text_plain::filter; my_txtplain.pl
281 &lt;/MIMEFilters&gt;
282 </pre>
283
284 <!-- ===================================================================== -->
285 <hr>
286
287 <!--X-NavButtons-Start-->
288 <table width="100%"><tr><td align="left"><nobr>[<a href="indexpgs.html">Prev</a>]</nobr></td><td align="center" width="100%">[<a href="faq.html">TOC</a>][<a href="../mhonarc.html">Manual</a>][<a href="http://www.mhonarc.org/">Home</a>]</td><td align="right"><nobr>[<a href="threads.html">Next</a>]</nobr></td></tr></table>
289 </p>
290 <!--X-NavButtons-End-->
291
292 <HR>
293 <address>
294 $Date: 2006/05/26 14:11:57 $ <br>
295 <img align="top" src="monicon.png" alt="">
296 <a href="http://www.mhonarc.org/"
297 ><strong>MHonArc</strong></a><br>
298 Copyright &#169; 1997-2004, <a href="http://www.earlhood.com/"
299 >Earl Hood</a>, <a href="mailto:mhonarc&#37;40mhonarc.org"
300 >mhonarc<!--
301 -->&#64;<!--
302 -->mhonarc.org</a><br>
303 </address>
304 </BODY>
305 </HTML>