| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML//EN"> |
| 2 | <HTML> |
| 3 | <HEAD> |
| 4 | <TITLE>MHonArc FAQ: Archives</TITLE></HEAD> |
| 5 | <BODY> |
| 6 | |
| 7 | <!--X-NavButtons-Start--> |
| 8 | <p align=center> |
| 9 | [<a href="usage.html">Prev</a>][<a href="indexpgs.html">Next</a>][<a href="faq.html">TOC</a>][<a href="http://www.mhonarc.org/">Home</a>] |
| 10 | </p> |
| 11 | <!--X-NavButtons-End--> |
| 12 | |
| 13 | <!-- ===================================================================== --> |
| 14 | <HR> |
| 15 | <H2><a name="archives">Archives</a></H2> |
| 16 | |
| 17 | <!--X-TOC-Start--> |
| 18 | <ul> |
| 19 | <li><a href="#split">Why does a message get split into mulitple messages with no headers?</a></li> |
| 20 | <li><a href="#move">Can I move a message from one archive to another?</a></li> |
| 21 | <li><a href="#reconstruct">Can I reconstruct a database from the HTML messages?</a></li> |
| 22 | <li><a href="#dynamic">Is it safe to add messages to an archive as they are received?</a></li> |
| 23 | <li><a href="#forward">So it is safe. How do I do it??</a></li> |
| 24 | <li><a href="#majordomo">How can I do it with Majordomo lists?</a></li> |
| 25 | <li><a href="#different">Can I get MHonArc to filter messages to different archives?</a></li> |
| 26 | <li><a href="#exclude">Does MHonArc support the "no archive" flag in messages?</a></li> |
| 27 | <li><a href="#addsafe">Is it safe to specify <tt>-add</tt> when no archive exists?</a></li> |
| 28 | <li><a href="#jumps">Why are there "jumps" in message numbers?</a></li> |
| 29 | <li><a href="#dups">Why do some messages get re-added each time MHonArc processes a mail folder?</a></li> |
| 30 | <li><a href="#remove">How do I remove messages from an archive?</a></li> |
| 31 | <li><a href="#tombox">Can I convert an archive back to mailbox format?</a></li> |
| 32 | </ul> |
| 33 | <!--X-TOC-End--> |
| 34 | |
| 35 | <!-- ??????????????????????????????????????????????????????????????? --> |
| 36 | <hr noshade size=1> |
| 37 | <table border=0> |
| 38 | <tr valign=top><td><img src="monicon.png" align="bottom" alt=""></td><td> |
| 39 | <h3><b><a name="split">Why does a message get split into mulitple messages with no headers?</a></b></h3> |
| 40 | </td></tr></table> |
| 41 | |
| 42 | <P>If you are processing UUCP mailbox files, messages are |
| 43 | separated by a line starting with "<code>From </code>" (ie. The |
| 44 | word "<code>From</code>" followed by a space). Some mail software |
| 45 | will prefix lines in message bodies with a `<code>></code>' |
| 46 | to avoid MUA's from incorrectly treating the line as a message |
| 47 | separator. However, some mail software doesn't. </P> |
| 48 | |
| 49 | <P>To avoid incorrect separator detection, many MUAs perform |
| 50 | a more stricter detection of separators beyond "<code>From </code>". |
| 51 | MHonArc, by default, will treat lines starting |
| 52 | with "<code>From </code>" as a message separator, which can lead to |
| 53 | incorrect message termination if the From line has not been escaped |
| 54 | with a `<code>></code>'. </P> |
| 55 | |
| 56 | <P>To fix the problem, use the <strong>MSGSEP</strong> resource to |
| 57 | instruct MHonArc to use a stricter test detecting a message |
| 58 | separator. The following <strong>MSGSEP</strong> resource setting is |
| 59 | known to work well: </P> |
| 60 | |
| 61 | <pre> |
| 62 | <b><MsgSep></b> |
| 63 | ^From \S+\s+\S+\s+\S+\s+\d+\s+\d+:\d+:\d+\s+\d+ |
| 64 | <b></MsgSep></b> |
| 65 | </pre> |
| 66 | |
| 67 | <p>In case you have message separates with quoted local parts in |
| 68 | the address part of the separator, you can use the following: |
| 69 | </p> |
| 70 | |
| 71 | <pre> |
| 72 | <b><MsgSep></b> |
| 73 | ^From\s+(?:"[^"]+"@\S+|\S+)\s+\S+\s+\S+\s+\d+\s+\d+:\d+:\d+\s+\d+ |
| 74 | <b></MsgSep></b> |
| 75 | </pre> |
| 76 | |
| 77 | <p>Make sure to test things out before using in production |
| 78 | environments. |
| 79 | </p> |
| 80 | |
| 81 | <p>If this fails, you can try the <strong>CONLEN</strong> |
| 82 | resource available in v2.0 and later. The CONLEN resource, when set, tells |
| 83 | MHonArc to utilize the <code>Content-Length</code> fields |
| 84 | in the message head. If your MTA defines this field accurately, |
| 85 | then you can utilize this feature. |
| 86 | Sun Solaris' delivery agent will define the |
| 87 | <tt>Content-Length</tt> field for messages delivered to local users. |
| 88 | </p> |
| 89 | <p>If you use Procmail to filter your mail, |
| 90 | you can try the following Procmail recipe (contributed by |
| 91 | <a href="mailto:lindsey@ncsa.uiuc.edu">Christopher Lindsey</a>): |
| 92 | </p> |
| 93 | <blockquote> |
| 94 | <p>However, one can add a Content-Length: header with everyone's favorite |
| 95 | tool, procmail. :) Here's a recipe borrowed from David Tamkin about |
| 96 | 9 moons ago: |
| 97 | </p> |
| 98 | <pre> |
| 99 | :0fhw # B won't help; size conditions ignore H and B flags on the :0 line |
| 100 | * ! ^Content-Length:.*[0-9] |
| 101 | * 1^1 B ?? >1 |
| 102 | | formail -a "Content-Length: $=" |
| 103 | </pre> |
| 104 | <p>So if you want to count on Content-Length, the message could be |
| 105 | piped into procmail with a specific procmailrc file which would |
| 106 | do this counting and then call MHonArc. |
| 107 | </p> |
| 108 | </blockquote> |
| 109 | |
| 110 | <p>If <a href="http://www.sendmail.org/">sendmail</a> is |
| 111 | your system's MTA and you use Procmail as your local delivery agent, |
| 112 | you can configure things to have <tt>Content-Length</tt> defined |
| 113 | for all locally delivered mail. The following technique is |
| 114 | contributed by |
| 115 | <a href="mailto:tibbs@math.uh.edu">Jason L Tibbitts III</a>: |
| 116 | </p> |
| 117 | <blockquote> |
| 118 | <p>I use Procmail as my local delivery agent. I have the following extremely |
| 119 | disgusting settings in my .mc (M4 config) file to add in a Content-Length: |
| 120 | header, <u>but I'm <b>not</b> sure if I would recommend that anyone |
| 121 | actually think of using this</u>: |
| 122 | </p> |
| 123 | <pre> |
| 124 | define(`LOCAL_MAILER_FLAGS',`SPfhn9Z') |
| 125 | define(`LOCAL_MAILER_ARGS',`procmail -a $h -d $u') |
| 126 | |
| 127 | LOCAL_CONFIG |
| 128 | # |
| 129 | # Add fake Content-Length Header for local mailer |
| 130 | # This is corrected by Procmail |
| 131 | # Note that the Z flag is used here; if Z is ever defined, this |
| 132 | # will break something |
| 133 | H?Z?Content-Length: 0000000000 |
| 134 | </pre> |
| 135 | </blockquote> |
| 136 | |
| 137 | <p>If possible, try to avoid relying on the use of |
| 138 | <tt>Content-Length</tt> since it is hard to guarantee that it is |
| 139 | set properly. When <b>CONLEN</b> is specified, MHonArc will read at |
| 140 | least the number of bytes specified by <tt>Content-Length</tt> before |
| 141 | checking for the message separator, as defined by the <b>MSGSEP</b> |
| 142 | resource. Therefore, the value of <tt>Content-Length</tt> can be less |
| 143 | than the actual message size, and message extraction will probably |
| 144 | work as expected. However, if <tt>Content-Length</tt> for a message |
| 145 | has a value that is larger than the actual size, MHonArc may include |
| 146 | the content of the next message as part of the current message. |
| 147 | </p> |
| 148 | |
| 149 | <!-- ??????????????????????????????????????????????????????????????? --> |
| 150 | <hr noshade size=1> |
| 151 | <table border=0> |
| 152 | <tr valign=top><td><img src="monicon.png" align="bottom" alt=""></td><td> |
| 153 | <h3><b><a name="move">Can I move a message from one archive to another?</a></b></h3> |
| 154 | </td></tr></table> |
| 155 | |
| 156 | <P>No. In order to achieve the same effect, you must add the original, |
| 157 | unprocessed, message to the destination archive, then remove the |
| 158 | appropriate HTML version of the message from the source archive. </P> |
| 159 | |
| 160 | <!-- ??????????????????????????????????????????????????????????????? --> |
| 161 | <hr noshade size=1> |
| 162 | <table border=0> |
| 163 | <tr valign=top><td><img src="monicon.png" align="bottom" alt=""></td><td> |
| 164 | <h3><b><a name="reconstruct">Can I reconstruct a database from the HTML messages?</a></b></h3> |
| 165 | </td></tr></table> |
| 166 | |
| 167 | <p>Yes. v2.3 of MHonArc introduced a utility program called |
| 168 | <b>mha-dbrecover</b>. It gets installed with the other MHonArc |
| 169 | files during the installation process. See the documentation for |
| 170 | usage information. |
| 171 | </p> |
| 172 | |
| 173 | |
| 174 | <!-- ??????????????????????????????????????????????????????????????? --> |
| 175 | <hr noshade size=1> |
| 176 | <table border=0> |
| 177 | <tr valign=top><td><img src="monicon.png" align="bottom" alt=""></td><td> |
| 178 | <h3><b><a name="dynamic">Is it safe to add messages to an archive as they are received?</a></b></h3> |
| 179 | </td></tr></table> |
| 180 | |
| 181 | <p>Yes. MHonArc performs archive locking to protect from |
| 182 | multiple MHonArc process attempting to write to an archive |
| 183 | at the same time. This locking allows MHonArc to safely |
| 184 | be used to add messages as they are received. |
| 185 | </p> |
| 186 | |
| 187 | <table border=0 cellpadding=4> |
| 188 | <tr valign=top> |
| 189 | <td><strong>NOTE</strong></td> |
| 190 | <td><p>As an archive increases in size, performing updates as |
| 191 | a message is received takes more processing time. Therefore, for |
| 192 | large archives, you may need to do updates through a periodic |
| 193 | batch process (like via <b>cron</b>(8)) to avoid time-out problems |
| 194 | from MHonArc. |
| 195 | </p> |
| 196 | </td> |
| 197 | </tr> |
| 198 | </table> |
| 199 | |
| 200 | |
| 201 | <!-- ??????????????????????????????????????????????????????????????? --> |
| 202 | <hr noshade size=1> |
| 203 | <table border=0> |
| 204 | <tr valign=top><td><img src="monicon.png" align="bottom" alt=""></td><td> |
| 205 | <h3><b><a name="forward">So it is safe. How do I do it??</a></b></h3> |
| 206 | </td></tr></table> |
| 207 | |
| 208 | <p>Many users use <b>Procmail</b> |
| 209 | <a href="http://www.ii.com/internet/robots/procmail/" |
| 210 | ><http://www.ii.com/internet/robots/procmail/></a> to call MHonArc |
| 211 | to archive messages. Procmail provides the ability to preprocess |
| 212 | mail as it arrives to do selective processing and automated tasks |
| 213 | with your mail. |
| 214 | </p> |
| 215 | |
| 216 | <p>For illustrative purposes, the following simple example shows |
| 217 | a possible way of archiving messages as it arrives w/o using a tool |
| 218 | like Procmail. |
| 219 | This example assumes you are on a Unix-based system |
| 220 | using <b>sendmail</b> as the mail transfer agent. |
| 221 | Please refer to documentation about <b>sendmail</b> if you |
| 222 | are not familiar with it |
| 223 | (<cite><a href="http://www.ora.com/catalog/sendmail2/noframes.html" |
| 224 | >sendmail, 2ed</a>, from O'Reilly</cite> is an excellent source). |
| 225 | </p> |
| 226 | |
| 227 | <p>The approach shown here uses a |
| 228 | <b><tt>.forward</tt></b> file in the home directory of the |
| 229 | account you want mailed archived. For this example, let's |
| 230 | assume it is my account. |
| 231 | Here is how to set up the <tt>.forward</tt> file |
| 232 | to invoke MHonArc on incoming mail: </P> |
| 233 | |
| 234 | <pre> |
| 235 | \ehood, "|/home/ehood/bin/webnewmail #ehood" |
| 236 | </pre> |
| 237 | |
| 238 | <DL> |
| 239 | <DT><strong>NOTE</strong> on <tt>.forward</tt> entry: |
| 240 | <DD><P> The "<code>\ehood</code>" tells <tt>sendmail</tt> |
| 241 | to still deposit the incoming message to my mail spool file. The |
| 242 | "<code>#ehood</code>" Bourne shell comment is needed to insure the |
| 243 | command is unique from another user. Otherwise, <tt>sendmail</tt> |
| 244 | may not invoke the program for you or the other user. |
| 245 | </P></DL> |
| 246 | |
| 247 | <P><tt>webnewmail</tt> is a Perl program that calls |
| 248 | MHonArc with the appropriate arguments. A wrapper program |
| 249 | is used instead of calling MHonArc directly to keep |
| 250 | the <tt>.forward</tt> file simple, but you can call MHonArc |
| 251 | directly if you want. Here is the code to the |
| 252 | <tt>webnewmail</tt> program: </P> |
| 253 | |
| 254 | <pre> |
| 255 | #!/usr/local/bin/perl |
| 256 | # Edit above path to point to where perl is on your system. |
| 257 | |
| 258 | ## Specify a package to protect names from MHonArc. |
| 259 | |
| 260 | package WebNewMail; |
| 261 | |
| 262 | ## Edit to point to installed mhonarc. |
| 263 | |
| 264 | $MHonArc = "/home/ehood/bin/mhonarc"; |
| 265 | |
| 266 | ## Define ARGV (ARGV is same across all packages). |
| 267 | ## Edit options as required/desired. |
| 268 | |
| 269 | @ARGV = ("-add", |
| 270 | "-quiet", |
| 271 | "-outdir", "/home/ehood/public_html/newmail"); |
| 272 | |
| 273 | ## Just require mhonarc, this prevents the overhead of a |
| 274 | ## fork/exec. |
| 275 | |
| 276 | require $MHonArc; |
| 277 | |
| 278 | </pre> |
| 279 | |
| 280 | <p>The <tt>webnewmail</tt> program has to have the executable |
| 281 | bit set. This is achieved by using "<tt><b>chmod a+x webnewmail</b></tt>". |
| 282 | </p> |
| 283 | |
| 284 | <table border=0 cellpadding=4> |
| 285 | <tr valign=top> |
| 286 | <td><strong>NOTE</strong></td> |
| 287 | <td><p>For better scalability and resource usage, the author |
| 288 | recommends calling MHonArc from a facility like <b><tt>cron</tt></b>, |
| 289 | which is provided on Unix-based operating systems. |
| 290 | For those unfamiliar cron, it is a daemon that allows the execution |
| 291 | of commands on scheduled basis. |
| 292 | </p> |
| 293 | </td> |
| 294 | </tr> |
| 295 | </table> |
| 296 | |
| 297 | <!-- ??????????????????????????????????????????????????????????????? --> |
| 298 | <hr noshade size=1> |
| 299 | <table border=0> |
| 300 | <tr valign=top><td><img src="monicon.png" align="bottom" alt=""></td><td> |
| 301 | <h3><b><a name="majordomo">How can I do it with Majordomo lists?</a></b></h3> |
| 302 | </td></tr></table> |
| 303 | |
| 304 | <p>Here is a |
| 305 | template for archiving messages as they arrive for a |
| 306 | Majordomo list to include in sendmail's <tt>aliases</tt> file: |
| 307 | </p> |
| 308 | <pre> |
| 309 | <em>xxxx</em>: "|<em>/usr/lib/majordomo/</em>wrapper resend -l <em>xxxx</em> <em>xxxx</em>-outgoing" |
| 310 | <em>xxxx</em>-outgoing: :include:<em>/var/lib/majordomo/lists/</em><em>xxxx</em>, <em>xxxx</em>-mhonarc |
| 311 | <em>xxxx</em>-request: <em>list-admin-address</em> |
| 312 | owner-<em>xxxx</em>: <em>list-admin-address</em> |
| 313 | <em>xxxx</em>-owner: <em>list-admin-address</em> |
| 314 | |
| 315 | <em>xxxx</em>-mhonarc: "|<em>/usr/lib/majordomo/</em>wrapper mhonarc -add -quiet -outdir <em>/home/httpd/html/yyyyyyy</em> <em>-rcfile rcs.mrc</em> <em>-stderr /var/log/mhonarc</em>" |
| 316 | </pre> |
| 317 | |
| 318 | <p>Replace text that <em>is rendered like this</em> with |
| 319 | what is appropriate for your configuration. |
| 320 | </p> |
| 321 | <p>In order to run MHonArc with Majordomo's wrapper, the program has to |
| 322 | be in the same directory where the Majordomo programs are located. |
| 323 | An easy way to insure this is to create a symbolic link to in Majordomo's |
| 324 | program directory to where MHonArc is installed. For example: |
| 325 | </p> |
| 326 | <pre> |
| 327 | shell> <b>ln -s <em>/usr/bin/mhonarc</em> <em>/usr/lib/majordomo/mhonarc</em></b> |
| 328 | </pre> |
| 329 | <p>Make sure <em><tt>/usr/bin/mhonarc</tt></em> is readable and executable |
| 330 | by the majordomo user. Something like the following can be done |
| 331 | to insure this: |
| 332 | </p> |
| 333 | <pre> |
| 334 | shell> <b>chmod <em>755</em> <em>/usr/bin/mhonarc</em></b> |
| 335 | </pre> |
| 336 | <p>If you redirect stderr to a logfile, the logfile must |
| 337 | be owned by the majordomo user and be writable by the majordomo user. |
| 338 | The directory for that logfile must exist. |
| 339 | </p> |
| 340 | <p>The MHonArc-archive directory must be owned by the majordomo user |
| 341 | and must have the minimum access permission 755. Group ownership does not |
| 342 | matter. |
| 343 | </p> |
| 344 | |
| 345 | <!-- ??????????????????????????????????????????????????????????????? --> |
| 346 | <hr noshade size=1> |
| 347 | <table border=0> |
| 348 | <tr valign=top><td><img src="monicon.png" align="bottom" alt=""></td><td> |
| 349 | <h3><b><a name="different">Can I get MHonArc to filter messages to different archives?</a></b></h3> |
| 350 | </td></tr></table> |
| 351 | |
| 352 | <p>No. This is outside of the MHonArc's scope. You can grow your |
| 353 | own filter, using the method described in the |
| 354 | <a href="#forward">previous question</a>, to |
| 355 | scan the message header an invoke MHonArc with the proper arguments. |
| 356 | Or. you can use a tool like |
| 357 | <b>Procmail</b> |
| 358 | <a href="http://www.ii.com/internet/robots/procmail/" |
| 359 | ><http://www.ii.com/internet/robots/procmail/></a>. |
| 360 | </p> |
| 361 | |
| 362 | <table border=0 cellpadding=4> |
| 363 | <tr valign=top> |
| 364 | <td><strong>NOTE</strong></td> |
| 365 | <td><p>You may want to check out the following: |
| 366 | <strong><a href="http://www.mhonarc.org/release/mharc/">mharc</a></strong> |
| 367 | at <a href="http://www.mhonarc.org/release/mharc/" |
| 368 | ><http://www.mhonarc.org/release/mharc/></a>: |
| 369 | Mharc is a web-based mail archiving system for multiple mailing |
| 370 | lists using Procmail, MHonArc, and Namazu. |
| 371 | </p> |
| 372 | </td><tr></table> |
| 373 | |
| 374 | <p>Here are a some messages from users about using Procmail: |
| 375 | </p> |
| 376 | |
| 377 | <blockquote> |
| 378 | <UL> |
| 379 | <LI><em>From</em>: Achim Bohnet <<A HREF="mailto:ach@rosat.mpe-garching.mpg.de">ach@rosat.mpe-garching.mpg.de</A>></LI> |
| 380 | <LI><em>Date</em>: Wed, 13 Nov 1996 13:56:08 +0100</LI> |
| 381 | </UL> |
| 382 | <pre> |
| 383 | <var>... some text deleted ...</var> |
| 384 | |
| 385 | Here is what I use in .procmailrc to archive the mhonarc list: |
| 386 | |
| 387 | NEWDATE="`/usr/bin/date +%Y-%m`" |
| 388 | MHONARC_MBOX="/local/mail/lists/mhonarc/$NEWDATE.mbox" |
| 389 | :0: $MHONARC_MBOX$LOCKEXT |
| 390 | * ^Sender:.*owner-mhonarc@ |
| 391 | { |
| 392 | :0 c |
| 393 | $MHONARC_MBOX |
| 394 | |
| 395 | :0 c |
| 396 | | /local/mail/mhonarc-1.2.2/mailarchive -add mhonarc "$NEWDATE" |
| 397 | } |
| 398 | |
| 399 | Mailarchive is nothing more than a wrapper around mhonarc with my long. |
| 400 | list of options. |
| 401 | |
| 402 | Achim |
| 403 | P.S. Procmail itself comes with an example manual page. It's worth |
| 404 | looking into it. |
| 405 | |
| 406 | </pre> |
| 407 | </blockquote> |
| 408 | |
| 409 | <blockquote> |
| 410 | <hr noshade size=1> |
| 411 | <UL> |
| 412 | <LI><em>From</em>: "Eric D. Friedman" <<A HREF="mailto:friedman@hydra.acs.uci.edu">friedman@hydra.acs.uci.edu</A>></LI> |
| 413 | <LI><em>Date</em>: Wed, 13 Nov 1996 06:38:42 -0800</LI> |
| 414 | </UL> |
| 415 | <pre> |
| 416 | You can actually dispense with the wrapper if you use environment |
| 417 | variables to pass options to MHonArc, but I'm sure Achim has a good |
| 418 | reason for doing it his way. Just for the purposes of comparion, |
| 419 | here's how I do it: |
| 420 | |
| 421 | eeeweb% cat .procmailrc |
| 422 | #Set on when debugging |
| 423 | VERBOSE=off |
| 424 | #Replace `mail' with your mail directory (Pine uses mail, Elm uses Mail) |
| 425 | MAILDIR=$HOME/Mail |
| 426 | #Directory for storing procmail log and rc files |
| 427 | PMDIR=$HOME/.procmail |
| 428 | #Path and options for mhonarc |
| 429 | MHONARC='/dcs/packages/infosys/bin/mhonarc -add -quiet -umask 022 -idxfname inde |
| 430 | x.html' |
| 431 | :0 |
| 432 | * ^Originator:.*@classes.uci.edu |
| 433 | { |
| 434 | MHHOME=$HOME/classarc |
| 435 | LOGFILE=$PMDIR/classlists.log |
| 436 | INCLUDERC=$PMDIR/rc.classlists |
| 437 | } |
| 438 | :0 E |
| 439 | { |
| 440 | MHHOME=$HOME/mail-arc |
| 441 | LOGFILE=$PMDIR/otherlists.log |
| 442 | INCLUDERC=$PMDIR/rc.otherlists |
| 443 | } |
| 444 | |
| 445 | and then in the file .procmail/rc.classlists or rc.otherlists (depending |
| 446 | on the Originator: of the message), lots of the following: |
| 447 | |
| 448 | # Procmail Entry for uci-www |
| 449 | :0 E |
| 450 | * ^TOuci-www |
| 451 | { |
| 452 | :0 c |
| 453 | uci-www/. |
| 454 | |
| 455 | :0 |
| 456 | |$MHONARC -rcfile $MHHOME/uci-www/0-rcfile.html -outdir $MHHOME/uci-www |
| 457 | } |
| 458 | |
| 459 | Eric D. Friedman |
| 460 | friedman@uci.edu |
| 461 | </pre> |
| 462 | </blockquote> |
| 463 | |
| 464 | <blockquote> |
| 465 | <hr noshade size=1> |
| 466 | <UL> |
| 467 | <LI><em>From</em>: Paul McKinley <<A HREF="mailto:mckinley@austin.asc.slb.com">mckinley@austin.asc.slb.com</A>></LI> |
| 468 | <LI><em>Date</em>: Mon, 21 Apr 1997 15:29:08 -0500</LI> |
| 469 | </UL> |
| 470 | <pre> |
| 471 | <var>... some text deleted ...</var> |
| 472 | |
| 473 | I use procmail to drive mhonarc archives from Majordomo. I set up a |
| 474 | single pseudouser and drive several archives from the one pseudouser. |
| 475 | |
| 476 | Here's a sample .forward file: |
| 477 | |
| 478 | "|/usr/ucb/rsh cappuccino \"set IFS=' '; exec |
| 479 | /usr/local/procmail/bin/procmail #widget\"" |
| 480 | |
| 481 | Another example is: |
| 482 | |
| 483 | "|/bin/csh -c \"set IFS=' '; exec /usr/local/procmail/bin/procmail |
| 484 | #widget\"" |
| 485 | |
| 486 | Two reasons to use the "rsh cappuccino": |
| 487 | 1. doesn't require the user to be able to login to server, although |
| 488 | the username must still be valid |
| 489 | 2. gets the processing load off the mail server |
| 490 | |
| 491 | Here's an example .procmail recipe: |
| 492 | |
| 493 | LOGFILE=$HOME/procmail_errors |
| 494 | LOGABSTRACT=all |
| 495 | LOCKEXT=.lock |
| 496 | VERBOSE=on |
| 497 | UMASK=003 |
| 498 | |
| 499 | # widget: list short description |
| 500 | :0 H |
| 501 | * ^List-Name: widget |
| 502 | { |
| 503 | # The rotate call (under construction) does archive rotation |
| 504 | # leave commented! |
| 505 | #:0c i |
| 506 | #| /home/web-arch/bin/rotate /usr/local/web/webarchive/widget |
| 507 | |
| 508 | # Put the mail in the mailbox, which is used by archiver to re-generate |
| 509 | # the html indexes |
| 510 | :0 cA |
| 511 | /usr/local/web/webarchive/widget/current/mbox |
| 512 | |
| 513 | # The mhonarc call examines mbox, turns the mail messages into .html |
| 514 | # documents, and compiles the indexes. |
| 515 | # -reverse -treverse\ |
| 516 | :0 ia |
| 517 | | /usr/local/mhonarc/bin/mhonarc \ |
| 518 | -idxfname index.shtml \ |
| 519 | -tidxfname threads.shtml \ |
| 520 | -rcfile widget.rc\ |
| 521 | -outdir /usr/local/web/webarchive/widget/current \ |
| 522 | /usr/local/web/webarchive/widget/current/mbox |
| 523 | |
| 524 | } |
| 525 | |
| 526 | I have a directory per archive, and put the current period in directory |
| 527 | "current". Then I have an index page per archive that indexes the |
| 528 | periods, plus gives information about the list and how to |
| 529 | subscribe/unsubscribe. The widget.rc file resides in the pseudouser's |
| 530 | home directory. |
| 531 | |
| 532 | Note the |
| 533 | * ^List-Name: widget |
| 534 | I put the following in the majordomo list's config file: |
| 535 | |
| 536 | message_headers << END |
| 537 | List-Name: widget |
| 538 | END |
| 539 | |
| 540 | This adds the "List-Name" header to messages, which is what procmail |
| 541 | filters for. |
| 542 | |
| 543 | Hope this helps |
| 544 | |
| 545 | Paul McKinley |
| 546 | Unix SysAdmin Contractor |
| 547 | </pre> |
| 548 | </blockquote> |
| 549 | |
| 550 | <!-- ??????????????????????????????????????????????????????????????? --> |
| 551 | <hr noshade size=1> |
| 552 | <table border=0> |
| 553 | <tr valign=top><td><img src="monicon.png" align="bottom" alt=""></td><td> |
| 554 | <h3><b><a name="exclude">Does MHonArc support the "no archive" flag in messages?</a></b></h3> |
| 555 | </td></tr></table> |
| 556 | |
| 557 | <p>Version 2.4, or later, does via the <b>CHECKNOARCHIVE</b> resource. |
| 558 | </p> |
| 559 | |
| 560 | <p>If using an earlier version, or if you are already doing some preprocessing, |
| 561 | you can use a pre-processor like <b>Procmail</b> |
| 562 | to do the filtering. Here is a message sent to the |
| 563 | <a href="mailto:mhonarc-users@mhonarc.org">MHonArc mailing list</a>: |
| 564 | </p> |
| 565 | |
| 566 | <blockquote> |
| 567 | <UL> |
| 568 | <LI><em>Subject</em>: Re: No archive</LI> |
| 569 | <LI><em>From</em>: Christopher Lindsey <<A HREF="mailto:lindsey@ncsa.uiuc.edu">lindsey@ncsa.uiuc.edu</A>></LI> |
| 570 | <LI><em>Date</em>: Thu, 1 Oct 1998 11:33:07 -0500 (CDT)</LI> |
| 571 | </UL> |
| 572 | <pre> |
| 573 | > Subscribers who don't want their messages to be archived |
| 574 | > could add a "no archive" flag within their mail. |
| 575 | |
| 576 | The most common way to do this is by checking for the existence |
| 577 | of an 'X-no-archive: yes' or 'Restrict: no-external-archive' header. |
| 578 | |
| 579 | > As I'm invoking MHonArc through a procmail recipe I guess |
| 580 | > it's possible to do this within the recipe. |
| 581 | |
| 582 | Very easy: |
| 583 | |
| 584 | # If people don't want to be archived, then remove their |
| 585 | # message |
| 586 | :0 |
| 587 | * ^(X-no-archive: yes|Restrict: no-external-archive) |
| 588 | /dev/null |
| 589 | |
| 590 | Chris |
| 591 | </pre> |
| 592 | </blockquote> |
| 593 | |
| 594 | <!-- ??????????????????????????????????????????????????????????????? --> |
| 595 | <hr noshade size=1> |
| 596 | <table border=0> |
| 597 | <tr valign=top><td><img src="monicon.png" align="bottom" alt=""></td><td> |
| 598 | <h3><b><a name="addsafe">Is it safe to specify <tt>-add</tt> when no archive exists?</a></b></h3> |
| 599 | </td></tr></table> |
| 600 | |
| 601 | <p>Yes. If MHonArc sees no archive exists when perform |
| 602 | an add, it will automatically create the archive. |
| 603 | </p> |
| 604 | |
| 605 | <table border=0 cellpadding=4> |
| 606 | <tr valign=top> |
| 607 | <td><strong><font color="red">WARNING</font></strong></td> |
| 608 | <td><p>If using MHonArc versions 2.4, or earlier, make sure the file |
| 609 | <tt>maillist.html</tt> (or the value |
| 610 | of the IDXFNAME resource) does not exist if no archive exists and |
| 611 | <tt>-add</tt> has been specified. Otherwise, unpredictable output |
| 612 | of the <tt>maillist.html</tt> file may result if <tt>maillist.html</tt> |
| 613 | is not in the proper format. |
| 614 | </p> |
| 615 | </td> |
| 616 | </tr> |
| 617 | </table> |
| 618 | |
| 619 | |
| 620 | <!-- ??????????????????????????????????????????????????????????????? --> |
| 621 | <hr noshade size=1> |
| 622 | <table border=0> |
| 623 | <tr valign=top><td><img src="monicon.png" align="bottom" alt=""></td><td> |
| 624 | <h3><b><a name="jumps">Why are there "jumps" in message numbers?</a></b></h3> |
| 625 | </td></tr></table> |
| 626 | |
| 627 | <p>Big gaps in the message number sequence may occur if you |
| 628 | defined the <strong>MAXSIZE</strong> resource and you have |
| 629 | MHonArc rescanning a mail folder for adding new messages. |
| 630 | The problem occurs when MHonArc |
| 631 | reads in messages that will automatically get deleted due |
| 632 | to MAXSIZE. Ie. Messages subject to automatic deletion are |
| 633 | the oldest ones. If the input contains old messages that will |
| 634 | get deleted at the end of processing, the old messages will |
| 635 | still use up message numbers since messages to be deleted are not |
| 636 | determined until all input is read. Since MHonArc does |
| 637 | not keep information about deleted messages, if the messages are |
| 638 | fed into MHonArc again, the "jumping" will occur |
| 639 | again (and the jump will get larger for each additional update). |
| 640 | </p> |
| 641 | |
| 642 | <p>To avoid the problem, try to pass only new, never processed, |
| 643 | messages to MHonArc instead of having MHonArc |
| 644 | rescanning the same mail folder for new messages. Another |
| 645 | approach is to set either the <strong>EXPIREAGE</strong> or |
| 646 | <strong>EXPIREDATE</strong> resources (available in v2.0 beta 2, |
| 647 | or later). These work as an alternative to MAXSIZE and will help in |
| 648 | preventing message number jumping since expiration of a message is |
| 649 | checked when it is initially read (bypassing the assignment of |
| 650 | a message number). </p> |
| 651 | |
| 652 | <!-- ??????????????????????????????????????????????????????????????? --> |
| 653 | <hr noshade size=1> |
| 654 | <table border=0> |
| 655 | <tr valign=top><td><img src="monicon.png" align="bottom" alt=""></td><td> |
| 656 | <h3><b><a name="dups">Why do some messages get re-added each time MHonArc processes a mail folder?</a></b></h3> |
| 657 | </td></tr></table> |
| 658 | |
| 659 | <p>This condition may occur when you have MHonArc examine the |
| 660 | same folder periodically to add any new message. If there are |
| 661 | messages in the folder without message-ids, then those messages |
| 662 | will be re-added each time MHonArc runs. |
| 663 | </p> |
| 664 | |
| 665 | <p>Why? Well, MHonArc uses message-ids for determining if a |
| 666 | message has been archived, or not. Therefore, if a message-id |
| 667 | is missing for a message, then MHonArc believes it is new. |
| 668 | </p> |
| 669 | |
| 670 | <p>In general, mail has message-ids. They get assigned by |
| 671 | MTAs. However, if messages are generated by a CGI |
| 672 | program, or other non-mail specific software, then the program |
| 673 | in question should create a message-id. Else, you will need |
| 674 | to move already-processed messages into a different area so |
| 675 | MHonArc does not read them again. |
| 676 | </p> |
| 677 | |
| 678 | <table border=0 cellpadding=4> |
| 679 | <tr valign=top> |
| 680 | <td><strong>NOTE</strong></td> |
| 681 | <td><p>In MHonArc v2.4 and later, and if you have |
| 682 | the <b>Digest::MD5</b> module installed, MHonArc will compute |
| 683 | the MD5 digest of message headers without message-ids. This |
| 684 | allows MHonArc to skip the message in subsequent add operations. |
| 685 | </p> |
| 686 | </td> |
| 687 | </tr> |
| 688 | </table> |
| 689 | |
| 690 | <p>A related problem is messages showing up again in the archive |
| 691 | after you deleted them with RMM. MHonArc does not keep track of |
| 692 | delete message-ids. Therefore, if want to make sure that |
| 693 | a message will not appear in the archive after explicitly deleted |
| 694 | via RMM, make sure to remove the message from input source. |
| 695 | </p> |
| 696 | |
| 697 | <!-- ??????????????????????????????????????????????????????????????? --> |
| 698 | <hr noshade size=1> |
| 699 | <table border=0> |
| 700 | <tr valign=top><td><img src="monicon.png" align="bottom" alt=""></td><td> |
| 701 | <h3><b><a name="remove">How do I remove messages from an archive?</a></b></h3> |
| 702 | </td></tr></table> |
| 703 | |
| 704 | <p>Automatic removal can be done via the <strong>EXPIREAGE</strong> or |
| 705 | <strong>EXPIREDATE</strong> resources (available in v2.0 beta 2, |
| 706 | or later) or the <strong>MAXSIZE</strong> resource. |
| 707 | </p> |
| 708 | <p>Explicit message removal can be done with the <strong>RMM</strong> |
| 709 | resource. Please read the RMM resource page for more information |
| 710 | and examples. |
| 711 | </p> |
| 712 | |
| 713 | <!-- ??????????????????????????????????????????????????????????????? --> |
| 714 | <hr noshade size=1> |
| 715 | <table border=0> |
| 716 | <tr valign=top><td><img src="monicon.png" align="bottom" alt=""></td><td> |
| 717 | <h3><b><a name="tombox">Can I convert an archive back to mailbox format?</a></b></h3> |
| 718 | </td></tr></table> |
| 719 | |
| 720 | <p><a href="mailto:anthonyw@albany.net">Anthony W</a> provides a |
| 721 | Perl program called <tt>mhn2mbox</tt> for converting archives back |
| 722 | into mailbox format. To obtain more information and to download |
| 723 | the program, goto |
| 724 | <a href="http://www.albany.net/~anthonyw/mhonarc/" |
| 725 | ><http://www.albany.net/~anthonyw/mhonarc/></a>. |
| 726 | </p> |
| 727 | |
| 728 | <!-- ===================================================================== --> |
| 729 | <hr> |
| 730 | |
| 731 | <!--X-NavButtons-Start--> |
| 732 | <p align=center> |
| 733 | [<a href="usage.html">Prev</a>][<a href="indexpgs.html">Next</a>][<a href="faq.html">TOC</a>][<a href="http://www.mhonarc.org/">Home</a>] |
| 734 | </p> |
| 735 | <!--X-NavButtons-End--> |
| 736 | |
| 737 | <hr> |
| 738 | <address> |
| 739 | $Date: 2002/06/21 22:28:16 $ <br> |
| 740 | <img align="top" src="monicon.png" alt=""> |
| 741 | <a href="http://www.mhonarc.org/" |
| 742 | ><strong>MHonArc</strong></a><br> |
| 743 | Copyright © 1997-2001, <a href="http://www.earlhood.com/" |
| 744 | >Earl Hood</a>, <a href="mailto:mhonarc@mhonarc.org" |
| 745 | >mhonarc@mhonarc.org</a><br> |
| 746 | </address> |
| 747 | |
| 748 | </body> |
| 749 | </html> |