From ad07bc19e892866342e2411f1a9c2d44e8b11c93 Mon Sep 17 00:00:00 2001 From: Earl Hood Date: Fri, 23 May 1997 17:46:27 -0500 Subject: [PATCH] MHonArc 2.0.1: (https://www.mhonarc.org/release/MHonArc/tar/MHonArc2.0.1.tar.gz) Bug Fixes --- ACKNOWLG | 101 +- BUGS | 216 ++ CHANGES | 1419 ++++++--- COPYING | 685 ++--- INSTALL | 59 + Makefile | 29 + README | 197 +- RELNOTES | 210 +- bat/README | 4 +- doc/Makefile | 32 - doc/adding.html | 138 - doc/bugs.html | 659 +++++ doc/contacts.html | 114 +- doc/details.html | 185 -- doc/diagnos.html | 389 +-- doc/glossary.html | 48 - doc/indexpg.html | 422 --- doc/install.html | 381 --- doc/intro.html | 131 +- doc/layout.html | 186 ++ doc/message.html | 510 ---- doc/mhonarc.1 | 3787 ------------------------ doc/mhonarc.html | 214 +- doc/mhonarc.ps | Bin 390942 -> 0 bytes doc/mhonarc.txt | 3779 ----------------------- doc/mime.html | 597 ---- doc/mktxt | 27 - doc/monicon.gif | Bin 0 -> 452 bytes doc/{stamp_t.gif => monstamp_t.gif} | Bin doc/overview.html | 529 ---- doc/qstart.html | 192 -- doc/quickstart.html | 222 ++ doc/rcfile.html | 648 ---- doc/removing.html | 112 - doc/resources.html | 383 +++ doc/resources/add.html | 116 + doc/resources/authorbegin.html | 214 ++ doc/resources/authorend.html | 103 + doc/resources/authsort.html | 102 + doc/resources/botlinks.html | 405 +++ doc/resources/charsetconverters.html | 223 ++ doc/resources/conlen.html | 100 + doc/resources/daybegin.html | 217 ++ doc/resources/dayend.html | 103 + doc/resources/dbfile.html | 105 + doc/resources/decodeheads.html | 103 + doc/resources/definederived.html | 448 +++ doc/resources/definevar.html | 142 + doc/resources/defrcfile.html | 110 + doc/resources/doc.html | 96 + doc/resources/docurl.html | 95 + doc/resources/editidx.html | 94 + doc/resources/excs.html | 139 + doc/resources/expireage.html | 150 + doc/resources/expiredate.html | 147 + doc/resources/fieldorder.html | 123 + doc/resources/fieldsbeg.html | 137 + doc/resources/fieldsend.html | 107 + doc/resources/fieldstyles.html | 131 + doc/resources/fldbeg.html | 103 + doc/resources/fldend.html | 103 + doc/resources/folrefs.html | 107 + doc/resources/footer.html | 120 + doc/resources/force.html | 117 + doc/resources/genidx.html | 101 + doc/resources/gmtdatefmt.html | 209 ++ doc/resources/headbodysep.html | 155 + doc/resources/header.html | 121 + doc/resources/icons.html | 162 + doc/resources/idxfname.html | 99 + doc/resources/idxlabel.html | 109 + doc/resources/idxpgbegin.html | 239 ++ doc/resources/idxpgend.html | 214 ++ doc/resources/idxprefix.html | 113 + doc/resources/idxsize.html | 98 + doc/resources/include.html | 110 + doc/resources/labelbeg.html | 105 + doc/resources/labelend.html | 105 + doc/resources/labelstyles.html | 132 + doc/resources/listbegin.html | 260 ++ doc/resources/listend.html | 216 ++ doc/resources/litemplate.html | 199 ++ doc/resources/localdatefmt.html | 209 ++ doc/resources/lockdelay.html | 102 + doc/resources/locktries.html | 101 + doc/resources/mailto.html | 100 + doc/resources/mailtourl.html | 147 + doc/resources/main.html | 97 + doc/resources/maxsize.html | 108 + doc/resources/mhpattern.html | 111 + doc/resources/mimeargs.html | 129 + doc/resources/mimefilters.html | 609 ++++ doc/resources/modtime.html | 100 + doc/resources/months.html | 112 + doc/resources/monthsabr.html | 112 + doc/resources/msgfoot.html | 380 +++ doc/resources/msggmtdatefmt.html | 200 ++ doc/resources/msghead.html | 380 +++ doc/resources/msglocaldatefmt.html | 201 ++ doc/resources/msgpgbegin.html | 391 +++ doc/resources/msgpgend.html | 384 +++ doc/resources/msgsep.html | 118 + doc/resources/multipg.html | 110 + doc/resources/news.html | 99 + doc/resources/nextbutton.html | 394 +++ doc/resources/nextbuttonia.html | 394 +++ doc/resources/nextlink.html | 409 +++ doc/resources/nextlinkia.html | 387 +++ doc/resources/nextpglink.html | 222 ++ doc/resources/nextpglinkia.html | 222 ++ doc/resources/otherindexes.html | 161 + doc/resources/outdir.html | 96 + doc/resources/perlinc.html | 130 + doc/resources/prevbutton.html | 394 +++ doc/resources/prevbuttonia.html | 394 +++ doc/resources/prevlink.html | 409 +++ doc/resources/prevlinkia.html | 387 +++ doc/resources/prevpglink.html | 222 ++ doc/resources/prevpglinkia.html | 222 ++ doc/resources/quiet.html | 93 + doc/resources/rcfile.html | 372 +++ doc/resources/reverse.html | 112 + doc/resources/rmm.html | 110 + doc/resources/scan.html | 153 + doc/resources/single.html | 111 + doc/resources/sort.html | 101 + doc/resources/subjectbegin.html | 213 ++ doc/resources/subjectend.html | 103 + doc/resources/subjectheader.html | 151 + doc/resources/subsort.html | 100 + doc/resources/tcontbegin.html | 201 ++ doc/resources/tcontend.html | 96 + doc/resources/tfoot.html | 227 ++ doc/resources/thead.html | 255 ++ doc/resources/thread.html | 97 + doc/resources/tidxfname.html | 99 + doc/resources/tidxlabel.html | 103 + doc/resources/tidxpgbegin.html | 234 ++ doc/resources/tidxpgend.html | 208 ++ doc/resources/tidxprefix.html | 114 + doc/resources/timezones.html | 131 + doc/resources/tindentbegin.html | 121 + doc/resources/tindentend.html | 98 + doc/resources/title.html | 107 + doc/resources/tlevels.html | 97 + doc/resources/tliend.html | 190 ++ doc/resources/tlinone.html | 108 + doc/resources/tlinoneend.html | 107 + doc/resources/tlitxt.html | 197 ++ doc/resources/tnextbutton.html | 392 +++ doc/resources/tnextbuttonia.html | 392 +++ doc/resources/tnextlink.html | 403 +++ doc/resources/tnextlinkia.html | 385 +++ doc/resources/tnextpglink.html | 218 ++ doc/resources/tnextpglinkia.html | 218 ++ doc/resources/toplinks.html | 409 +++ doc/resources/tprevbutton.html | 392 +++ doc/resources/tprevbuttonia.html | 392 +++ doc/resources/tprevlink.html | 403 +++ doc/resources/tprevlinkia.html | 385 +++ doc/resources/tprevpglink.html | 218 ++ doc/resources/tprevpglinkia.html | 218 ++ doc/resources/treverse.html | 100 + doc/resources/tsingletxt.html | 194 ++ doc/resources/tsubjectbeg.html | 108 + doc/resources/tsubjectend.html | 94 + doc/resources/tsublistbeg.html | 208 ++ doc/resources/tsublistend.html | 97 + doc/resources/ttitle.html | 107 + doc/resources/ttopbegin.html | 250 ++ doc/resources/ttopend.html | 96 + doc/resources/umask.html | 103 + doc/resources/weekdays.html | 112 + doc/resources/weekdaysabr.html | 113 + doc/thread.html | 225 -- examples/deffilters.rc | 73 - examples/frames.rc | 577 ++++ examples/icons.rc | 5 + examples/mhonarc.rc | 96 - faq/about.html | 72 + faq/archives.html | 480 +++ faq/envs.html | 184 ++ faq/faq.html | 139 + faq/general.html | 188 ++ faq/indexpgs.html | 100 + faq/mime.html | 83 + faq/monicon.gif | Bin 0 -> 452 bytes logo/small_t.gif => faq/monsmall_t.gif | Bin faq/msgpgs.html | 169 ++ faq/threads.html | 90 + faq/usage.html | 180 ++ install.cfg | 126 +- install.me | 286 +- lib/base64.pl | 2 + lib/ewhutil.pl | 129 + lib/iso8859.pl | 1167 ++++++++ lib/mhdb.pl | 253 +- lib/mhdysub.pl | 69 + lib/mhexternal.pl | 439 +-- lib/mhidxrc.pl | 430 +++ lib/mhinit.pl | 411 ++- lib/mhrcfile.pl | 817 +++++ lib/mhrcvars.pl | 548 ++++ lib/mhtime.pl | 294 ++ lib/mhtxt2022.pl | 159 - lib/mhtxthtml.pl | 8 +- lib/mhtxtplain.pl | 304 +- lib/mhtxtsetext.pl | 3 +- lib/mhusage.pl | 136 + lib/mhutil.pl | 927 ++---- lib/osinit.pl | 18 +- lib/qprint.pl | 6 +- lib/readmail.pl | 382 ++- logo/mhonarc_t.gif | Bin 0 -> 6773 bytes logo/monicon.gif | Bin 0 -> 452 bytes logo/{small.gif => monsmall.gif} | Bin logo/monsmall_t.gif | Bin 0 -> 7750 bytes logo/{stamp.gif => monstamp.gif} | Bin logo/{stamp_t.gif => monstamp_t.gif} | Bin mhonarc | 2162 +++++++------- 220 files changed, 38670 insertions(+), 15838 deletions(-) create mode 100644 BUGS create mode 100644 INSTALL create mode 100644 Makefile delete mode 100644 doc/Makefile delete mode 100644 doc/adding.html create mode 100644 doc/bugs.html delete mode 100644 doc/details.html delete mode 100644 doc/glossary.html delete mode 100644 doc/indexpg.html delete mode 100644 doc/install.html create mode 100644 doc/layout.html delete mode 100644 doc/message.html delete mode 100644 doc/mhonarc.1 delete mode 100644 doc/mhonarc.ps delete mode 100644 doc/mhonarc.txt delete mode 100644 doc/mime.html delete mode 100755 doc/mktxt create mode 100644 doc/monicon.gif rename doc/{stamp_t.gif => monstamp_t.gif} (100%) delete mode 100644 doc/overview.html delete mode 100644 doc/qstart.html create mode 100644 doc/quickstart.html delete mode 100644 doc/rcfile.html delete mode 100644 doc/removing.html create mode 100644 doc/resources.html create mode 100644 doc/resources/add.html create mode 100644 doc/resources/authorbegin.html create mode 100644 doc/resources/authorend.html create mode 100644 doc/resources/authsort.html create mode 100644 doc/resources/botlinks.html create mode 100644 doc/resources/charsetconverters.html create mode 100644 doc/resources/conlen.html create mode 100644 doc/resources/daybegin.html create mode 100644 doc/resources/dayend.html create mode 100644 doc/resources/dbfile.html create mode 100644 doc/resources/decodeheads.html create mode 100644 doc/resources/definederived.html create mode 100644 doc/resources/definevar.html create mode 100644 doc/resources/defrcfile.html create mode 100644 doc/resources/doc.html create mode 100644 doc/resources/docurl.html create mode 100644 doc/resources/editidx.html create mode 100644 doc/resources/excs.html create mode 100644 doc/resources/expireage.html create mode 100644 doc/resources/expiredate.html create mode 100644 doc/resources/fieldorder.html create mode 100644 doc/resources/fieldsbeg.html create mode 100644 doc/resources/fieldsend.html create mode 100644 doc/resources/fieldstyles.html create mode 100644 doc/resources/fldbeg.html create mode 100644 doc/resources/fldend.html create mode 100644 doc/resources/folrefs.html create mode 100644 doc/resources/footer.html create mode 100644 doc/resources/force.html create mode 100644 doc/resources/genidx.html create mode 100644 doc/resources/gmtdatefmt.html create mode 100644 doc/resources/headbodysep.html create mode 100644 doc/resources/header.html create mode 100644 doc/resources/icons.html create mode 100644 doc/resources/idxfname.html create mode 100644 doc/resources/idxlabel.html create mode 100644 doc/resources/idxpgbegin.html create mode 100644 doc/resources/idxpgend.html create mode 100644 doc/resources/idxprefix.html create mode 100644 doc/resources/idxsize.html create mode 100644 doc/resources/include.html create mode 100644 doc/resources/labelbeg.html create mode 100644 doc/resources/labelend.html create mode 100644 doc/resources/labelstyles.html create mode 100644 doc/resources/listbegin.html create mode 100644 doc/resources/listend.html create mode 100644 doc/resources/litemplate.html create mode 100644 doc/resources/localdatefmt.html create mode 100644 doc/resources/lockdelay.html create mode 100644 doc/resources/locktries.html create mode 100644 doc/resources/mailto.html create mode 100644 doc/resources/mailtourl.html create mode 100644 doc/resources/main.html create mode 100644 doc/resources/maxsize.html create mode 100644 doc/resources/mhpattern.html create mode 100644 doc/resources/mimeargs.html create mode 100644 doc/resources/mimefilters.html create mode 100644 doc/resources/modtime.html create mode 100644 doc/resources/months.html create mode 100644 doc/resources/monthsabr.html create mode 100644 doc/resources/msgfoot.html create mode 100644 doc/resources/msggmtdatefmt.html create mode 100644 doc/resources/msghead.html create mode 100644 doc/resources/msglocaldatefmt.html create mode 100644 doc/resources/msgpgbegin.html create mode 100644 doc/resources/msgpgend.html create mode 100644 doc/resources/msgsep.html create mode 100644 doc/resources/multipg.html create mode 100644 doc/resources/news.html create mode 100644 doc/resources/nextbutton.html create mode 100644 doc/resources/nextbuttonia.html create mode 100644 doc/resources/nextlink.html create mode 100644 doc/resources/nextlinkia.html create mode 100644 doc/resources/nextpglink.html create mode 100644 doc/resources/nextpglinkia.html create mode 100644 doc/resources/otherindexes.html create mode 100644 doc/resources/outdir.html create mode 100644 doc/resources/perlinc.html create mode 100644 doc/resources/prevbutton.html create mode 100644 doc/resources/prevbuttonia.html create mode 100644 doc/resources/prevlink.html create mode 100644 doc/resources/prevlinkia.html create mode 100644 doc/resources/prevpglink.html create mode 100644 doc/resources/prevpglinkia.html create mode 100644 doc/resources/quiet.html create mode 100644 doc/resources/rcfile.html create mode 100644 doc/resources/reverse.html create mode 100644 doc/resources/rmm.html create mode 100644 doc/resources/scan.html create mode 100644 doc/resources/single.html create mode 100644 doc/resources/sort.html create mode 100644 doc/resources/subjectbegin.html create mode 100644 doc/resources/subjectend.html create mode 100644 doc/resources/subjectheader.html create mode 100644 doc/resources/subsort.html create mode 100644 doc/resources/tcontbegin.html create mode 100644 doc/resources/tcontend.html create mode 100644 doc/resources/tfoot.html create mode 100644 doc/resources/thead.html create mode 100644 doc/resources/thread.html create mode 100644 doc/resources/tidxfname.html create mode 100644 doc/resources/tidxlabel.html create mode 100644 doc/resources/tidxpgbegin.html create mode 100644 doc/resources/tidxpgend.html create mode 100644 doc/resources/tidxprefix.html create mode 100644 doc/resources/timezones.html create mode 100644 doc/resources/tindentbegin.html create mode 100644 doc/resources/tindentend.html create mode 100644 doc/resources/title.html create mode 100644 doc/resources/tlevels.html create mode 100644 doc/resources/tliend.html create mode 100644 doc/resources/tlinone.html create mode 100644 doc/resources/tlinoneend.html create mode 100644 doc/resources/tlitxt.html create mode 100644 doc/resources/tnextbutton.html create mode 100644 doc/resources/tnextbuttonia.html create mode 100644 doc/resources/tnextlink.html create mode 100644 doc/resources/tnextlinkia.html create mode 100644 doc/resources/tnextpglink.html create mode 100644 doc/resources/tnextpglinkia.html create mode 100644 doc/resources/toplinks.html create mode 100644 doc/resources/tprevbutton.html create mode 100644 doc/resources/tprevbuttonia.html create mode 100644 doc/resources/tprevlink.html create mode 100644 doc/resources/tprevlinkia.html create mode 100644 doc/resources/tprevpglink.html create mode 100644 doc/resources/tprevpglinkia.html create mode 100644 doc/resources/treverse.html create mode 100644 doc/resources/tsingletxt.html create mode 100644 doc/resources/tsubjectbeg.html create mode 100644 doc/resources/tsubjectend.html create mode 100644 doc/resources/tsublistbeg.html create mode 100644 doc/resources/tsublistend.html create mode 100644 doc/resources/ttitle.html create mode 100644 doc/resources/ttopbegin.html create mode 100644 doc/resources/ttopend.html create mode 100644 doc/resources/umask.html create mode 100644 doc/resources/weekdays.html create mode 100644 doc/resources/weekdaysabr.html delete mode 100644 doc/thread.html delete mode 100644 examples/deffilters.rc create mode 100644 examples/frames.rc delete mode 100644 examples/mhonarc.rc create mode 100644 faq/about.html create mode 100644 faq/archives.html create mode 100644 faq/envs.html create mode 100644 faq/faq.html create mode 100644 faq/general.html create mode 100644 faq/indexpgs.html create mode 100644 faq/mime.html create mode 100644 faq/monicon.gif rename logo/small_t.gif => faq/monsmall_t.gif (100%) create mode 100644 faq/msgpgs.html create mode 100644 faq/threads.html create mode 100644 faq/usage.html create mode 100644 lib/ewhutil.pl create mode 100644 lib/iso8859.pl create mode 100644 lib/mhdysub.pl create mode 100644 lib/mhidxrc.pl create mode 100644 lib/mhrcfile.pl create mode 100644 lib/mhrcvars.pl create mode 100644 lib/mhtime.pl delete mode 100644 lib/mhtxt2022.pl create mode 100644 lib/mhusage.pl create mode 100644 logo/mhonarc_t.gif create mode 100644 logo/monicon.gif rename logo/{small.gif => monsmall.gif} (100%) create mode 100644 logo/monsmall_t.gif rename logo/{stamp.gif => monstamp.gif} (100%) rename logo/{stamp_t.gif => monstamp_t.gif} (100%) diff --git a/ACKNOWLG b/ACKNOWLG index f21eaf0..b3ffc2b 100644 --- a/ACKNOWLG +++ b/ACKNOWLG @@ -1,46 +1,55 @@ -ACKNOWLEDGEMENTS for MHonArc - - - -I would like to thank everyone who has given feedback on MHonArc. -Sorry for not listing everyone, but it has become too hard to keep -track of all the names. However, I'd like to give special thanks to -the following: - - A. P. Barrett - For developing a base64 library. The library has been adapted - to decode base64 messages by MHonArc. - - Susie Blackstock - For helping me with the documentation. Any problems with the - documentation is purely my fault. - - Achim Bohnet - For his help in testing, and contributing to, mhonarc and for - setting up the mhonarc mailing list. - - Roman Czyborra - For his help with the MosaicMail script. - - Timothy Finin - Whose initial feedback on mbox2html (my first mail->HTML - program) caused the ball rolling on developing a more complete - mail-to-HTML program. - - Ken Harward - For helping me tackle Perl problems and for bouncing ideas - off. - - Phyllis Imperatrice - For the initial sketch of the MHonArc logo. - - Steve Pacenka - For his great help in getting MHonArc to run under MS-DOS, and - for his help in trouble-shooting. - - NIIBE Yutaka - For the contribution of a text/plain filter to process - ISO-2022 encoded mail messages (ie. Japanese character set). - ---------------------------------------------------------------------------- -Earl Hood, ehood@isogen.com +ACKNOWLEDGEMENTS for MHonArc + + http://www.oac.uci.edu/indiv/ehood/mhonarc.html + +I would like to thank everyone who has given feedback on MHonArc. +Sorry for not listing everyone, but it has become too hard to keep +track of all the names. However, I'd like to give special thanks to +the following: + + A. P. Barrett + For developing a base64 library. The library has been adapted + to decode base64 messages by MHonArc. + + Susie Blackstock + For helping me with the documentation. Any problems with the + documentation is purely my fault. And she's cute too. + + Achim Bohnet + For his help in testing, and contributing to, mhonarc and for + setting up, and maintaining, the mhonarc mailing list. + + Roman Czyborra + For his help with the MosaicMail script. + + Timothy Finin + Whose initial feedback on mbox2html (my first mail->HTML + program) caused the ball rolling on developing a more complete + mail-to-HTML program. + + Stephen Franlin + For providing the machine facilities for housing the MHonArc + home page. + + Ken Harward + For helping me tackle Perl problems and for bouncing ideas + off. + + Phyllis Imperatrice + For the initial sketch of the MHonArc logo. + + Steve Pacenka + For his great help in getting MHonArc to run under MS-DOS, and + for his help in trouble-shooting. + + Achille Petrilli + For his initial patches for MacPerl support to get the + ball rolling for MacPerl usage. + + NIIBE Yutaka + For the contribution of a text/plain filter to process + ISO-2022 encoded mail messages (ie. Japanese character set). + +--------------------------------------------------------------------------- +Earl Hood, ehood@medusa.acs.uci.edu +@(#) ACKNOWLG 97/05/14 19:06:19 @(#) diff --git a/BUGS b/BUGS new file mode 100644 index 0000000..8311291 --- /dev/null +++ b/BUGS @@ -0,0 +1,216 @@ + BUGS 97/05/22 18:54:46 + Bug History for MHonArc + +Each bug listing has the following fields: + + Version: Lists the version of MHonArc that the bug was + reported against. + Problem: A description of the bug. + Solution: A description of what was done to fix the bug. + Version Fixed: The version that the solution exists in, if + applicable. + + +Bug List +------------------------------------------------------------------------ +Version: 2.0.0 +Problem: Bogus empty entry shows up in the database. Bogus + entry appears if a duplicate message is detected. + Potential visible problems of bogus entry are: mailto + links in headers corrupted; a blank listing in the + index. Maybe other potential problems. +Solution: There is a be a bug in some versions of Perl where a + hash key gets added invalidly. The section of code that + this occurs has been modified to avoid the problem. + For existing databases with a bogus empty entry, + MHonArc now removes any empty key entries. + However, it is recommed to rebuild the archive. +Version Fixed: 2.0.1 +------------------------------------------------------------------------ +Version: 2.0.0 +Problem: Index pages are not properly updated if zero messages + are in the archive (like through the -rmm option). + Even -editidx cannot cause a proper update. +Solution: Page count was set to zero when no messages exist. This + caused problems in conditional checks in the write index + routines. To fix, page count is forced to 1 if their + are no messages. +Version Fixed: 2.0.1 +------------------------------------------------------------------------ +Version: 2.0.0 beta 3 +Problem: Index pages with last page links are not updated + when a new page is added. +Solution: All index pages are regenerated if a new page + is added. +Version Fixed: 2.0.0 +------------------------------------------------------------------------ +Version: 2.0.0 beta 3 +Problem: "-idxsize 0" does not give unlimited page size. +Solution: Problem fixed and now works as documented. +Version Fixed: 2.0.0 +------------------------------------------------------------------------ +Version: 2.0.0 beta 3 +Problem: "-maxsize 0" does not reset archive with + unlimited messages allowed. +Solution: Problem fixed and now works as documented. +Version Fixed: 2.0.0 +------------------------------------------------------------------------ +Version: 2.0.0 beta 3 +Problem: Non-ASCII text encodings (=?ISO-..?...) are not + properly decoded when EDITIDX is set. +Solution: The charset filter libraries are now loaded + for EDITIDX. +Version Fixed: 2.0.0 +------------------------------------------------------------------------ +Version: 2.0.0 beta 3 +Problem: MODTIME resource setting not remembered across + archive updates. +Solution: MODTIME resource is now properly stored in the + database. +Version Fixed: 2.0.0 +------------------------------------------------------------------------ +Version: 2.0.0 beta 3 +Problem: Specifying -rmm and -single caused confusion on + what MHonArc does. +Solution: The case is properly handled, with -rmm taking + precedence. +Version Fixed: 2.0.0 +------------------------------------------------------------------------ +Version: 2.0.0 beta 3 +Problem: 4 digit year not checked before 2 digit year + when parsing dates. +Solution: Fixed. +Version Fixed: 2.0.0 +------------------------------------------------------------------------ +Version: 2.0.0 beta 3 +Problem: Some index pages in multipage indexes not + updated when messages expire. +Solution: Fixed; all pages are regenerated when a message + expires. +Version Fixed: 2.0.0 +------------------------------------------------------------------------ +Version: 2.0.0 beta 3 +Problem: Setting MONTHS and MONTHSABR had no effect. +Solution: Fixed. +Version Fixed: 2.0.0 +------------------------------------------------------------------------ +Version: 2.0.0 beta 3 +Problem: $TNEXTFROM$ actually gave the value of $NEXTFROM$. +Solution: Fixed. +Version Fixed: 2.0.0 +------------------------------------------------------------------------ +Version: 2.0.0 beta 3 +Problem: Numerical timezone offsets not handled properly + when the offset contained non-zero minutes. This + caused message to be sorted wrong by date. +Solution: Fixed. +Version Fixed: 2.0.0 +------------------------------------------------------------------------ +Version: 2.0.0 beta 3 +Problem: Some characters were not properly escaped when + specifying the "in URL" modifier to a resource + variable. +Solution: Fixed. +Version Fixed: 2.0.0 +------------------------------------------------------------------------ +Version: 2.0.0 beta 3 +Problem: Thread (formatting) information lost when a + thread is split across multiple pages. +Solution: Fixed. New resources (TCONTBEGIN, TCONTEND, + TINDENTBEGIN, TINDENTEND) exist to preserve + formatting of threads across pages. +Version Fixed: 2.0.0 +------------------------------------------------------------------------ +Version: 2.0.0 beta 3 +Problem: If specifying the REVERSE resource, the next/prev + links in messages do not point to the proper + message as one may expect. +Solution: This should be fixed by the new behavior of + $NEXT...$ and $PREV...$ resource variables. +Version Fixed: 2.0.0 +------------------------------------------------------------------------ +Version: 2.0.0 beta 2 +Problem: Perl aborts with message "Undefined subroutine + &main::output_db called ..." when the GENIDX resource + is set. +Solution: Fixed. The output_db function is not applicable when + GENIDX is active. +Version Fixed: 2.0.0 beta 3 +------------------------------------------------------------------------ +Version: 2.0.0 beta 2 +Problem: Duplicate resource filenames are not removed from the + OTHERINDEXES resource. This caused duplicate work + to be performed. +Solution: Fixed. Any duplicate filenames are removed before + applying the OTHERINDEXES resource. +Version Fixed: 2.0.0 beta 3 +------------------------------------------------------------------------ +Version: 2.0.0 beta 2 +Problem: Indexes created via the OTHERINDEXES resource contain + no messages. +Solution: Fixed. +Version Fixed: 2.0.0 beta 3 +------------------------------------------------------------------------ +Version: 2.0.0 beta 2 +Problem: The markup defined by TSUBLISTEND may appear when there + is no corresponding TSUBLISTBEG. +Solution: Fixed. +Version Fixed: 2.0.0 beta 3 +------------------------------------------------------------------------ +Version: 2.0.0 beta 1 +Problem: A multipart boundary specified with a capital boundary + parameter, and not in quotes, was not recognized. +Solution: Fixed +Version Fixed: 2.0.0 beta 2 +------------------------------------------------------------------------ +Version: 1.2.3 +Problem: Generation of links of message-ids when editting + messages w/o consideration that the message-ids + may already be linked. This caused nested anchor + markup. +Solution: Fixed. Only new message-ids are checked for. +Version Fixed: 2.0.0 beta 1 +------------------------------------------------------------------------ +Version: 1.2.2 +Problem: The ';' character may appear in derived files if the + "usename" option is set for the mhexternal.pl filter. +Solution: Fixed. +Version Fixed: 1.2.3 +------------------------------------------------------------------------ +Version: 1.2.2 +Problem: The '/' character is not properly recognized in e-mail + addresses when e-mail addressess are being converted + to mailto links in message headers. +Solution: Fixed. +Version Fixed: 1.2.3 +------------------------------------------------------------------------ +Version: 1.2.2 +Problem: Database read failures occur in add operations on + MS-DOS systems. +Solution: Fixed (?) +Version Fixed: 1.2.3 +------------------------------------------------------------------------ +Version: 1.2.1 +Problem: The TIDXPGEND resource actually sets the value of the + TIDXPGBEG resource. +Solution: Fixed. +Version Fixed: 1.2.2 +------------------------------------------------------------------------ +Version: 1.2.0 +Problem: MHonArc will abort execution under MS-DOS due to + regular expression error. +Solution: Fixed. +Version Fixed: 1.2.1 +------------------------------------------------------------------------ +Version: 1.2.0 +Problem: install.me will abort execution under MS-DOS due to + regular expression error. +Solution: Fixed. +Version Fixed: 1.2.1 +------------------------------------------------------------------------ +Version: 1.2.0 +Problem: A reverse index listing is incorrect if the index size + is less than the archive size. +Solution: Fixed. +Version Fixed: 1.2.1 +------------------------------------------------------------------------ diff --git a/CHANGES b/CHANGES index 417e31a..f7b26c1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,477 +1,942 @@ -CHANGES for MHonArc - - - -Revision history for MHonArc. Changes listed are brief. Consult -the documentation for further information/clarification. - -MM/DD/YY -======================================================================= -####################################################################### -======================================================================= -07/12/96 (1.2.3) - - o Extracted initialization of data structures into mhinit.pl. - The file is just required from the main source. - - o Use q{} instead of qq{} when trying to read database file. - Should fix require problem under MS-DOS. - - o Added comments at beginning - of messages. May aid in database recovery techniques. - - o ';'s are now deleted in filenames in mhexternal.pl - (applicable only when "usename" option specified) - - o Added recognition of '/' when converted e-mail addresses - to mailto links in message headers. - - o Simple fix to mhtxt2022.pl for execution under Perl 5. - -======================================================================= -####################################################################### -======================================================================= -04/18/96 (1.2.2) - - o Increased the speed performance of base64 decoding. Speed - increase is much greater under Perl 4 than Perl 5. - - o Added -time option to print out total CPU execution time. - Mainly used for debugging reasons (like checking on - base64 decoding times). Time information is sent to - standard error. - - o Added M2H_LOCKDELAY envariable and -lockdelay option. - Either can be used to adjust the sleep time between - attempts to lock the archive. - - o Added -force option to override a lock on an archive if - attempts to lock fail. - - o Added image/x-bmp and image/x-pcx to the default supported - MIME types. - - o Ignore "Sv:" at the beginning of subjects when sorting by - subject. "Sv:" is Danish for "Re:". - - o Fixed bug in mhutil.pl where TIDXPGEND actually set - TIDXPGBEG. - - o Dynamically define exclude_field routine after reading - user options. exclude_field is utilized when formatting - a message header in HTML. Defining the routine at run-time - helps reduce the regular expression overhead the old version - of the routine entailed. There should be an increase in - overall execution time. - -======================================================================= -03/22/96 (1.2.1) - - o Added support for x-uuencode content-transfer-encoding. - - o Added -locktries command-line option. - - o Added the resource variable $OUTDIR$. - - o mhexternal.pl filter will use the name parameter string - on the content-type field as the anchor text to the file - if there is no content-description. - - o application/x-patch is recognized and processed by the - text/plain filter (mhtxtplain.pl). - - o Fixed bug in install.me and osinit.pl where setting - $'PROG caused perl to terminate if $'DIRSEP was a backslash - (occured under MS-DOS usage). - - o Fixed bug in install.me in the create_dir routine. - If $DIRSEP was a backslash, the regular expression setting - @a would cause perl to abort with an error. - - o Fixed database bug where the MIMEARGS resource setting - was not being stored. - - o Fixed index listing bug where a reverse listing was not - correct if an index size was specified less than the - current size of the archive. - -======================================================================= -03/01/96 (1.2.0) - - o Rewrote message parser routine so it will work under Perl 5 - for multipart messages. The rewrite also allows some - additional features that are mentioned below. - - o The -mbox and -mh options are no longer required. MHonArc - will automatically determine which mode to operate in - based upon the file arguments. Hence, one can specify - MH folders and mailbox files on the same command-line. - Both options are ignored if specified. - - o An HTML index of an archive contents can be generated to - standard output (-genidx). - - o Message header lines not conforming to RFC 822 are ignored. - (Eg: Those pesky "From " lines should not show up anymore -- - please do not confuse this with the regular "From:" lines; - note the colon vs the space). - - o New resources: - - BOTLINKS - May be used to completely customize - the links at the bottom of messages. - IDXPGBEGIN - Opening markup for main index page. - Allows one to redefine opening HTML - element, HEAD element, TITLE element, - opening BODY element, etc. - IDXPGEND - Closing markup for main index page. - IDXSIZE - Set the maximum number of messages - listed in index. This is different - in MAXSIZE where MAXSIZE will remove - older messages when the MAXSIZE limit - is reached in the archive. - MIMEARGS - Define arguments to filters - MSGPGBEGIN - Opening markup for message pages. - Allows one to redefine opening HTML - element, HEAD element, TITLE element, - opening BODY element, etc. - MSGPGEND - Closing markup for message pages. - NEXTBUTTON - Defines the 'Next' button. - NEXTBUTTONIA - Defines the 'Next' button when it is - inactive. - NEXTLINK - Defines the 'Next' link. - NEXTLINKIA - Defines the 'Next' link when it is - inactive. - NOTSUBSORT - Do not sort threads by subject. - OTHERINDEXES - List other resource files defining - other indexes to create when creating, - or updating, an archive. - PREVBUTTON - Defines the 'Prev' button. - PREVBUTTONIA - Defines the 'Prev' button when it is - inactive. - PREVLINK - Defines the 'Prev' link. - PREVLINKIA - Defines the 'Prev' link when it is - inactive. - TIDXPGBEGIN - Opening markup for thread index page. - Allows one to redefine opening HTML - element, HEAD element, TITLE element, - opening BODY element, etc. - TIDXPGEND - Closing markup for thread index page. - TOPLINKS - May be used to completely customize - the buttons at the top of messages. - TSUBSORT - Sort threads listed by subject. - - o Removed resources: - - INDEXBL, INDEXFL, MBOX, MH, NEXTBL, NEXTFL, PREVBL, - PREVFL, TINDEXBL, TINDEXFL - - Resource were removed because they were no longer applicable - and/or have been superceded by other resources. MHonArc - will still honor old resource settings (where applicable) of - older archives and incorporate them into the new resource - settings. - - o When specifying the resource file, mhonarc will now do - the following to determine its location: - - 1. If its an absolute pathname, mhonarc uses it. - 2. If it is a relative pathname, mhonarc checks for - it relative to the current working directory. - 3. Otherwise, mhonarc checks for it relative to - location of the archive as specified by outdir. - - This resolution will allow you to place resource files with - the archive if desired (can be useful when using the - OTHERINDEXES resource element). - - o Because of the new resources available, many
's are no - longer hard-coded and are controllable by resources.
's - are still used in message pages to separate message data - from mhonarc data. - - o Added resource variables: - (NOTE: Some variables are only valid in certain contexts) - - $DDMMYY$ - Date of message in dd/mm/yy format - $IDXSIZE$ - Max size of index list - $MMDDYY$ - Date of message in mm/dd/yy format - $MSGID$ - Message id - $NEXTBUTTON$ - Next button markup - $NEXTFROM$ - From field of next listed message - $NEXTFROMADDR$ - From e-mail address of next listed message - $NEXTFROMNAME$ - From name of next listed message - $NEXTLINK$ - Next link markup - $NEXTMSGNUM$ - Number of next listed message - $NEXTSUBJECT$ - Subject text of next listed message - $NUMOFIDXMSG$ - Number of messages in index list - $PREVBUTTON$ - Previous button markup - $PREVFROM$ - From field of previous listed message - $PREVFROMADDR$ - From e-mail address of prev listed message - $PREVFROMNAME$ - From name of previous listed message - $PREVLINK$ - Previous link markup - $PREVMSGNUM$ - Number of previous message - $PREVSUBJECT$ - Subject text of previous listed message - $YYMMDD$ - Date of message in yy/mm/dd format - - o Can specify a 'U' with variable length specifier to denote - replacement string is to be used in a URL. Examples: - - $SUBJECTNA:40U$ - $MSGID:U$ - - The 'U' causes the replace text to have special characters - escaped as denoted by the URL spec. NOTE: Specify ":U" - should NOT be used in the MAILTOURL resource; the variables - will automatically be expanded according to the URL spec. - Specifyind ":U" or a length specifier in the MAILTOURL - resource will prevent mhonarc from detecting the variable. - - o New command-line options: - - -genidx - Generate HTML index of archive contents - to stdout. - -idxsize - Maximum number of messages shown in indexes - -notsubsort - Do not sort threads listed by subject. - -savemem - Write message data while processing - -tsubsort - Sort threads listed by subject. - - o The library mhtxt2022.pl has been added that provides - a filter to process ISO-2022 (Japanese) encoded mail messages. - See mhtxt2022.pl on how to hook it in. - - o The mhexternal.pl filter by default ignores any filename - specification in the message for creating derived files. - This avoids name conflicts and security problems. - The "usename" filter option may be used to override this. - - o Mime filters are now called with two additional arguments: - - $converted_data = &function( - $header, *parsed_header_assoc_array, - *message_data, $decoded_flag, - $optional_filter_arguments); - - The $decoded_flag is set to 1 if the *message_data has been - decoded. $optional_filter_arguments contains an optional - argument string as determined by the filter. - - o Mime filters can now be registered for multipart types - and message types. This allows one to override mhonarc's - conversion of these types, and completely replace mhonarc's - message->HTML conversion process. - - o Mime filters should now use $'FieldSep instead of $'X for - accessing parsed message headers. - - o Mime filters can be registered for a base type. Ie. - It is no longer required to explicitly list each possible - subtype if a single filter is to be used for them all. - Example: - - - image/*:myfilter'imagefilter:myfilter.pl - - - Registers "myfilter'filter" for all image data types, - regardless of subtype. However, if an explicit entry - exists for a subtype, then that filter is called. - Example: - - - image/*:myfilter'imagefilter:myfilter.pl - image/gif:myfilter'giffilter:myfilter.pl - - - "myfilter'giffilter" is called for all image/gif data. - "myfilter'imagefilter" is called for all other image data. - - o A new resource, MIMEARGS, may be used to pass optional arguments - to filters to control their behavior. The format of the - argument string is controlled by the various filters. The - arguments can be specified by a specific content-type, or - for the filter routine in general. A content-type argument - will be used over any arguments specified for a filter. - - Example usage: - - - image/gif:inline usename - m2h_external'filter:usename - - - See the documentation for possible arguments to filters. - - o Installation program can now be invoked in batch mode. - - o Thread index properly includes docurl as main index. - -nodocurl will prevent the inclusion as with the main index. - - o Fixed bug in mhtxthtml.pl on properly propogating a base - URL to relative URLs starting with a "/". - - o Fixed bug where single quotes, and backslashed in keys of - associative arrays in the database file were not getting - escaped. - - o Fixed bug where spaces and special characters were not - properly escaped in URL strings: spaces were left as-is, - and special characters were deleted. - - o Removed illegal invocation choices in the Synopsis of the - documentation. - -======================================================================= -04/24/95 (1.1.1) - - o Fixed bug in -scan output where month in date was off by - one. - -======================================================================= -04/21/95 (1.1.0) - - o Made modifications to make MHonArc suitable to run - under MS-DOS without modification. MHonArc will - automatically detect if it is running under Unix or MS-DOS. - - o Added support for a thread index. MHonArc will create a - complimentary index to the main index showing message - threads. - - o Archive messages can be deleted. - - o A listing to stdout of an archives contents can be - generated. - - o Maximum number of messages for an archive can be set. - Older messages (based on sort method) are removed - automatically during add operations. - - o MHonArc will now recognize if you try to add in a message - that already exists in an archive. - - o The -editdx option will now also cause a updating of all - mail messages. Guarantees resource changes to affect all - messages. - - o Added the following resource file elements: - - MSGFOOT -- Footer text for converted messages - MSGHEAD -- Header text for converted messages - NODOC -- Do not put link to documentation - NOTHREAD -- Do not create thread index - TFOOT -- Text at bottom of thread index page - THEAD -- Text at top of thread index page - THREAD -- Create thread index - TLEVELS -- Depth of thread listing - TLITXT -- Template text for entry in thread - index - TIDXFNAME -- Thread index filename - TINDEXBL -- Top button label in messages to - thread index - TINDEXFL -- Verbose label in message to thread - index - TTITLE -- Title of thread index page - - o Added the following command-line options: - - -maxsize -- Maxinum # messages in an archive - -nodoc -- Do not put link to documentation - -nothread -- Do not create thread index - -rmm -- Remove messages from an archive - -scan -- Listing of archive to stdout - -thread -- Create thread index - -tidxfname -- Thread index filename - -tlevels -- Depth of thread listing - -ttitle -- Title of thread index page - - o Added the following environment variables: - - M2H_MAXSIZE -- Maxinum # messages in an archive - M2H_THREAD -- If non-zero, create thread index - M2H_TIDXFNAME -- Thread index filename - M2H_TLEVELS -- Depth of thread listing - M2H_TTITLE -- Title of thread index page - - o Added the following variables for template resources - (applicability of variables vary depending on the resource): - - $DOCURL$ -- URL to documentation - $IDXFNAME$ -- Main index page filename - $IDXTITLE$ -- Main index page title - $NEXTMSG$ -- Next message filename - $PREVMSG$ -- Previous message filename - $PROG$ -- Program name - $TIDXFNAME$ -- Thread index page filename - $TIDXTITLE$ -- Thread index page title - $VERSION$ -- Version number of the program - - o Added $FROM$, $MSGID$, and $SUBJECT$ variables to be used - in the MAILTOURL resource. - - o The string `$$' in template resources will produce a `$' in - the output. - - o Fixed problem with messages (with follow-ups) getting - unnecessarily updated when messages are added to an archive. - - o Only a CR/LF, or LF, pair will terminate a message head. - Before, MHonArc was terminating message heads when - encountering an empty line or a line that only contained - whitespace (which was incorrect behavior). - - o Fixed bug in mhexternal.pl dealing with the `name' parameter - in the content-type field. Surrounding "s or 's were not - being deleted causing filenames with quotes to be written. - - o mhexternal.pl: The head of a pathname in the `name' - parameter in the content-type field is stripped off before - writing the external file. I.e. Only the base filename is - used. - - o Only one
after the H1 subject in messages will appear - if no message header fields are printed. - - o Added recognition of the following content-types in - mhexternal.pl: - - application/mac-binhex40 - - o Added a extras/ directory containing useful programs for - MHonArc. See README in the directory for information on - the programs contained in there. - - o To support -rmm, MIME filters now return an array. The - first array value is the HTML for the message, and any other - array values are filenames of files generated by the - filter. This allows MHonArc to know of any extra files that - must be deleted when a message is removed. - - o Some routines from the main mhonarc source file have been - moved into a separate librarys: readmail.pl, mhdb.pl, - mhutil.pl - - o The default URL to the documentation is now, - - http://www.oac.uci.edu/indiv/ehood/mhonarc.html - - The old URL, - - http://www.oac.uci.edu/indiv/ehood/mhonarc.doc.html - - is still valid. - - o There's probably other stuff, but I cannot remember. - - -======================================================================= -10/01/94 (1.0.0) - - o First release -- See RELNOTES about compatibility issues - with mail2html. - - -======================================================================= -####################################################################### -======================================================================= -Earl Hood, ehood@isogen.com +CHANGES for MHonArc + + http://www.oac.uci.edu/indiv/ehood/mhonarc.html + +Revision history for MHonArc. Changes listed are brief. Consult +the documentation for further information/clarification. It is +possible that not all changes are documented here. + +MM/DD/YY +======================================================================= +####################################################################### +======================================================================= +05/23/97 (2.0.1) + + Bug Fixes + --------- + + Problem: Bogus empty entry shows up in the database. Bogus + entry appears if a duplicate message is detected. + Potential visible problems of bogus entry are: mailto + links in headers corrupted; a blank listing in the + index. Maybe other potential problems. + Solution: There is a be a bug in some versions of Perl where a + hash key gets added invalidly. The section of code that + this occurs has been modified to avoid the problem. + For existing databases with a bogus empty entry, + MHonArc now removes any empty key entries. + However, it is recommed to rebuild the archive. + + Problem: Index pages are not properly updated if zero messages + are in the archive (like through the -rmm option). + Even -editidx cannot cause a proper update. + Solution: Page count was set to zero when no messages exist. This + caused problems in conditional checks in the write index + routines. To fix, page count is forced to 1 if their + are no messages. + +======================================================================= +05/16/97 (2.0.0) + + Enhancements: + + o Added TCONTBEGIN, TCONTEND, TINDENTBEGIN, TINDENTEND + resources. They are provided to support the formatting + of threads that split across multiple pages of a + multipage index. + + o Added "nonfixed", "maxwidth", and "keepspace" options + to text/plain (mhtxtplain.pl) filter. + + o A directory file is now used for performing archive + locking. This should provide better portability across + operating systems. + + o Dervied files returned from filters can be directories. + If so, the any directory is completely removed if the + message is removed. + + o The mhexternal.pl filter can now output files into + a subdirectory with the "subdir" option. This may be + useful for those wanting to use the "usename" option + and avoid potential filename conflicts. + + o The $NEXT...$ and $PREV...$ resource variables now + behave as one may expect. I.e. The are always relative + to the base sort method: date, author, subject, message + number. The REVERSE resource has no effect on their + values. Therefore, the variables no longer refer to + the actual physical listing order. This new behavior + no longer requires a users to redefine button and link + resources for the sake of specifying REVERSE. + + o "Resent-To" and "Resent-Cc" will now have e-mail + address hyperlinked. + + o Unknown types processed by mhexternal.pl now default + to have a ".bin" extension. This should cause HTTP + servers to treat the file as application/octet-stream. + + o Standard input can be specified as the source of a + mailbox by using a lone "-" on the command-line. Note: + You may need to specify "--" first to shut-off option + processing so the "-" is not interpreted as the start + of an option. + + Bug Fixes: + + o Problem: Index pages with last page links are not updated + when a new page is added. + Solution: All index pages are regenerated if a new page + is added. + + o Problem: "-idxsize 0" does not give unlimited page size. + Solution: Problem fixed and now works as documented. + + o Problem: "-maxsize 0" does not reset archive with + unlimited messages allowed. + Solution: Problem fixed and now works as documented. + + o Problem: Non-ASCII text encodings (=?ISO-..?...) are not + properly decoded when EDITIDX is set. + Solution: The charset filter libraries are now loaded + for EDITIDX. + + o Problem: MODTIME resource setting not remembered across + archive updates. + Solution: MODTIME resource is now properly stored in the + database. + + o Problem: Specifying -rmm and -single caused confusion on + what MHonArc does. + Solution: The case is properly handled, with -rmm taking + precedence. + + o Problem: 4 digit year not checked before 2 digit year + when parsing dates. + Solution: Fixed. + + o Problem: Some index pages in multipage indexes not + updated when messages expire. + Solution: Fixed; all pages are regenerated when a message + expires. + + o Problem: Setting MONTHS and MONTHSABR had no effect. + Solution: Fixed. + + o Problem: $TNEXTFROM$ actually gave the value of $NEXTFROM$. + Solution: Fixed. + + o Problem: Numerical timezone offsets not handled properly + when the offset contained non-zero minutes. This + caused message to be sorted wrong by date. + Solution: Fixed. + + o Problem: Some characters were not properly escaped when + specifying the "in URL" modifier to a resource + variable. + Solution: Fixed. + + o Problem: Thread (formatting) information lost when a + thread is split across multiple pages. + Solution: Fixed. New resources (TCONTBEGIN, TCONTEND, + TINDENTBEGIN, TINDENTEND) exist to preserve + formatting of threads across pages. + + o Problem: If specifying the REVERSE, the next/prev + links in messages do not point to the proper + message as one may expect. + Solution: This should be fixed by the new behavior of + $NEXT...$ and $PREV...$ resource variables. + + +======================================================================= +02/28/97 (2.0.0 beta 3) + + o Removed bogus call to output_db() when GENIDX is active. + The routine is not loaded when GENIDX is active and the + call causes Perl to abort. + + o Duplicates of the OTHERINDEXES resource should no longer + occur. Before, if the OTHERINDEXES resource gets set + during invocation, mhonarc would store duplicate values, + causing unnecessary work to be performed. + + o Fixed problem with blank indexes being created for + OTHERINDEXES. Apparently, there is a bug in Perl, and + a work-around fix has been done. + + o Fixed bug where an extra TSUBLISTEND could get generated. + + +======================================================================= +02/17/97 (2.0.0 beta 2) + + o Added element and -nosubsort option. + + o Changed M2H_DATEFMT envariable to M2H_GMTDATEFMT. + + o Documented LOCKTRIES and LOCKDELAY resources. + + o New resources: + + AUTHORBEGIN - Markup for start of author group + AUTHOREND - Markup for end of author group + AUTHSORT - Sort messages by author + DAYBEGIN - Markup for start of day group + DAYEND - Markup for end of day group + IDXLABEL - Label for main index + MSGGMTDATEFMT - Format of $MSGGMTDATE$ + MSGLOCALDATEFMT - Format of $MSGLOCALDATE$ + SUBJECTBEGIN - Markup for start of subject group + SUBJECTEND - Markup for end of subject group + TIDXLABEL - Label for thread index + + o New resource variables + + $IDXLABEL$ - Label for main index + $MSGGMTDATE$ - Date of message in GMT format + $MSGLOCALDATE$ - Date of message in local format + $TIDXLABEL$ - Label for thread index + + o Some enhancements to the documentation. + + o Some code changes. + + +======================================================================= +01/31/97 (2.0.0 beta 1) + + o RFC 1522 support. Charset filters can be plugged in to + handle character sets not recognized by mhonarc. + The library, iso8859.pl, contains charset filters for + character sets iso-8859-[1-10]. + + o Multi-page index generation. + + o Subject-based threading is done inconjunction with explicit + threading. + + o Missing messages in a thread are recognized when processing + messages that utilize the References field. + + o New resources for customizing thread indexes. There is + now complete user control on how thread indexes are + formatted. + + o Resource are available to access the next and previous messages + in thread from messages. + + o Inclusion of files containing resource settings can be + done within a resource file. + + o Support for a default resource file. The default resource + file is one of the following, in the order of precedence: + + 1. File specified by the M2H_DEFRCFILE envariable + 2. $HOME/.mhonarc.rc + 3. /.mhonarc.rc + + "" is the path of the MHonArc library + directory defined during installation. For MS-DOS, replace + ".mhonarc.rc" with "MHONARC.RC". + + o Support for user defined resource variables. + + o Support for user defined derived files for messages. + + o Support for the Content-Length field. + + o Modification time of messages, and derived files, can be + set to the Received/Date time specified in the message. + + o More control on how mail headers get formatted. + + o Added filter in mhexternal.pl to be the default filter + for main content-types: application, image, video, audio. + + o List of enhancements to mhexternal.pl: + + - Show content-type if the data is not recognized. + - New `ext' filter option to define the extension to + use for the created file. + - New `type' filter option to define the "english" + type name of the create file. + - Content-Disposition is supported. Filenames are + ignored still unless `usename' argument passed to + filter. + - Added recognition of few more content-types + + o Updated date parsing to figure out the date of a message to be + more robust on how it parses a date. If unable to parse + date, the message will take on the current time for sorting + purposes. Also, character case is ignored in month and weekday + names. + + o The comment declaration "" is + now inserted between the message header and body. Helps + in the building of some search indexes to restrict searches + on message data. + + o Many resource settings are no longer stored in database if + the resource is the default value. Save some disk space and + allows resources to self adjust when a dependent resource is + changed. + + o The text/plain filter in mhtxtplain.pl has the following + enhancements: + + - Check for charset to control character conversion. + - Integrated iso-2022-jp filter (keys off charset) + - Filter option "quote" cause quoted text in message + to be italicized. + - Filter option "asis" defines a list of charsets to + not convert to sgml entitites. Example usage: + + asis=iso-8859-1:iso-8859-2 + + o mhtxt2022.pl has been removed since the code has been + integrated into mhtxtplain.pl. + + o Resource file elements that have textual content (ie. no + line oriented content) can specify the "chop" attribute + to have the last end-of-line stripped from the content. + Example usage: + + + [Next] + + + o Fixed bug in creating links of message-ids. Mhonarc blindingly + made links of message-ids when editting messages w/o + consideration that the message-ids may already be linked. This + caused markup like the following to occur: + + ...... + + Browsers handle the invalid markup with no problems, causing + the bug to go unnoticed for a long time. Now, only new + added message-ids are scanned for when creating links. + + o $readmail'FieldSep should now be used instead of $FieldSep + for separating duplicate fields in a parsed message header. + + o The -scan output now prints a 4 digit year. + + o Bogus space no longer appears in subjects and dates. + + o Outdir permissions are not checked if -single specified. + + o Some internal changes to how data is stored in databases + (needed for 1522 support). v2.0 will automatically + modify 1.x databases to the 2.0 format. + + o The -single option utilizes the same mail output routine + utilized by regular archive processing. + + o MhonArc will now handle numbers with leading zeros when + the -rmm option is specified. + + o New resources: + + CHARSETCONVERTERS + - Specify character set filters + CONLEN - Honor content-lengths + DECODEHEADS - Decode 1522 encoded data, set for decode + only, as message headers are read (see + note below) + DEFINEVAR - Define resource variables + DEFINEDERIVED - Define user defined derived file + EXPIREDATE - Message cut-off date + EXPIREAGE - Time in seconds from current if msg expires + FIELDSBEG - Begin markup of converted mail header + FIELDSEND - End markup of converted mail header + FLDBEG - Begin markup of mail header field text + FLDEND - End markup of mail header field text + FOLREFS - Print links to explicit follow-ups & refs + GMTDATEFMT - Format of $GMTDATE$ + HEADBODYSEP - Markup between converted mail header & body + IDXPREFIX - Prefix for multi-page main index filenames + INCLUDE - Read resources from other files + LABELBEG - Begin markup of mail header label + LABELEND - End markup of mail header label + LOCALDATEFMT - Format of $LOCALDATE$ + MAIN - Create main index + MHPATTERN - Expression for mesg files in a directory + MODTIME - Set file times to message dates + MONTHS - Full month names: EOL or ':' separated + MONTHSABR - Abbrieviated month names: EOL or ':' + separated + MULTIPG - Create multi-page indexes + NEXTPGLINK - Link to next page in main index + NEXTPGLINK - Inactive link to next page in main index + NOCONLEN - Ignore content-lengths + NODECODEHEADS - Leave message headers "as is" when read + (see note below) + NOFOLREFS - Do not print links to follow-ups & refs + NOMAIN - Do not create main index + NOMODTIME - Do not set file times to message dates + NOMULTIPG - Do not create multi-page indexes + PREVPGLINK - Link to previous page in main index + PREVPGLINKIA - Inactive link to previous page in main index + SUBJECTHEADER - Markup for subject header in converted mail + TIDXPREFIX - Prefix for multi-page thread index filenames + TSUBLISTBEG - List begin in sub-thread + TSUBLISTEND - List end in sub-thread + TSUBJECTBEG - Begin markup for subject-based sub-thread + TSUBJECTEND - End markup for subject-based sub-thread + TSINGLETXT - Markup for mesg not part of a thread + TTOPBEGIN - Begin for top of a thread + TTOPEND - End for a thread + TLINONE - Markup for missing message in a thread + TLIEND - Thread idx list item end + TNEXTBUTTON - Thread next button template + TNEXTBUTTONIA - Inactive thread next button template + TNEXTLINK - Thread next link template + TNEXTLINKIA - Inactive thread next link template + TNEXTPGLINK - Link to next page in thread index + TNEXTPGLINKIA - Inactive link to next page in thread index + TPREVBUTTON - Thread previous button template + TPREVBUTTONIA - Inactive thread previous button template + TPREVLINK - Thread previous link template + TPREVLINKIA - Inactive thread previous link template + TPREVPGLINK - Link to prev page in thread index + TPREVPGLINKIA - Inactive link to prev page in thread index + WEEKDAYS - Full weekday names: EOL or ':' separated + WEEKDAYSABR - Abbrieviated weekday names: EOL or ':' + separated + + + NOTE + 1522 processing is done when creating HTML output and + the (relevant) data stored in the database stays in + encoded form. The DECODEHEADS resource can be set + to decode decode-only charsets when message headers + are read. Hence, the decode-only charsets will be + stored in decoded form. Regular 1522 processing is + still done to still-encoded data when generating output. + The default is NODECODEHEADS. + + o List of removed resources: + + NOTSUBSORT, TSUBSORT + + o New resource variables: + (NOTE: Some variables are only valid in certain contexts) + + $FIRSTPG$ - Filename of first page of main index + $IDXPREFIX$ - Prefix to main index pages' filenames + $LASTPG$ - Filename of last page of main index + $NEXTPG$ - Filename of next main index page + $NEXTPGLINK$ - Link to next page of main index + $NUMOFPAGES$ - Total number of pages in index + $PAGENUM$ - Current page number of index + $PREVPG$ - Filename of previous main index page + $PREVPGLINK$ - Link to previous page of main index + $TFIRSTPG$ - Filename of first page of thread index + $TIDXPREFIX$ - Prefix to thread index pages' filenames + $TLASTPG$ - Filename of last page of thread index + $TNEXTBUTTON$ - Button for next mesg in thread + $TNEXTFROM$ - From of next mesg in thread + $TNEXTFROMADDR$ - From address of next mesg in thread + $TNEXTFROMNAME$ - From name of next mesg in thread + $TNEXTLINK$ - Link for next mesg in thread + $TNEXTMSG$ - Next mesg filename in thread + $TNEXTMSGNUM$ - Next mesg number in thread + $TNEXTPG$ - Filename of next thread index page + $TNEXTPGLINK$ - Link to next page of thread index + $TNEXTSUBJECT$ - Next mesg subject in thread + $TPREVBUTTON$ - Button for prev mesg in thread + $TPREVFROM$ - From of previous mesg in thread + $TPREVFROMADDR$ - From address of previous mesg in thread + $TPREVFROMNAME$ - From name of previous mesg in thread + $TPREVLINK$ - Link for prev mesg in thread + $TPREVMSG$ - Previous mesg filename in thread + $TPREVMSGNUM$ - Previous mesg number in thread + $TPREVPG$ - Filename of previous thread index page + $TPREVPGLINK$ - Link to previous page of thread index + $TPREVSUBJECT$ - Previous mesg subject in thread + + o Removed resources: + + NOTSUBSORT, TSUBSORT + + o Some changes to default resource settings. + + o Reorganized code. Some new libraries have been created + to help in maintenance. + + o Source code has been put under SCCS revision control. + + +======================================================================= +07/12/96 (1.2.3) + + o Extracted initialization of data structures into mhinit.pl. + The file is just required from the main source. + + o Use q{} instead of qq{} when trying to read database file. + Should fix require problem under MS-DOS. + + o Added comments at beginning + of messages. May aid in database recovery techniques. + + o ';'s are now deleted in filenames in mhexternal.pl + (applicable only when "usename" option specified) + + o Added recognition of '/' when converted e-mail addresses + to mailto links in message headers. + + o Simple fix to mhtxt2022.pl for execution under Perl 5. + + +======================================================================= +04/18/96 (1.2.2) + + o Increased the speed performance of base64 decoding. Speed + increase is much greater under Perl 4 than Perl 5. + + o Added -time option to print out total CPU execution time. + Mainly used for debugging reasons (like checking on + base64 decoding times). Time information is sent to + standard error. + + o Added M2H_LOCKDELAY envariable and -lockdelay option. + Either can be used to adjust the sleep time between + attempts to lock the archive. + + o Added -force option to override a lock on an archive if + attempts to lock fail. + + o Added image/x-bmp and image/x-pcx to the default supported + MIME types. + + o Ignore "Sv:" at the beginning of subjects when sorting by + subject. "Sv:" is Danish for "Re:". + + o Fixed bug in mhutil.pl where TIDXPGEND actually set + TIDXPGBEG. + + o Dynamically define exclude_field routine after reading + user options. exclude_field is utilized when formatting + a message header in HTML. Defining the routine at run-time + helps reduce the regular expression overhead the old version + of the routine entailed. There should be an increase in + overall execution time. + + +======================================================================= +03/22/96 (1.2.1) + + o Added support for x-uuencode content-transfer-encoding. + + o Added -locktries command-line option. + + o Added the resource variable $OUTDIR$. + + o mhexternal.pl filter will use the name parameter string + on the content-type field as the anchor text to the file + if there is no content-description. + + o application/x-patch is recognized and processed by the + text/plain filter (mhtxtplain.pl). + + o Fixed bug in install.me and osinit.pl where setting + $'PROG caused perl to terminate if $'DIRSEP was a backslash + (occured under MS-DOS usage). + + o Fixed bug in install.me in the create_dir routine. + If $DIRSEP was a backslash, the regular expression setting + @a would cause perl to abort with an error. + + o Fixed database bug where the MIMEARGS resource setting + was not being stored. + + o Fixed index listing bug where a reverse listing was not + correct if an index size was specified less than the + current size of the archive. + + +======================================================================= +03/01/96 (1.2.0) + + o Rewrote message parser routine so it will work under Perl 5 + for multipart messages. The rewrite also allows some + additional features that are mentioned below. + + o The -mbox and -mh options are no longer required. MHonArc + will automatically determine which mode to operate in + based upon the file arguments. Hence, one can specify + MH folders and mailbox files on the same command-line. + Both options are ignored if specified. + + o An HTML index of an archive contents can be generated to + standard output (-genidx). + + o Message header lines not conforming to RFC 822 are ignored. + (Eg: Those pesky "From " lines should not show up anymore -- + please do not confuse this with the regular "From:" lines; + note the colon vs the space). + + o New resources: + + BOTLINKS - May be used to completely customize + the links at the bottom of messages. + IDXPGBEGIN - Opening markup for main index page. + Allows one to redefine opening HTML + element, HEAD element, TITLE element, + opening BODY element, etc. + IDXPGEND - Closing markup for main index page. + IDXSIZE - Set the maximum number of messages + listed in index. This is different + in MAXSIZE where MAXSIZE will remove + older messages when the MAXSIZE limit + is reached in the archive. + MIMEARGS - Define arguments to filters + MSGPGBEGIN - Opening markup for message pages. + Allows one to redefine opening HTML + element, HEAD element, TITLE element, + opening BODY element, etc. + MSGPGEND - Closing markup for message pages. + NEXTBUTTON - Defines the 'Next' button. + NEXTBUTTONIA - Defines the 'Next' button when it is + inactive. + NEXTLINK - Defines the 'Next' link. + NEXTLINKIA - Defines the 'Next' link when it is + inactive. + NOTSUBSORT - Do not sort threads by subject. + OTHERINDEXES - List other resource files defining + other indexes to create when creating, + or updating, an archive. + PREVBUTTON - Defines the 'Prev' button. + PREVBUTTONIA - Defines the 'Prev' button when it is + inactive. + PREVLINK - Defines the 'Prev' link. + PREVLINKIA - Defines the 'Prev' link when it is + inactive. + TIDXPGBEGIN - Opening markup for thread index page. + Allows one to redefine opening HTML + element, HEAD element, TITLE element, + opening BODY element, etc. + TIDXPGEND - Closing markup for thread index page. + TOPLINKS - May be used to completely customize + the buttons at the top of messages. + TSUBSORT - Sort threads listed by subject. + + o Removed resources: + + INDEXBL, INDEXFL, MBOX, MH, NEXTBL, NEXTFL, PREVBL, + PREVFL, TINDEXBL, TINDEXFL + + Resource were removed because they were no longer applicable + and/or have been superceded by other resources. MHonArc + will still honor old resource settings (where applicable) of + older archives and incorporate them into the new resource + settings. + + o When specifying the resource file, mhonarc will now do + the following to determine its location: + + 1. If its an absolute pathname, mhonarc uses it. + 2. If it is a relative pathname, mhonarc checks for + it relative to the current working directory. + 3. Otherwise, mhonarc checks for it relative to + location of the archive as specified by outdir. + + This resolution will allow you to place resource files with + the archive if desired (can be useful when using the + OTHERINDEXES resource element). + + o Because of the new resources available, many
's are no + longer hard-coded and are controllable by resources.
's + are still used in message pages to separate message data + from mhonarc data. + + o Added resource variables: + (NOTE: Some variables are only valid in certain contexts) + + $DDMMYY$ - Date of message in dd/mm/yy format + $IDXSIZE$ - Max size of index list + $MMDDYY$ - Date of message in mm/dd/yy format + $MSGID$ - Message id + $NEXTBUTTON$ - Next button markup + $NEXTFROM$ - From field of next listed message + $NEXTFROMADDR$ - From e-mail address of next listed message + $NEXTFROMNAME$ - From name of next listed message + $NEXTLINK$ - Next link markup + $NEXTMSGNUM$ - Number of next listed message + $NEXTSUBJECT$ - Subject text of next listed message + $NUMOFIDXMSG$ - Number of messages in index list + $PREVBUTTON$ - Previous button markup + $PREVFROM$ - From field of previous listed message + $PREVFROMADDR$ - From e-mail address of prev listed message + $PREVFROMNAME$ - From name of previous listed message + $PREVLINK$ - Previous link markup + $PREVMSGNUM$ - Number of previous message + $PREVSUBJECT$ - Subject text of previous listed message + $YYMMDD$ - Date of message in yy/mm/dd format + + o Can specify a 'U' with variable length specifier to denote + replacement string is to be used in a URL. Examples: + + $SUBJECTNA:40U$ + $MSGID:U$ + + The 'U' causes the replace text to have special characters + escaped as denoted by the URL spec. NOTE: Specify ":U" + should NOT be used in the MAILTOURL resource; the variables + will automatically be expanded according to the URL spec. + Specifyind ":U" or a length specifier in the MAILTOURL + resource will prevent mhonarc from detecting the variable. + + o New command-line options: + + -genidx - Generate HTML index of archive contents + to stdout. + -idxsize - Maximum number of messages shown in indexes + -notsubsort - Do not sort threads listed by subject. + -savemem - Write message data while processing + -tsubsort - Sort threads listed by subject. + + o The library mhtxt2022.pl has been added that provides + a filter to process ISO-2022 (Japanese) encoded mail messages. + See mhtxt2022.pl on how to hook it in. + + o The mhexternal.pl filter by default ignores any filename + specification in the message for creating derived files. + This avoids name conflicts and security problems. + The "usename" filter option may be used to override this. + + o Mime filters are now called with two additional arguments: + + $converted_data = &function( + $header, *parsed_header_assoc_array, + *message_data, $decoded_flag, + $optional_filter_arguments); + + The $decoded_flag is set to 1 if the *message_data has been + decoded. $optional_filter_arguments contains an optional + argument string as determined by the filter. + + o Mime filters can now be registered for multipart types + and message types. This allows one to override mhonarc's + conversion of these types, and completely replace mhonarc's + message->HTML conversion process. + + o Mime filters should now use $'FieldSep instead of $'X for + accessing parsed message headers. + + o Mime filters can be registered for a base type. Ie. + It is no longer required to explicitly list each possible + subtype if a single filter is to be used for them all. + Example: + + + image/*:myfilter'imagefilter:myfilter.pl + + + Registers "myfilter'filter" for all image data types, + regardless of subtype. However, if an explicit entry + exists for a subtype, then that filter is called. + Example: + + + image/*:myfilter'imagefilter:myfilter.pl + image/gif:myfilter'giffilter:myfilter.pl + + + "myfilter'giffilter" is called for all image/gif data. + "myfilter'imagefilter" is called for all other image data. + + o A new resource, MIMEARGS, may be used to pass optional arguments + to filters to control their behavior. The format of the + argument string is controlled by the various filters. The + arguments can be specified by a specific content-type, or + for the filter routine in general. A content-type argument + will be used over any arguments specified for a filter. + + Example usage: + + + image/gif:inline usename + m2h_external'filter:usename + + + See the documentation for possible arguments to filters. + + o Installation program can now be invoked in batch mode. + + o Thread index properly includes docurl as main index. + -nodocurl will prevent the inclusion as with the main index. + + o Fixed bug in mhtxthtml.pl on properly propogating a base + URL to relative URLs starting with a "/". + + o Fixed bug where single quotes, and backslashed in keys of + associative arrays in the database file were not getting + escaped. + + o Fixed bug where spaces and special characters were not + properly escaped in URL strings: spaces were left as-is, + and special characters were deleted. + + o Removed illegal invocation choices in the Synopsis of the + documentation. + + +======================================================================= +04/24/95 (1.1.1) + + o Fixed bug in -scan output where month in date was off by + one. + + +======================================================================= +04/21/95 (1.1.0) + + o Made modifications to make MHonArc suitable to run + under MS-DOS without modification. MHonArc will + automatically detect if it is running under Unix or MS-DOS. + + o Added support for a thread index. MHonArc will create a + complimentary index to the main index showing message + threads. + + o Archive messages can be deleted. + + o A listing to stdout of an archives contents can be + generated. + + o Maximum number of messages for an archive can be set. + Older messages (based on sort method) are removed + automatically during add operations. + + o MHonArc will now recognize if you try to add in a message + that already exists in an archive. + + o The -editdx option will now also cause a updating of all + mail messages. Guarantees resource changes to affect all + messages. + + o Added the following resource file elements: + + MSGFOOT -- Footer text for converted messages + MSGHEAD -- Header text for converted messages + NODOC -- Do not put link to documentation + NOTHREAD -- Do not create thread index + TFOOT -- Text at bottom of thread index page + THEAD -- Text at top of thread index page + THREAD -- Create thread index + TLEVELS -- Depth of thread listing + TLITXT -- Template text for entry in thread + index + TIDXFNAME -- Thread index filename + TINDEXBL -- Top button label in messages to + thread index + TINDEXFL -- Verbose label in message to thread + index + TTITLE -- Title of thread index page + + o Added the following command-line options: + + -maxsize -- Maxinum # messages in an archive + -nodoc -- Do not put link to documentation + -nothread -- Do not create thread index + -rmm -- Remove messages from an archive + -scan -- Listing of archive to stdout + -thread -- Create thread index + -tidxfname -- Thread index filename + -tlevels -- Depth of thread listing + -ttitle -- Title of thread index page + + o Added the following environment variables: + + M2H_MAXSIZE -- Maxinum # messages in an archive + M2H_THREAD -- If non-zero, create thread index + M2H_TIDXFNAME -- Thread index filename + M2H_TLEVELS -- Depth of thread listing + M2H_TTITLE -- Title of thread index page + + o Added the following variables for template resources + (applicability of variables vary depending on the resource): + + $DOCURL$ -- URL to documentation + $IDXFNAME$ -- Main index page filename + $IDXTITLE$ -- Main index page title + $NEXTMSG$ -- Next message filename + $PREVMSG$ -- Previous message filename + $PROG$ -- Program name + $TIDXFNAME$ -- Thread index page filename + $TIDXTITLE$ -- Thread index page title + $VERSION$ -- Version number of the program + + o Added $FROM$, $MSGID$, and $SUBJECT$ variables to be used + in the MAILTOURL resource. + + o The string `$$' in template resources will produce a `$' in + the output. + + o Fixed problem with messages (with follow-ups) getting + unnecessarily updated when messages are added to an archive. + + o Only a CR/LF, or LF, pair will terminate a message head. + Before, MHonArc was terminating message heads when + encountering an empty line or a line that only contained + whitespace (which was incorrect behavior). + + o Fixed bug in mhexternal.pl dealing with the `name' parameter + in the content-type field. Surrounding "s or 's were not + being deleted causing filenames with quotes to be written. + + o mhexternal.pl: The head of a pathname in the `name' + parameter in the content-type field is stripped off before + writing the external file. I.e. Only the base filename is + used. + + o Only one
after the H1 subject in messages will appear + if no message header fields are printed. + + o Added recognition of the following content-types in + mhexternal.pl: + + application/mac-binhex40 + + o Added a extras/ directory containing useful programs for + MHonArc. See README in the directory for information on + the programs contained in there. + + o To support -rmm, MIME filters now return an array. The + first array value is the HTML for the message, and any other + array values are filenames of files generated by the + filter. This allows MHonArc to know of any extra files that + must be deleted when a message is removed. + + o Some routines from the main mhonarc source file have been + moved into a separate librarys: readmail.pl, mhdb.pl, + mhutil.pl + + o The default URL to the documentation is now, + + http://www.oac.uci.edu/indiv/ehood/mhonarc.html + + The old URL, + + http://www.oac.uci.edu/indiv/ehood/mhonarc.doc.html + + is still valid. + + o There's probably other stuff, but I cannot remember. + + +======================================================================= +10/01/94 (1.0.0) + + o First release -- See RELNOTES about compatibility issues + with mail2html. + + +======================================================================= +####################################################################### +======================================================================= +Earl Hood, ehood@medusa.acs.uci.edu +@(#) CHANGES 97/05/22 19:01:09 @(#) diff --git a/COPYING b/COPYING index 9ed3415..b9339b9 100644 --- a/COPYING +++ b/COPYING @@ -1,339 +1,346 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. +GNU General Public License + +---------------------------------------------------------------------------- + +Table of Contents + + * GNU GENERAL PUBLIC LICENSE + o Preamble + o TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + o How to Apply These Terms to Your New Programs + +---------------------------------------------------------------------------- + +GNU GENERAL PUBLIC LICENSE + +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom to +share and change it. By contrast, the GNU General Public License is intended +to guarantee your freedom to share and change free software--to make sure +the software is free for all its users. This General Public License applies +to most of the Free Software Foundation's software and to any other program +whose authors commit to using it. (Some other Free Software Foundation +software is covered by the GNU Library General Public License instead.) You +can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our +General Public Licenses are designed to make sure that you have the freedom +to distribute copies of free software (and charge for this service if you +wish), that you receive source code or can get it if you want it, that you +can change the software or use pieces of it in new free programs; and that +you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone to +deny you these rights or to ask you to surrender the rights. These +restrictions translate to certain responsibilities for you if you distribute +copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or +for a fee, you must give the recipients all the rights that you have. You +must make sure that they, too, receive or can get the source code. And you +must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) +offer you this license which gives you legal permission to copy, distribute +and/or modify the software. + +Also, for each author's protection and ours, we want to make certain that +everyone understands that there is no warranty for this free software. If +the software is modified by someone else and passed on, we want its +recipients to know that what they have is not the original, so that any +problems introduced by others will not reflect on the original authors' +reputations. + +Finally, any free program is threatened constantly by software patents. We +wish to avoid the danger that redistributors of a free program will +individually obtain patent licenses, in effect making the program +proprietary. To prevent this, we have made it clear that any patent must be +licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification +follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a notice +placed by the copyright holder saying it may be distributed under the terms +of this General Public License. The "Program", below, refers to any such +program or work, and a "work based on the Program" means either the Program +or any derivative work under copyright law: that is to say, a work +containing the Program or a portion of it, either verbatim or with +modifications and/or translated into another language. (Hereinafter, +translation is included without limitation in the term "modification".) Each +licensee is addressed as "you". + +Activities other than copying, distribution and modification are not covered +by this License; they are outside its scope. The act of running the Program +is not restricted, and the output from the Program is covered only if its +contents constitute a work based on the Program (independent of having been +made by running the Program). Whether that is true depends on what the +Program does. + +1. You may copy and distribute verbatim copies of the Program's source code +as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this +License and to the absence of any warranty; and give any other recipients of +the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you +may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, +thus forming a work based on the Program, and copy and distribute such +modifications or work under the terms of Section 1 above, provided that you +also meet all of these conditions: + + * a) You must cause the modified files to carry prominent notices stating + that you changed the files and the date of any change. + + * b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any part + thereof, to be licensed as a whole at no charge to all third parties + under the terms of this License. + + * c) If the modified program normally reads commands interactively when + run, you must cause it, when started running for such interactive use + in the most ordinary way, to print or display an announcement including + an appropriate copyright notice and a notice that there is no warranty + (or else, saying that you provide a warranty) and that users may + redistribute the program under these conditions, and telling the user + how to view a copy of this License. (Exception: if the Program itself + is interactive but does not normally print such an announcement, your + work based on the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If identifiable +sections of that work are not derived from the Program, and can be +reasonably considered independent and separate works in themselves, then +this License, and its terms, do not apply to those sections when you +distribute them as separate works. But when you distribute the same sections +as part of a whole which is a work based on the Program, the distribution of +the whole must be on the terms of this License, whose permissions for other +licensees extend to the entire whole, and thus to each and every part +regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your +rights to work written entirely by you; rather, the intent is to exercise +the right to control the distribution of derivative or collective works +based on the Program. + +In addition, mere aggregation of another work not based on the Program with +the Program (or with a work based on the Program) on a volume of a storage +or distribution medium does not bring the other work under the scope of this +License. + +3. You may copy and distribute the Program (or a work based on it, under +Section 2) in object code or executable form under the terms of Sections 1 +and 2 above provided that you also do one of the following: + + * a) Accompany it with the complete corresponding machine-readable source + code, which must be distributed under the terms of Sections 1 and 2 + above on a medium customarily used for software interchange; or, + + * b) Accompany it with a written offer, valid for at least three years, + to give any third party, for a charge no more than your cost of + physically performing source distribution, a complete machine-readable + copy of the corresponding source code, to be distributed under the + terms of Sections 1 and 2 above on a medium customarily used for + software interchange; or, + + * c) Accompany it with the information you received as to the offer to + distribute corresponding source code. (This alternative is allowed only + for noncommercial distribution and only if you received the program in + object code or executable form with such an offer, in accord with + Subsection b above.) + +The source code for a work means the preferred form of the work for making +modifications to it. For an executable work, complete source code means all +the source code for all modules it contains, plus any associated interface +definition files, plus the scripts used to control compilation and +installation of the executable. However, as a special exception, the source +code distributed need not include anything that is normally distributed (in +either source or binary form) with the major components (compiler, kernel, +and so on) of the operating system on which the executable runs, unless that +component itself accompanies the executable. + +If distribution of executable or object code is made by offering access to +copy from a designated place, then offering equivalent access to copy the +source code from the same place counts as distribution of the source code, +even though third parties are not compelled to copy the source along with +the object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as +expressly provided under this License. Any attempt otherwise to copy, +modify, sublicense or distribute the Program is void, and will automatically +terminate your rights under this License. However, parties who have received +copies, or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed +it. However, nothing else grants you permission to modify or distribute the +Program or its derivative works. These actions are prohibited by law if you +do not accept this License. Therefore, by modifying or distributing the +Program (or any work based on the Program), you indicate your acceptance of +this License to do so, and all its terms and conditions for copying, +distributing or modifying the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the original +licensor to copy, distribute or modify the Program subject to these terms +and conditions. You may not impose any further restrictions on the +recipients' exercise of the rights granted herein. You are not responsible +for enforcing compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot distribute so +as to satisfy simultaneously your obligations under this License and any +other pertinent obligations, then as a consequence you may not distribute +the Program at all. For example, if a patent license would not permit +royalty-free redistribution of the Program by all those who receive copies +directly or indirectly through you, then the only way you could satisfy both +it and this License would be to refrain entirely from distribution of the +Program. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply and +the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents +or other property right claims or to contest validity of any such claims; +this section has the sole purpose of protecting the integrity of the free +software distribution system, which is implemented by public license +practices. Many people have made generous contributions to the wide range of +software distributed through that system in reliance on consistent +application of that system; it is up to the author/donor to decide if he or +she is willing to distribute software through any other system and a +licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a +consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain +countries either by patents or by copyrighted interfaces, the original +copyright holder who places the Program under this License may add an +explicit geographical distribution limitation excluding those countries, so +that distribution is permitted only in or among countries not thus excluded. +In such case, this License incorporates the limitation as if written in the +body of this License. + +9. The Free Software Foundation may publish revised and/or new versions of +the General Public License from time to time. Such new versions will be +similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +10. If you wish to incorporate parts of the Program into other free programs +whose distribution conditions are different, write to the author to ask for +permission. For software which is copyrighted by the Free Software +Foundation, write to the Free Software Foundation; we sometimes make +exceptions for this. Our decision will be guided by the two goals of +preserving the free status of all derivatives of our free software and of +promoting the sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR +THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO +THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM +PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR +CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO +LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR +THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible +use to the public, the best way to achieve this is to make it free software +which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively convey the +exclusion of warranty; and each file should have at least the "copyright" +line and a pointer to where the full notice is found. + +one line to give the program's name and an idea of what it does. +Copyright (C) 19yy name of author + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this when +it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) 19yy name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details +type `show w'. This is free software, and you are welcome +to redistribute it under certain conditions; type `show c' +for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may be +called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright +interest in the program `Gnomovision' +(which makes passes at compilers) written +by James Hacker. + +signature of Ty Coon, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General Public +License instead of this License. diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..0ee51c8 --- /dev/null +++ b/INSTALL @@ -0,0 +1,59 @@ +INSTALL for MHonArc + + http://www.oac.uci.edu/indiv/ehood/mhonarc.html + +--------------------------------------------------------------------------- + + NOTE + Installation has changed slightly from 1.x releases. Please + read the following instructions if you are familiar with + the 1.x installation process. + +This document gives the basic method for installing MHonArc on a Unix or +MS-DOS/Windows system. + +Instructions + + Interactive Installing: + + Run the following command: + + perl install.me + + The installation program will ask you a series of questions on + where the Perl executable is and where to put MHonArc files. + Just hit to accept the default values listed in ()'s. + + Batch Install: + + 1. Edit the file 'install.cfg'. Knowledge of Perl is helpful. + 2. Run the following command: + + perl install.me batch + + The installation program will output information on what + is being installed and where it is being installed. + +Notes on Installation Program + + o The '#!' line in the installed mhonarc program is set to + point to the Perl executable specified in the installation + process (this has no meaning under MS-DOS). + + o The installed mhonarc program has code added so it will find + its default libraries specified in the installation program. + I.e. The install lib directory is added to mhonarc's search + path so it will find its libraries. + + o If you specify paths that do not exist, the install.me + program will create the path ONLY if running in interactive + mode. If running in batch mode, you must check that all paths + specified exist. + + o MSDOS/Windows users: You many need to create a batch file + for easy invocation of MHonArc. An example batch file + exists in the bat/ directory of the distribution. + +--------------------------------------------------------------------------- +Copyright (C) 1997, Earl Hood, ehood@medusa.acs.uci.edu +@(#) INSTALL 97/05/15 16:59:14 @(#) diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2779d12 --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +##---------------------------------------------------------------------------## +## @(#) Makefile 1.5 97/05/15 16:59:40 @(#) +##---------------------------------------------------------------------------## + +CHMOD = /bin/chmod +RM = /bin/rm +PRGS = mhonarc +TXTFILES = ACKNOWLG CHANGES COPYING README RELNOTES INSTALL BUGS +DOSIFY = dosify +PERL = perl +INSTALLPRG = install.me +INSTALLCFG = install.cfg + +default: + $(CHMOD) a+x $(PRGS) + $(CHMOD) -R a+r,a+X . + $(DOSIFY) $(TXTFILES) + +install: + $(PERL) $(INSTALLPRG) + +install-batch: + $(PERL) $(INSTALLPRG) batch + +test: + @echo "No tests" + +clean: + @echo "Nothing to clean" diff --git a/README b/README index df32d01..9522eb9 100644 --- a/README +++ b/README @@ -22,22 +22,15 @@ # # ############################################################################## -README for MHonArc -v1.2.3 - - - --------------------------------------------------------------------------- -Table of Contents: - CONTENTS - DOCUMENTATION - INSTALLATION - MAILING LIST - BUGS/COMMENTS/SUGGESTIONS? + README for MHonArc + v2.0.1 + + http://www.oac.uci.edu/indiv/ehood/mhonarc.html --------------------------------------------------------------------------- MHonArc -- Internet mail-to-HTML converter - Copyright (C) 1995,1996 Earl Hood, ehood@isogen.com + Copyright (C) 1995-1997 Earl Hood, ehood@medusa.acs.uci.edu This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -49,152 +42,112 @@ Table of Contents: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA. --------------------------------------------------------------------------- CONTENTS -ACKNOWLG Thanks to people -CHANGES Revision history of MHonArc -COPYING GNU General Public License -README The file you are reading -RELNOTES Release notes for MHonArc (please read) -bat/ Batch files for MS-DOS users -doc/ Documentation for MHonArc -examples/ Example resource files for MHonArc -extras/ Extra programs for use with MHonArc (See extras/README) -install.cfg Base installation configuration file -install.me Installation program for MHonArc -lib/ Libraries/MIME filters used by MHonArc -logo/ Gifs of the MHonArc logo -mhonarc* The MHonArc program - ---------------------------------------------------------------------------- -DOCUMENTATION - -Documentation for MHonArc is located in the doc/ directory. - -html: - The main documentation for MHonArc is in multiple HTML files. Load - mhonarc.html in the doc/ directory into your Web browser to get - started. The HTML is generated from the Frame source via - MifMucker, - . - -postscript: - The postscript file, mhonarc.ps, is available if a hardcopy version - of the documentation is required. Since the cross-references used - are designed for HTML reading (ie they get converted into - hyperlinks), they may not be as useful for hardcopy reading. - The postscript is generated from the Frame source. - -ascii: - A plain text version of the documentation is in the single file - mhonarc.txt. This file is created by converting the HTML files - into ascii. See the Makefile in doc/ for how the conversion is - done. - -manpage: - For Unix users, there is a manpage in doc/ called mhonarc.1. It - is not very fancy. It is automatically generated like the - ascii version. The manpage does not follow the standard manpage - style and is not intended to be printed via troff. - -The installation process does not deal with the manpage or postscript -file. If you want to install them, you must do it manually. The -installation process does allow you to install the HTML and ASCII -documentation in a location of your choice. +ACKNOWLG Thanks to people +BUGS Bug list +CHANGES Revision history of MHonArc +COPYING GNU General Public License +INSTALL Instructions on how to install MHonArc +README The file you are reading +RELNOTES Release notes for MHonArc (please read) +bat/ Batch files for MS-DOS users +doc/ Documentation for MHonArc +examples/ Example resource files for MHonArc +extras/ Extra programs for use with MHonArc (See extras/README) +faq/ FAQ for MHonArc +install.cfg Base installation configuration file +install.me Installation program for MHonArc +lib/ Libraries/MIME filters used by MHonArc +logo/ Gifs of the MHonArc logo +mhonarc* The MHonArc program --------------------------------------------------------------------------- INSTALLATION -This section gives the basic method for installing MHonArc on a Unix or -MS-DOS/Windows system. The documentation (doc/install.html) contains -an installation section with more detailed information. You can also -read the detailed instructions at - - -Brief Instructions - - Interactive Installing: - - Run the following command: - - perl install.me - - The installation program will ask you a series of questions on - where the Perl executable is and where to put MHonArc files. - Just hit to accept the default values listed in ()'s. + Read the file INSTALL for instructions on how to install MHonArc. - Batch Install: - - 1. Edit the file 'install.cfg'. - 2. Run the following command: - - perl install.me install.cfg - - The installation program will output information on what - is being installed and where it is being installed. - -Notes on Installation Program - - o The '#!' line in the installed mhonarc program is set to - point to the Perl executable specified in the installation - process (this has no meaning under MS-DOS). +--------------------------------------------------------------------------- +DOCUMENTATION - o The installed mhonarc program has code added so it will find - its default libraries specified in the installation program. - I.e. The install lib directory is added to mhonarc's search - path so it will find its libraries. + Documentation for MHonArc is located in the doc/ directory. + The main documentation for MHonArc is in multiple HTML files. + Load mhonarc.html in the doc/ directory into your Web browser to + get started. - o If you specify paths that do not exist, the install.me - program will create the path ONLY if running in interactive - more. If using a configuration file (eg: install.cfg) you - must check that all paths specified exist. + Filenames of the documentation do NOT follow the 8.3 convention. + Therefore, you will need a filesystem that supports long names + to read the documentation locally. -Bugs in Installation Program + Some tables are used in the documentation. Therefore, having + a table-capable viewer is beneficial. If your viewer does not + recognize tables, the documentation should still be usable. - o In interactive mode, if you change a path after confirmation, - the old specified path will still exist, even if install.me - created it for you. Hence, the author recommends batch install. + Also provided is a version of the MHonArc FAQ in the faq/ + directory. The FAQ is also in HTML. Load faq.html into your + Web browser to read the FAQ. --------------------------------------------------------------------------- MAILING LIST - A MHonArc mailing list exists to provide a general discussion forum - for users and developers. To subscribe to the mailing list, send - mail to mhonarc-request@rosat.mpe-garching.mpg.de with the single - word "subscribe" (without the quotes) as the message body. + A MHonArc mailing list exists to provide a general discussion + forum for users and developers. The list is the main source for + the latest news about MHonArc. + + To subscribe to the mailing list, send mail to + mhonarc-request@rosat.mpe-garching.mpg.de with the single word + "subscribe" (without the quotes) as the message body. Mail sent to mhonarc@rosat.mpe-garching.mpg.de will be distributed to all subscribers. The WWW archive of the mailing list is located at - + (http://www.rosat.mpe-garching.mpg.de/mailing-lists/mhonarc/) + and is searchable via a Glimpse search engine. --------------------------------------------------------------------------- BUGS/COMMENTS/SUGGESTIONS? If you have any bugs/comments/suggestions about MHonArc, you may - send mail to the proper person(s) listed in the Contacts section of - the documentation, or (the prefered method) you may send mail to - the MHonArc mailing list, mhonarc@rosat.mpe-garching.mpg.de. + send mail to the MHonArc mailing list, + mhonarc@rosat.mpe-garching.mpg.de. + + NOTE: The author of MHonArc *is* subscribed to the list. If it is a bug you are reporting, please include the following in your message: o Version of Perl (can be retrievied by "perl -v"). - o Version of the program in question. + o Version of the program (can be retrievied by "mhonarc -b"). + o The operating system you are using (on Unix the output + of "uname -a" is useful). o The exact command-line used to invoke the program. o Error/diagnostic messages from the program. - o Any other information that might prove useful. + o Any other information that might prove useful (eg. input + files, resource files, environment settings, etc. Before sending e-mail, make sure the documentation does not already have an answer to your question/problem. - The latest information on MHonArc may be obtained at - +--------------------------------------------------------------------------- +USING/COPYING + + MHonArc is free to use, but feel free to send the author a donation + if you feel guilty on using a program that that cost you nothing, + but some poor soul sweated over. The author is more than happy to + provide address information to prospective donors inorder to ease + their conscience. Plus, requests from donars are more likely to + get more timely responses ;-) + + MHonArc is distributed under the GNU General Public License. + The rules for using and copying MHonArc are explained in the + file COPYING. --------------------------------------------------------------------------- -Earl Hood, ehood@isogen.com +Copyright (C) 1997, Earl Hood, ehood@medusa.acs.uci.edu +@(#) README 97/05/23 11:15:18 @(#) diff --git a/RELNOTES b/RELNOTES index b7d505c..bf72cee 100644 --- a/RELNOTES +++ b/RELNOTES @@ -1,172 +1,38 @@ -Release Notes for MHonArc - - - ---------------------------------------------------------------------------- - MHonArc -- Internet mail-to-HTML converter - Copyright (C) 1995,1996 Earl Hood, ehood@isogen.com - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ---------------------------------------------------------------------------- - -Version 1.2.3 -------------- - -This version is a minor enhancement, bug fix release. See the CHANGES -files for what was added and fixed. - -No modifications were made that require changes to the documentation -from v1.2.2. The documentation has been left untouched. - ---------------------------------------------------------------------------- - The following are release notes from previous versions of MHonArc. ---------------------------------------------------------------------------- - -Version 1.2.2 -------------- - -This version is a minor enhancement, bug fix release. See the CHANGES -files for what was added and fixed. - ---------------------------------------------------------------------------- - -Version 1.2.1 -------------- - -This version is a minor enhancement, bug fix release. See the CHANGES -files for what was added and fixed. - - -Version 1.2.0 -------------- - -The CHANGES file contains information on the changes that may affect -1.1.0 archives. Please read it. - - -Version 1.1.0 -------------- - -Database file: - 1.1.0 is able to handle 1.0.x database files. Only additions - have been made between 1.0.x and 1.1.0. - -Threading: - - o If you have a 1.0 archive, you can generate a thread index - for it with the following: - - mhonarc -thread -editidx ... - - NOTE: You will also need to (re)specify the LISTBEGIN - resource so a link to the thread index exists on the main - index page. See the section on _Index Page Customization_ - in the documentation for more information. - - o You can prevent the creation of the thread index by the - following: - - * Set the M2H_THREAD environment variable to 0. - * Specify the NOTHREAD resource file element. - * Use the -nothread option. - - o Remember, the thread index does not replace the main index. - It compliments the main index. If using a custom layout, - resource variables are available to link between the 2 - indexes. - - -The following note is only relevant if you have developed your own -MIME filters for use in MHonArc: - - o MHonArc now treats the return value from MIME filters as - an array. The first value of the array is treated as the - HTML text to use in the message. All other array values are - treated as names of files that the filter may have generated - (eg. mhexternal.pl). MHonArc stores the filenames in the - database. Therefore, MHonArc can delete any extra files - associated with a message if the message is removed via the - -rmm option. - - -Version 1.0.0 -------------- -* (See also Beta User Notes below if you were a user of 1.0.0 beta) - -The release notes for version 1.0.0 of MHonArc address compatiblity -issues with the mail2html 3.1.x program. - - o The database file is compatible with mail2html database - files, however the icon support feature will not work - properly. Recreate the archive with MHonArc if icon usage - is desired. - - o The database filename has been renamed to ".mhonarc.db". - HOWEVER, MHonArc will use the ".mail2html.db" file when - adding to archives created with mail2html. - - o Many of the index page resource settings have been eliminated, - like DATE and SUBONLY. The same effects can be obtained by - using the LITEMPLATE resource element. - - o The STAMP resource has been eliminated since the same effect - can be achieve with the LISTBEGIN or LISTEND resource elements. - - o The USERSUBS resource element has been eliminated. You can - achieve the same results by writing your own MIME filter, or - modifying the existing ones. - - -1.0.0 Beta User Notes ---------------------- - - o The number of library files have been reduced (beta 8). The - library 'mhexternal.pl' is a merging of the application, - audio, image, and video libraries. mhexternal.pl covers all - the content-types in the old filters, plus much more. The - library is designed to be a catch-all library for - content-types that get filtered to external files. - - **IMPORTANT NOTE: Because of the change in libraries, any - archive database files created with beta version less than 8 - will cause MHonArc to abort abnormally: i.e. Perl aborts - because it cannot require the libraries specified in the - database file. You can utilize the file deffilters.rc in - the examples directory, with the -rcfile option, to update - the database when adding new mail. - - o The PERLINC resource element is recognized (beta 8). The - docs used PERLINC, but the code used PERLLIB. Also, the - paths specified in the PERLINC resource element are saved - to the database. - - o The default filter libraries' filenames have been renamed to - 14 characters, or less (beta 5). This is to avoid conflicts - with older Unix file systems with filename limits. See - **IMPORTANT NOTE above about the effects of library filename - changes. - - o The default filters had a bug fixed in them (beta 5). - Content-Description text is now properly "htmlized". - - o The $CURDATE$ variable went away for the LISTBEGIN or - LISTEND resource elements (beta 3). Use $GMTDATE$ to get - the current date based off GMT time, and use $LOCALDATE$ to - get the local date and time for your timezone. $CURDATE$ - used to give only the GMT date and time. - - ---------------------------------------------------------------------------- -Earl Hood, ehood@isogen.com +Release Notes for MHonArc + + http://www.oac.uci.edu/indiv/ehood/mhonarc.html + +Also read the CHANGES document for changes they may affect +you if you are a user of an earlier version of MHonArc. + +=========================================================================== + +Version 2.0.1 + + See the BUGS file for an important bug fix related to + empty database entries. + +--------------------------------------------------------------------------- + +Version 2.0.0 + + o The installation process has changed slightly. Please + read the installation instructions in the README + carefully. + + o Documentation is now provided only in HTML. + + o There are some changes to how data is stored in the + database file from v1.x. If MHonArc v2.0 reads a 1.x + archive, it will automatically convert the 1.x data into + 2.0 data. All existing resource settings will be preserved. + + NOTE + Once an archive has been processed by v2.0, the + database may no longer be utilized by v1.x. If + v1.x is used later to process the archive, + unpredictable results will occur. + + +=========================================================================== +97/05/22 19:01:12 diff --git a/bat/README b/bat/README index e8944d7..2e574b0 100644 --- a/bat/README +++ b/bat/README @@ -13,7 +13,7 @@ NOTES The batch files are for your use if you are running MHonArc under MS-DOS. Edit the paths in the files to reflect where you have installed MHonArc via the install.me program. Then copy the batch -files to a location in your executable searc path. +files to a location in your executable search path. --------------------------------------------------------------------------- -Earl Hood, ehood@convex.com +Copyright (C) 1997, Earl Hood, ehood@medusa.acs.uci.edu diff --git a/doc/Makefile b/doc/Makefile deleted file mode 100644 index d8cf761..0000000 --- a/doc/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -HTMLDOCS = \ - mhonarc.html \ - intro.html \ - install.html \ - qstart.html \ - overview.html \ - rcfile.html \ - adding.html \ - removing.html \ - indexpg.html \ - message.html \ - mime.html \ - details.html \ - diagnos.html \ - glossary.html \ - contacts.html - -TMPFILE = ,mhonarc -TEXTDOC = mhonarc.txt -MANPAGE = mhonarc.1 - -$(TEXTDOC): $(HTMLDOCS) mktxt - /bin/rm -f $(TMPFILE) $(TEXTDOC) $(MANPAGE) - @for i in $(HTMLDOCS) ;\ - do \ - echo $$i ;\ - lynx -dump -nolist $$i >> $(TMPFILE) ;\ - done - perl mktxt < $(TMPFILE) - /bin/rm -f $(TMPFILE) - chmod 644 $(TEXTDOC) $(MANPAGE) - diff --git a/doc/adding.html b/doc/adding.html deleted file mode 100644 index 8b2aad8..0000000 --- a/doc/adding.html +++ /dev/null @@ -1,138 +0,0 @@ - - - -MHonArc v1.2.2 -- Adding Messages - - -[Previous][Next][Contents][FAQ][Bugs][Home] -
- -

Adding Messages -

- -

Adding messages to an archive is done via the -add option. If no mailbox/folder -arguments are given, MHonArc assumes that a single message is being added to -the archive via standard input. Otherwise, MHonArc adds the messages contained -in the mail folders specified. -

-
-
NOTE - -

MHonArc will skip any messages that already exist in an archive. If a -message to be added has a message-ID that equals a message-ID of an -archived message, the message is skipped. -

-
-

Examples -

- -

Adding a mail folder -

- -

Here is example session adding an mail folder to an existing archive: -

-
% mhonarc -add test/www
-Requiring MIME filter libraries ...
-        mhexternal.pl
-        mhtxthtml.pl
-        mhtxtplain.pl
-        mhtxtsetext.pl
-Adding messages to ./maillist.html
-Reading test/www/ ........................................
-Writing HTML ...
-49 messages
-
-
- -

.forward -

- -

MHonArc can be used to add new messages as they are received by using the -".forward" file in your home directory. Here is how I would set up my -.forward file to invoke MHonArc on incoming mail: -

-
\ehood, "|/mnt/ehood/bin/webnewmail #ehood"
-
-
- -
-
NOTE on .forward entry: - -

The "\ehood" tells sendmail to still deposit the incoming message to my -mail spool file. The "#ehood" Bourne shell comment is needed to insure -the command is unique from another user. Otherwise, sendmail may not -invoke the program for you or the other user. -

-

"webnewmail" is a Perl program that calls MHonArc with the appropriate -arguments. A wrapper program is used instead of calling MHonArc directly to -keep the .forward file simple. Here is the code to the webnewmail program: -

-
#!/usr/local/bin/perl
-
-$cmd = "/mnt/ehood/bin/mhonarc -add -quiet " .
- "-outdir /mnt/ehood/public_html/newmail";
-open(M2H, "|$cmd");
-print M2H <STDIN>;
-close(M2H);
-
-
- -

The webnewmail can be modified to check the mail header before calling -MHonArc to perform selective archiving of messages. For example, webnewmail -can check the To: field and only archive messages that come from a specific -mailing list. -

-

Cron -

- -

This example uses cron(1) to update some mail archives from MH mail folders. -

-

The following entry is in my crontab file: -

-
0 0 * * * webmail
-
-
- -

webmail is a script executed every night that calls MHonArc to perform the -update: -

-
#! /bin/csh -f
-
-umask 022
-setenv M2H_RCFILE $HOME/.mhonarc.rc
-## WWW messages
-mhonarc -add \
-          -outdir $HOME/public_html/doc/wwwmail \
-          $HOME/mail/www
-folder +www >& /dev/null
-refile first-last +www.ar >& /dev/null    # Archive original messages
-
-## Tools messages
-mhonarc -add \
-          -outdir $HOME/public_html/doc/toolsmail \
-          $HOME/mail/tools $HOME/mail/dtd
-folder +tools >& /dev/null
-refile first-last +tools.ar >& /dev/null  # Archive original messages
-folder +dtd >& /dev/null
-refile first-last +dtd.ar >& /dev/null    # Archive original messages
-
-folder +inbox >& /dev/null                # Set current folder to inbox
-
-
-
- -

To avoid mail everynight from cron due to output from MHonArc, the -quiet -option can be used for each call to MHonArc, or use the following line in your -crontab file: -

-
0 0 * * * webmail > /dev/null
-
- -

Standard error is not redirected to /dev/null so mail is still received if errors -occured during MHonArc execution. -

- -
-[Previous][Next][Contents][FAQ][Bugs][Home] - - diff --git a/doc/bugs.html b/doc/bugs.html new file mode 100644 index 0000000..2e04fc3 --- /dev/null +++ b/doc/bugs.html @@ -0,0 +1,659 @@ + + + + +MHonArc -- Bugs + + + + +

+[Prev][Next][TOC][FAQ][Bugs][Home] +

+ +
+ +

Bugs

+ +

The following gives a list of bugs reported against +MHonArc. Each bug listing shows the version the +bug was reported against, a decription of the problem, +and if applicable, a solution and version of MHonArc +the bug was fixed. +

+ +

Bug List

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Version2.0.0
ProblemBogus empty entry shows up in the database. Bogus entry appears if a duplicate message is detected. + Potential visible problems of bogus entry are: mailto + links in headers corrupted; a blank listing in the + index. Maybe other potential problems. +
SolutionThere is a be a bug in some versions of Perl where a hash key gets added invalidly. The section of code that + this occurs has been modified to avoid the problem. + For existing databases with a bogus empty entry, + MHonArc now removes any empty key entries. + However, it is recommed to rebuild the archive. +
Fixed2.0.1

Version2.0.0
ProblemIndex pages are not properly updated if zero messages are in the archive (like through the -rmm option). + Even -editidx cannot cause a proper update. +
SolutionPage count was set to zero when no messages exist. This caused problems in conditional checks in the write index + routines. To fix, page count is forced to 1 if their + are no messages. +
Fixed2.0.1

Version2.0.0 beta 3
ProblemIndex pages with last page links are not updated when a new page is added. +
SolutionAll index pages are regenerated if a new page is added. +
Fixed2.0.0

Version2.0.0 beta 3
Problem"-idxsize 0" does not give unlimited page size.
SolutionProblem fixed and now works as documented.
Fixed2.0.0

Version2.0.0 beta 3
Problem"-maxsize 0" does not reset archive with unlimited messages allowed. +
SolutionProblem fixed and now works as documented.
Fixed2.0.0

Version2.0.0 beta 3
ProblemNon-ASCII text encodings (=?ISO-..?...) are not properly decoded when EDITIDX is set. +
SolutionThe charset filter libraries are now loaded for EDITIDX. +
Fixed2.0.0

Version2.0.0 beta 3
ProblemMODTIME resource setting not remembered across archive updates. +
SolutionMODTIME resource is now properly stored in the database. +
Fixed2.0.0

Version2.0.0 beta 3
ProblemSpecifying -rmm and -single caused confusion on what MHonArc does. +
SolutionThe case is properly handled, with -rmm taking precedence. +
Fixed2.0.0

Version2.0.0 beta 3
Problem4 digit year not checked before 2 digit year when parsing dates. +
SolutionFixed.
Fixed2.0.0

Version2.0.0 beta 3
ProblemSome index pages in multipage indexes not updated when messages expire. +
SolutionFixed; all pages are regenerated when a message expires. +
Fixed2.0.0

Version2.0.0 beta 3
ProblemSetting MONTHS and MONTHSABR had no effect.
SolutionFixed.
Fixed2.0.0

Version2.0.0 beta 3
Problem$TNEXTFROM$ actually gave the value of $NEXTFROM$.
SolutionFixed.
Fixed2.0.0

Version2.0.0 beta 3
ProblemNumerical timezone offsets not handled properly when the offset contained non-zero minutes. This + caused message to be sorted wrong by date. +
SolutionFixed.
Fixed2.0.0

Version2.0.0 beta 3
ProblemSome characters were not properly escaped when specifying the "in URL" modifier to a resource + variable. +
SolutionFixed.
Fixed2.0.0

Version2.0.0 beta 3
ProblemThread (formatting) information lost when a thread is split across multiple pages. +
SolutionFixed. New resources (TCONTBEGIN, TCONTEND, TINDENTBEGIN, TINDENTEND) exist to preserve + formatting of threads across pages. +
Fixed2.0.0

Version2.0.0 beta 3
ProblemIf specifying the REVERSE resource, the next/prev links in messages do not point to the proper + message as one may expect. +
SolutionThis should be fixed by the new behavior of $NEXT...$ and $PREV...$ resource variables. +
Fixed2.0.0

Version2.0.0 beta 2
ProblemPerl aborts with message "Undefined subroutine &main::output_db called ..." when the GENIDX resource + is set. +
SolutionFixed. The output_db function is not applicable when GENIDX is active. +
Fixed2.0.0 beta 3

Version2.0.0 beta 2
ProblemDuplicate resource filenames are not removed from the OTHERINDEXES resource. This caused duplicate work + to be performed. +
SolutionFixed. Any duplicate filenames are removed before applying the OTHERINDEXES resource. +
Fixed2.0.0 beta 3

Version2.0.0 beta 2
ProblemIndexes created via the OTHERINDEXES resource contain no messages. +
SolutionFixed.
Fixed2.0.0 beta 3

Version2.0.0 beta 2
ProblemThe markup defined by TSUBLISTEND may appear when there is no corresponding TSUBLISTBEG. +
SolutionFixed.
Fixed2.0.0 beta 3

Version2.0.0 beta 1
ProblemA multipart boundary specified with a capital boundary parameter, and not in quotes, was not recognized. +
SolutionFixed
Fixed2.0.0 beta 2

Version1.2.3
ProblemGeneration of links of message-ids when editting messages w/o consideration that the message-ids + may already be linked. This caused nested anchor + markup. +
SolutionFixed. Only new message-ids are checked for.
Fixed2.0.0 beta 1

Version1.2.2
ProblemThe ';' character may appear in derived files if the "usename" option is set for the mhexternal.pl filter. +
SolutionFixed.
Fixed1.2.3

Version1.2.2
ProblemThe '/' character is not properly recognized in e-mail addresses when e-mail addressess are being converted + to mailto links in message headers. +
SolutionFixed.
Fixed1.2.3

Version1.2.2
ProblemDatabase read failures occur in add operations on MS-DOS systems. +
SolutionFixed (?)
Fixed1.2.3

Version1.2.1
ProblemThe TIDXPGEND resource actually sets the value of the TIDXPGBEG resource. +
SolutionFixed.
Fixed1.2.2

Version1.2.0
ProblemMHonArc will abort execution under MS-DOS due to regular expression error. +
SolutionFixed.
Fixed1.2.1

Version1.2.0
Probleminstall.me will abort execution under MS-DOS due to regular expression error. +
SolutionFixed.
Fixed1.2.1

Version1.2.0
ProblemA reverse index listing is incorrect if the index size is less than the archive size. +
SolutionFixed.
Fixed1.2.1
+ + +
+ +

+[Prev][Next][TOC][FAQ][Bugs][Home] +

+ + + +
+
+97/05/22 20:02:37
+ +MHonArc
+Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
+
+ + + diff --git a/doc/contacts.html b/doc/contacts.html index 09c1fac..7bca7a5 100644 --- a/doc/contacts.html +++ b/doc/contacts.html @@ -1,68 +1,106 @@ + -MHonArc v1.2.2 -- Contacts +MHonArc -- Contacts -[Previous][Contents][FAQ][Bugs][Home] -
-

Contacts -

+ +

+[Prev][Next][TOC][FAQ][Bugs][Home] +

+
-

Mailing List -

-

A mailing list, mhonarc@rosat.mpe-garching.mpg.de, is available to provide a -discussion forum on the usage and development of MHonArc. Appropriate topics -for the list include: usage questions, bug reports, behavioral enhancements, -documentation bugs, and general help. -

-

To subscribe to the mailing list, send mail to -mhonarc-request@rosat.mpe-garching.mpg.de with the command, -

-
subscribe
+

Contacts

+ +
+

Mailing List

+ +

A mailing list, mhonarc@rosat.mpe-garching.mpg.de, is available to +provide a discussion forum on the usage and development of +MHonArc. Appropriate topics for the list include: usage +questions, bug reports, behavioral enhancements, documentation bugs, +and general help.

+ +

To subscribe to the mailing list, send mail to mhonarc-request@rosat.mpe-garching.mpg.de with the command,

+
+subscribe
 

as the message body.

-

If you send mail mhonarc@rosat.mpe-garching.mpg.de, your message will be -distributed to all subscribers on the list. -

-

The mailing list is archived by Majordomo. You can also use the WWW to access -the archive (with full text search using glimpse) at -<URL:http://www.rosat.mpe-garching.mpg.de/mailing-lists/mhonarc/> + +

If you send mail mhonarc@rosat.mpe-garching.mpg.de, your message will be +distributed to all subscribers on the list.

+ +

The mailing list is archived by Majordomo. You +can also use the WWW to access the archive (with +full text search using glimpse) at <URL:http://www.rosat.mpe-garching.mpg.de/mailing-lists/mhonarc/>

-
-

People -

+ +
+

People

+ +

The people listed here are those responsible for development +and support of MHonArc.

Earl Hood
-ehood@isogen.com - -

Main developer of MHonArc. Contact for bug reports, behavioral -enhancements, documentation bugs, and Unix usage issues. +ehood@medusa.acs.uci.edu +

Creator and developer of MHonArc. Also author +of the documention, for what it is worth.

+
Steve Pacenka
sp17@cornell.edu - -

Contributing developer. Worked on isolating code that would conflict -with MS-DOS. Contact for MS-DOS installation problems or MS-DOS -usage issues. +

Contributer: Helped in making MHonArc run under MS-DOS/Windows +environments.

+
Achim Bohnet
-ach@rosat.mpe-garching.mpg.de +ach@rosat.mpe-garching.mpg.de +

Administrator, and maintainer, of the +MHonArc mailing list.

-

Contributing developer. Administrator, and maintainer, of the MHonArc -mailing list. -

+
+
MHonArc users
+mhonarc@rosat.mpe-garching.mpg.de +

Everyone who helps answer questions and make comments +to improve the quality of MHonArc. +

+

-[Previous][Contents][FAQ][Bugs][Home] + +

+[Prev][Next][TOC][FAQ][Bugs][Home] +

+ + +
+
+97/05/15 16:53:45
+ +MHonArc
+Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
+
+ diff --git a/doc/details.html b/doc/details.html deleted file mode 100644 index 44ee035..0000000 --- a/doc/details.html +++ /dev/null @@ -1,185 +0,0 @@ - - - -MHonArc v1.2.2 -- Gory Details - - -[Previous][Next][Contents][FAQ][Bugs][Home] -
- -

Gory Details -

- -

This sections explain in detail how MHonArc functions. Knowing the material -covered in this section may help you when trouble shooting. -

-
-

OS Detection -

- -

MHonArc will automatically detect which operating system it is running under. If -the following list of conditions are true, MHonArc assumes it is running under -MS-DOS: -

-
    -
  • The COMSPEC environment variable is defined. -
  • The value of the COMSPEC environment variable is a legal MS-DOS -pathname. -
  • The value of the COMSPEC environment variable is an executable file. -

-

If any of the above conditions is false, MHonArc assumes it is running under Unix. -

-
-
NOTE - -

The previous conditions are used since the conditions will exist if Perl has -been installed on an MS-DOS machine. None of the above conditions exist -when Perl is installed on a Unix system. -

-
-

Processing Steps -

- -

This section describes the steps MHonArc performs when creating/editting an -archive. Anytime messages are added or deleted or the index page layout is -changed, MHonArc will perform the following steps. -

-
    -
  • Creates a lock file. This insures only one MHonArc process is updating the -archive at any given moment. See Archive Integrity for more information. -

  • Reads the database file. The name, and location, of the database file can be -explicitly specified via the M2H_DBFILE and M2H_OUTDIR environment -variables or the command-line options -dbfile and -outdir. -Otherwise, the current working directory is used. -

    NOTE: The database file must be in the same location as the archive since the -M2H_OUTDIR variable and -outdir option also specify the location of the -archive. -

    The database file contains data to update any mail threads and the -resource settings when MHonArc was last invoked. This allows new -messages to contain the same formatting/resource specifications as -existing messages in the archive without having to re-specify the resources -each time new messages are added. Resources defined in the database file -override the environment variables. -

    NOTE: If no database file is found, MHonArc will create a new archive. -

  • Read the MHonArc resource file, if specified. The resource file will override -any settings contained in the database file. -

  • Read the settings specified on the command-line. Command-line options -override any settings in the database and/or resource file. -

  • Update archive. -

  • Rewrites the index pages to reflect the update. -

  • Writes a new database file containing the new state of the archive and all -(new) resource settings. -

-

Normally, knowing all the previous steps is unnecessary. However, it may be -useful to be aware of them if unexpected behavior, or errors, occur. -

-
-

Archive Integrity -

- -

MHonArc applies safeguards to try to insure that a mail archive does not get -corrupted due to exceptional circumstances. MHonArc does the following to insure -a mail archive does not get corrupted: -

-
    -
  • MHonArc creates a lock file, ".mhonarc.lck", when creating/updating -an archive. The lock file insures that only one MHonArc process is -modifying an archive at any given moment. The -locktries -command-line option, or the M2H_LOCKTRIES environment variable, -allows you to control how long a given MHonArc process will wait if an -archive is currently locked. If MHonArc can not lock the archive after the -specified number of tries, MHonArc will exit, unless the -force option is -specified. -

  • MHonArc will ignore the following signals once messages are actually -being written to disk: SIGABRT, SIGHUP, SIGINT, SIGQUIT, SIGPIPE, -SIGTERM. Possible archive corruption can still occur if a SIGKILL signal -is received since SIGKILLs are uncatchable. A SIGKILL will also prevent -MHonArc from deleting the lock file. -

-
-

File Formats -

- -

Database File -

- -

The MHonArc database file is actual Perl code. MHonArc requires it like any other -Perl library to load in the contents of the database. -

-
-
CAUTION - -

You should never modify the database file by hand. Changing the file by -hand could cause future incorrect/unpredictable behavior when -processing the archive. -

-

Index and Message Files -

- -

The indexes and message files are legal HTML documents. However, manual -editting of the documents is discouraged. The documents contain special comment -declarations. The comment declarations act as markers which allow MHonArc to -correctly edit the documents when needed. -

-

The comment declarations look like the following: -

-
<!--X-Body-Begin-->
-<!--X-User-Header-->
-<!--X-User-Header-End-->
-<!--X-TopPNI-->
-...
-
-
- -

Derived Files -

- -

Derived files are files that are generated by the MIME filters. These files are created -when the data being processed in messages cannot be converted to HTML (eg. -images, postscript, video, binaries). The format of these files depend on the -content-type of the data. -

-
-

Notes -

- -
    -
  • Here is the explicit order of decreasing precedence when setting -resources/options: -

      -
    • command-line options (highest precedence) -
    • resource file -
    • database file -
    • environment variables (lowest precedence) -

    -
  • Mail thread detection is dependent upon the mail messages containing the -message id(s) of referenced messages. Most mailers reply function will -automatically include the message id of the message being replied to. -

  • All mail message being converted into HTML are stored in memory before -they are written to disk. This can eat up much memory if many mail -messages are being converted. If you are processing multiple -mailboxes/folders and worried about memory, you can try the following: -

      -
    • Invoke MHonArc on each one separately using the -add option. -
    • Or, invoke MHonArc with the -savemem option. -

    -
  • The database file, and the index pages, are completely rewritten evertime -new messages are added. This may cause slight slow-downs when -archives become very large. -

  • When reading MH mail folders, mail message are assumed to have -numeric filenames. -

  • When sorting by date, MHonArc tries to use the date listed in the first -Received field of the message. If no Received field exists, than the Date field -is used. -

  • No distinction is made, in the output, on which messages came from -which mail folder if multiple mail folders are processed. -

  • MHonArc can probably be modified to handle other types of mailers -(which has been done since the original version only supported MH mail -folders). The MSGSEP resource gives flexibility in processing Unix style -mailbox files. -

- -
-[Previous][Next][Contents][FAQ][Bugs][Home] - - diff --git a/doc/diagnos.html b/doc/diagnos.html index b1d7a80..5853032 100644 --- a/doc/diagnos.html +++ b/doc/diagnos.html @@ -1,231 +1,240 @@ - -MHonArc v1.2.2 -- Diagnostics - +MHonArc -- Diagnostics + -[Previous][Next][Contents][FAQ][Bugs][Home] -
-

Diagnostics -

+ +

+[Prev][Next][TOC][FAQ][Bugs][Home] +

+ -

Three types of messages exist in MHonArc: Informative messages, Warnings, and -Errors. Informative messages give you the current status of MHonArc's execution. -Warnings signify undesired conditions, but are not critical in MHonArc's exection. -Errors signify critical conditions that inhibit MHonArc from finishing its task. -

-

Another set of messages exists that are generated from the Perl interpreter itself. -MHonArc tries its best to catch any conditions that may cause Perl to abnormally -abort, but conditions may arise where this is not possible. -

-

This section describes the various diagnostics MHonArc may produce and -messages Perl may produce. -


-

Informative messages -

-

Informative messages may be suppressed via the -quiet command-line option. -Only the more important Informative messages are listed here. -

-

Could not process message with given Content-Type: ... -

+

Diagnostics

-

MHonArc will output this statement in filtered mail messages for content-types it -is unable to process. See Default Filters in MIME for content-types that MHonArc -supports by default. See Writing Filters for adding new filters into MHonArc. -

-

This is the only Informative message that does not go to standard output, but into -the actual filtered mail message. -

-

No new messages -

+

Three types of messages exist in MHonArc: +Informative messages, Warnings, and +Errors. Informative messages give you the +current status of MHonArc's execution. Warnings +signify undesired conditions, but are not critical in +MHonArc's exection. Errors signify critical +conditions that inhibit MHonArc from finishing its task.

-

No mail messages exist when performing an add operation to an archive. This can -occur if an empty MH mail folder, or empty mailbox file, is passed to MHonArc. -

-

Requiring MIME filter libraries ... -

+

Another set of messages exists that are generated from the Perl +interpreter itself. MHonArc tries its best to catch any +conditions that may cause Perl to abnormally abort, but conditions +may arise where this is not possible.

This section describes +the various diagnostics MHonArc may produce and messages +Perl may produce.

-

Indicates MHonArc is loading external libraries for filtering mail messages. -MHonArc will output each library it loads. See MIME for more information of filter -libraries. -

-

Trying to lock mail archive ... -

+
+

Informative messages

-

The statement means that a lock file is in place for the archive you are trying to -update. Normally, an existing lock file implies that another MHonArc process is -currently using the archive, and other MHonArc processes will wait awhile to see -if the archive will be unlocked. -

-

However, there are times when a lock file exists, but no MHonArc process is -modifying the archive. This can occur if MHonArc is abnormally terminated. If you -know that no other MHonArc process is editting the archive you are try to modify, -then manually remove the lock file or use the -force option. -

-

See Archive Integrity for more information. -

-
-

Warnings -

+

Informative messages may be suppressed via the +QUIET resource. +Only the more important Informative messages are listed here.

-

Warning messages denote some undesired event occurred, but the event is not -severe enough to cause program termination. -

-

Warning: Could not find date for message -

+

No new messages

-

MHonArc was unable to find a received/sent date for a mail message. With respect -to other mail messages, a message with no received/sent date is first in -chronological order. -

-

Warning: Database (<dbversion>) != program (<prgversion>) version -

- -

Indicates that the version of MHonArc updating an archive is different from the -version of MHonArc that created the database file. Problems can arise if the -database file changes in format from different version of MHonArc. See the release -notes of the MHonArc distribution if changes in the databse format has effects on -older archives. +

No new mail messages exist when performing an add operation to an +archive. This can occur if an empty MH mail folder, or empty +mailbox file, is passed to MHonArci; or the folder +contains messages already in the archive.

-

Warning: Unable to create <outdir>/<dbfile> -

-

Indicates MHonArc was unable to create the database file <dbfile> for the mail -archive created/modified in <outdir>. This message can occur if <outdir> -permissions changed during MHonArc execution, the existing <dbfile> is read-only, -or the file system is full. -

-

This message can be severe because no future add operations can be performed to -the archive. -

-

Warning: Unable to open footer: <footer> -

+

Requiring MIME filter libraries ...

-

MHonArc was unable to open the footer file, <footer>, for inclusion into the index -page. Make sure <footer> exists, and is readable by you. -

-

Warning: Unable to open header: <header> -

+

Indicates MHonArc is loading external libraries for +filtering mail messages. MHonArc will output each library +it loads. See MIMEFILTERS for more +information of filter libraries.

-

MHonArc was unable to open the header file, <header>, for inclusion into the index -page. Make sure <header> exists, and is readable by you. -

-

Warning: Unable to open <folder> -

+

Trying to lock mail archive ...

-

MHonArc was unable to open the specified mail <folder> for reading. Make sure -<folder> exists and is readable (and executable if a directory) by you. -

-

Warning: Unable to open message: <folder>/<message> -

+

The statement means that a lock file is in place for the archive +you are trying to update. Normally, an existing lock file implies +that another MHonArc process is currently using the archive, +and other MHonArc processes will wait awhile to see if the +archive will be unlocked.

-

MHonArc was unable to open the specified MH mail message <folder>/<message> -for reading. Make sure <folder>/<message> exists and is readable by you. -

-

Warning: Unable to open resource file: <file> -

+

However, there are times when a lock file exists, but no +MHonArc process is modifying the archive. This can occur +if MHonArc is abnormally terminated. If you know that no +other MHonArc process is editting the archive you are +try to modify, then manually remove the lock file or use the +FORCE resource.

-

MHonArc was unable to open the resource file, <file>, for reading. Make sure <file> -exists, and is readable by you. -

-

Warning: Undefined time zone: "<timezone>" -

+
+

Warnings

-

MHonArc has found an unrecognized timezone acronym, <timezone>, in a mail -message. You can tell MHonArc about other timezone acronyms, and their hour -offset to UTC, by using the TIMEZONES resource element of the Resource File. -

-

The timezone UTC (or GMT) is used for an undefined timezone acronym -

-
-

Errors -

+

Warning messages denote some undesired event occurred, but the +event is not severe enough to cause program termination.

-

Errors denote conditions that cause MHonArc to abort execution. -

-

Some error conditions may cause the MHonArc archive to become corrupted. If the -error occurs when MHonArc is writing files, you may have to recreate the archive -from the original messages. -

-

ERROR: Database read error of <dbfile> -

+

Warning: Could not find date for message

-

An error occured when trying to read an archive's database. The error can occur if -the database file is not readable or the file got corrupted. +

MHonArc was unable to find a date for a +mail message, or could not parse the date if the date is not +in a common format. The message is given the current date +if no date is found.

-

ERROR: Unable to create <file> -

-

MHonArc was unable to create <file>. This message can occur if the directory being -written to is not writable, a read-only file with the same name exists, or the file -system is full. -

-

ERROR: Unable to create <lockfile> after <#> tries -

+

Warning: Database (dbversion) +!= program (prgversion) version

-

The statement means that a lock file is in place for the archive you are trying to -update. -

-

Sometimes a lock file exists, but no MHonArc process is modifying the archive. This -can occur if MHonArc is abnormally terminated. If you know that no other -MHonArc process is editting the archive you are try to modify, then manually -remove the lock file or use the -force option. -

-

ERROR: Unable to open <file> -

+

Indicates that the version of MHonArc updating an archive +is different from the version of MHonArc that created the +database file. Problems can arise if the database file changes in +format from different version of MHonArc. See the release +notes of the MHonArc distribution if changes in the databse +format will effect older archives.

-

MHonArc was unable to open <file> for reading. Make sure <file> exists, and is -readable by you. -

-

ERROR: Unable to require newgetopt.pl -

+

Warning: Unable to create outdir/dbfile

-

The newgetopt.pl library is needed for MHonArc to parse the command-line. -newgetopt.pl is part of the standard Perl distribution. Make sure Perl has been -correctly installed at your site. -

-

ERROR: Unable to require timelocal.pl -

+

Indicates MHonArc was unable to create the +database file dbfile for the mail archive +created/modified in outdir. This message can occur if +outdir permissions changed during MHonArc +execution, the existing dbfile is read-only, or the +file system is full.

-

The timelocal.pl library is needed for MHonArc to process dates in messages. -timelocal.pl is part of the standard Perl distribution. Make sure Perl has been -correctly installed at your site. -

-

ERROR: Unable to require <file> -

+

This warning can be severe because no future add operations can +be performed to the archive.

-

This message signifies MHonArc was unable to require the library <file>. Make sure -you properly installed MHonArc via the installation program. If <file> is your own -custom filter, make sure you properly registered it in the Resource File. See also -Specifying Filters and the PERLINC resource element. +

Warning: Unable to open footer: footer

+ +

MHonArc was unable to open the footer file, +footer, for inclusion into the index page. Make sure +footer exists, and is readable by you.

+ +

Warning: Unable to open header: header +

+ +

MHonArc was unable to open the header file, +header, for inclusion into the index page. Make sure +header exists, and is readable by you.

+ +

Warning: Unable to open folder

+ +

MHonArc was unable to open the specified mail +folder for reading. Make sure folder +exists and is readable (and executable if a directory) by you.

+ +

Warning: Unable to open message: folder/message +

+ +

MHonArc was unable to open the specified MH +mail message folder/message for reading. Make sure +folder/message exists and is readable by you.

+ +

Warning: Unable to open resource file: file +

+ +

MHonArc was unable to open the resource file, +file, for reading. Make sure file exists, and +is readable by you.

+ +

Warning: Undefined time zone: "timezone" +

+ +

MHonArc has found an unrecognized timezone +acronym, timezone, in a mail +message. You can tell MHonArc about other timezone +acronyms, and their hour offset to UTC, by using the TIMEZONES resource

-
-

Perl Messages -

-

Generally, if execution is aborted and the following error messages appear, then -you will have to manually delete the lock file since MHonArc will not have the -chance to delete the file. +

The timezone UTC (or GMT) is used for an undefined timezone acronyms.

-

Can't locate <file> in @INC at <file> line <number>. -

-

A library that MHonArc tried to load was not found in the Perl include search -paths. This error usually implies that MHonArc was not installed correctly. Make -sure that MHonArc was installed via the install.me program that is provided in -the MHonArc distribution. +


+

Errors

+ +

Errors denote conditions that cause MHonArc to abort +execution.

+ +

Some error conditions may cause the MHonArc archive to +become corrupted. If the error occurs when MHonArc is writing +files, you may have to recreate the archive from the original messages.

-

<file> did not return a true value at <file> line <number>. -

-

If you are using your own MIME filters with MHonArc, make sure the library files -return 1. +

ERROR: Database read error of dbfile

+ +

An error occured when trying to read an archive's database. The +error can occur if the database file is not readable or the file +got corrupted.

+ +

ERROR: Unable to create file

+ +

MHonArc was unable to create file. This +message can occur if the directory being written to is not writable, a +read-only file with the same name exists, or the file system is full.

+

ERROR: Unable to create lockfile after # tries +

+ +

The statement means that a lock file is in place for the archive +you are trying to update.

+ +

Sometimes a lock file exists, but no MHonArc +process is modifying the archive. This can occur if +MHonArc is abnormally terminated. If you know that no +other MHonArc process is editting the archive you are +try to modify, then manually remove the lock file or use the FORCE resource.

+ +

ERROR: Unable to open file

+ +

MHonArc was unable to open file for reading. Make +sure file exists, and is readable by you.

+ +

ERROR: Unable to require perl-library

+ +

Make sure you properly installed MHonArc. Also +make sure Perl is installed properly if the library is a standard +Perl library. +

+ +
+

Perl Messages

+ +

Generally, if execution is aborted and the following error messages +appear, then you will have to manually delete the lock file since +MHonArc will not have the chance to delete the file.

+ +

Can't locate file in @INC at file line number. +

+ +

A library that MHonArc tried to load was not found +in the Perl include search paths. This error usually implies +that MHonArc was not installed correctly. Make sure that +MHonArc was installed via the install.me program +that is provided in the MHonArc distribution.

+ +

file did not return a true value at file line number.

+ +

If you are using your own MIME filters with MHonArc, make +sure the library files return 1.

+ +
+ +

+[Prev][Next][TOC][FAQ][Bugs][Home] +

+ +
-[Previous][Next][Contents][FAQ][Bugs][Home] +
+97/05/15 16:48:57
+ +MHonArc
+Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
+
+ diff --git a/doc/glossary.html b/doc/glossary.html deleted file mode 100644 index 6b081cf..0000000 --- a/doc/glossary.html +++ /dev/null @@ -1,48 +0,0 @@ - - - -MHonArc v1.2.2 -- Glossary - - -[Previous][Next][Contents][FAQ][Bugs][Home] -
- -

Glossary -

- -
-
HTML - -

Hypertext Markup Language. HTML is the main document markup -language for the World Wide Web. -

-
-
MIME - -

Multipurpose Internet Mail Extensions. MIME allows the transmission of -non-ASCII data, and mixed content data, in electronic mail messages. -

-
-
MH - -

Message Handler. MH is a free message handling system initially -developed by the RAND Corporation, with subsequent development done -at the University of Califonia: Irvine. -

-
-
Perl - -

Practical Extraction and Report Language. Perl is an interpreted -programming language suited for processing text and generating reports. -

-
-
SGML - -

Standard Generalized Markup Language. SGML is a language for -document representation. -

- -
-[Previous][Next][Contents][FAQ][Bugs][Home] - - diff --git a/doc/indexpg.html b/doc/indexpg.html deleted file mode 100644 index c344dfe..0000000 --- a/doc/indexpg.html +++ /dev/null @@ -1,422 +0,0 @@ - - - -MHonArc v1.2.2 -- Index Page Customization - - -[Previous][Next][Contents][FAQ][Bugs][Home] -
- -

Index Page Customization -

- -

MHonArc creates an index page with links to all mail messages filtered (unless -processing a single message with the -single option). MHonArc allows you to -have complete customization over the appearance of the index page by setting -various resource either through environment variables, command-line options, or -the resource file. -

-
-

Filename -

- -

By default, the filename of the index page is "maillist.html". However, a -different name may be specified with the M2H_IDXFNAME environment variable, -the IDXFNAME resource element, or the -idxfname command-line option. -

-
-

Beginning Markup -

- -

MHonArc allows you to completely override the begining markup of the index -page. I.e. You can control the opening <HTML> tag, the HEAD element contents, -the opening <BODY> tag, etc. Therefore, if you are not satisfied with the default -behavior of how the TITLE resource is used, or have other needs that require -control on the beginning markup, you can set the IDXPGBEGIN resource file -element. -

-

IDXPGBEGIN -

- -

The best way to show how the IDXPGBEGIN works, the following represents the -default setting MHonArc uses: -

-
<IDXPGBEGIN>
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
-<HTML>
-<HEAD>
-<TITLE>$IDXTITLE$</TITLE>
-</HEAD>
-<BODY>
-<H1>$IDXTITLE$</H1>
-</IDXPGBEGIN>
-
-
- -
-
NOTE - -

Technically, setting the TITLE resource, via the M2H_TITLE environment -variable, the TITLE resource element, or the -title command-line -option, sets the $IDXTITLE$ resource file variable. -

-

The resource variables allowed in the IDXPGBEGIN element are the following: -

-
    -
  • $DOCURL$ -- URL to documentation -
  • $GMTDATE$ -- Current GMT date. -
  • $IDXFNAME$ -- Filename of main index page. -
  • $IDXSIZE$ -- Max number of messages that may be listed in the index. -
  • $IDXTITLE$ -- The title of the index page. -
  • $LOCALDATE$ -- Current local date. -
  • $NUMOFIDXMSG$ -- Number of message listed. -
  • $NUMOFMSG$ -- Number of messages in the archive. -
  • $OUTDIR$ -- Pathname of archive. -
  • $PROG$ -- Program name. -
  • $TIDXFNAME$ -- Filename of thread index page. -
  • $TIDXTITLE$ -- Title of thread index page. -
  • $VERSION$ -- Program version. -
-

See Resource Variables for more information on the usage of variables. -

-
-

End Markup -

- -

Since MHonArc allows you to control the beginning markup, it makes sense for it -to allow you to control the ending markup. -

-

IDXPGEND -

- -

The IDXPGEND resource element may be used to define the ending markup of the -index page. The default value is the following: -

-
<IDXPGEND>
-</BODY>
-</HTML>
-</IDXPGEND>
-
-
- -

The resource variables allowed are the same as for IDXPGBEGIN. -

-
-

Include Files -

- -

MHonArc allows you to include the contents of files into the index page via the -header and footer resources. -

-
-
NOTE - -

The use of include files is discouraged since the LISTBEGIN and LISTEND -resources can be used to achieve the same results. Also, the support for the -include resource may be removed in future releases. -

-

The header file is specified via the M2H_HEADER environment variable, the -HEADER resource element, or the -header command-line option. The contents of -the header file are inserted above the message listing, and right after the H1 title -element. -

-
-
NOTE - -

Filename should not contain the <HTML>, <HEAD>, and <BODY> tags; these -tags are automatically provided by MHonArc, or defined by the -IDXPGBEGIN resource file element. -

-

The footer file is specified via the M2H_FOOTER environment variable, the FOOTER -resource element, or the -footer command-line option. The contents of the footer -file are inserted after the message listing. -

-
-
NOTE - -

Filename should not contain the </BODY>, and </HTML> tags; these tags -are automatically provided by MHonArc, or defined by the IDXPGEND -resource file element. -

-

The header and footer files allow you to incorporate search-forms, hyperlinks to -other pages, or any other HTML markup you like. -

-

It is only necessary to specify the header and/or footer files the first time you create -an archive. The contents included from the header and/or footer files are -preserved in any subsequent additions to the archive. Only respecify the header -and/or footer files if you need to make changes to the header/footer contents. -

-
-

Listing Layout -

- -

MHonArc lists messages in the order specified by the various sort options. -However, you have complete control on how the message listing are formatted via -the LISTBEGIN, LITEMPLATE, and LISTEND resource elements in the Resource -File. These elements allow you to specify the HTML markup to use in the index -page. -

-

LISTBEGIN -

- -

The LISTBEGIN resource element specifies the text to begin the message list. The -text can be any valid HTML markup. Plus, MHonArc defines the following -variables you may use which get expanded at run-time: -

-
    -
  • $DOCURL$ -- URL to documentation -
  • $GMTDATE$ -- Current GMT date. -
  • $IDXFNAME$ -- Filename of main index page. -
  • $IDXSIZE$ -- Max number of messages that may be listed in the index. -
  • $IDXTITLE$ -- The title of the index page. -
  • $LOCALDATE$ -- Current local date. -
  • $NUMOFIDXMSG$ -- Number of message listed. -
  • $NUMOFMSG$ -- Number of messages in the archive. -
  • $OUTDIR$ -- Pathname of archive. -
  • $PROG$ -- Program name. -
  • $TIDXFNAME$ -- Filename of thread index page. -
  • $TIDXTITLE$ -- Title of thread index page. -
  • $VERSION$ -- Program version. -
-

MHonArc's LISTBEGIN default value is the following: -

-
<LISTBEGIN>
-<UL>
-<LI><A HREF="$TIDXFNAME$">Thread Index</A></LI>
-</UL>
-<HR>
-<UL>
-</LISTBEGIN>
-
-
- -

If the NOTHREAD resource is set, the following is the default value: -

-
<LISTBEGIN>
-<HR>
-<UL>
-</LISTBEGIN>
-
-
- -

LITEMPLATE -

- -

The LITEMPLATE resoure element defines the HTML text to represent each -message list item. You may use the following variables which are expanded at -runtime: -

-
    -
  • $A_ATTR$ -- The NAME and HREF attributes to use in an anchor to link to -the archived message. The NAME attribute links the messages to the index -page. -
  • $A_HREF$ -- The HREF attribute to use in an anchor to link to the archived -message. -
  • $A_NAME$ -- The NAME attributes to use in an anchor for messages to link -to the index page. -
  • $DATE$ -- The date of the message. -
  • $DDMMYY$ -- Message date in dd/mm/yy format. -
  • $ICON$ -- The context-type sensistive icon. See Icons for information. -
  • $ICONURL$ -- The URL to the context-type sensistive icon. See Icons for -information. -
  • $MMDDYY$ -- Message date in mm/dd/yy format. -
  • $NUMFOLUP$ -- Number of follow-ups for the given message. -
  • $FROM$ -- The complete text in the From: field of the message. -
  • $FROMADDR$ -- The e-mail address in the From: field of the message. -
  • $FROMNAME$ -- The English name of the person in the From: field of the -message. If no English name is found, the username specified in the e-mail -address is used. -
  • $MSGNUM$ -- The message numbers assigned to the message by MHonArc. -
  • $ORDNUM$ -- The current listing number of the message. -
  • $SUBJECT$ -- The subject text of the message wrapped in an anchor -element that hyperlinks to the message. -
  • $SUBJECTNA$ -- The subject text of the message without the anchor -element. -
  • $YYMMDD$ -- Message date in yy/mm/dd format. -
-

-

-
-
NOTE - -

Do not specify $A_ATTR$, $A_NAME, and $SUBJECT$ together in the -LITEMPLATE element. Since all of these variables contain the NAME -atrribute. Invalid HTML will be created since multiple anchors will have -the same NAME identifier. -

-

LITEMPLATE's default value is the following: -

-
<LITEMPLATE> 
-<LI><STRONG>$SUBJECT$</STRONG> 
-<UL><LI><EM>From</EM>: $FROM$</LI></UL> 
-</LI> 
-</LITEMPLATE> 
-
-
- -

LISTEND -

- -

The LISTEND resource element specifies the text to use to end the message list. The -text can be any valid HTML markup. LISTEND may contain the same variables as -LISTBEGIN. -

-

LISTEND's default value is the following: -

-
<LISTEND> 
-</UL> 
-</LISTEND> 
-
-
- -
-

Icons -

- -

MHonArc supports the ability to insert icons in the index page for each message -based on the message's content-type. For example: You can have text/plain -messages use a different icon than text/html messages. -

-

Defining Icons -

- -

To specify the icons for MHonArc to use, you use the ICONS resource element in -the Resource File. The format of each line in the ICONS element is as follows: -

-

<content-type>:<URL for icon> -

-

<content-type> represents a MIME content-type. <URL for icon> is the URL to the -icon. The special content-type called "unknown" may be defined to specify the -icon to use for non-recognized content-types. If unknown is not defined, the -text/plain icon is used for unknown content types. -

-

Example -

- -
<ICONS>
-audio/basic:http://foo.org/gifs/gsound.gif
-image/gif:http://foo.org/gifs/gimage.gif
-image/jpeg:http://foo.org/gifs/gimage.gif
-image/tiff:http://foo.org/gifs/ggraphic.gif
-multipart/alternative:http://foo.org/gifs/gmulti.gif
-multipart/digest:http://foo.org/gifs/gtext.gif
-multipart/mixed:http://foo.org/gifs/gdoc2.gif
-multipart/parallel:http://foo.org/gifs/gdoc.gif
-text/richtext:http://foo.org/gifs/gdoc.gif
-text/html:http://foo.org/gifs/gdoc.gif
-text/plain:http://foo.org/gifs/gletter.gif
-unknown:http://foo.org/gifs/gunknown.gif
-video/mpeg:http://foo.org/gifs/gmovie.gif
-</ICONS>
-
-
- -

Using Icons -

- -

In order to incorporate icons into the index page, insert the $ICON$ variable into -the LITEMPLATE resource element. -

-

Example -

- -
<litemplate>
-$ICONURL$<strong>$SUBJECT:40$</strong>
-($NUMFOLUP$) <em>$FROMNAME$</em><br>
-</litemplate>
-
-
- -

The $ICON$ variable expands to the IMG HTML element with the appropriate -URL in the SRC attribute to the icon. The ALT attribute of the IMG element contains -the content-type of the message, surrounded by []'s, for use with text based -browsers. -

-

$ICONURL$ may also be used if you want redefine the format of the IMG element. -

-

Example -

- -
<litemplate>
-<img src="$ICONURL$" alt="* "><strong>$SUBJECT:40$</strong>
-($NUMFOLUP$) <em>$FROMNAME$</em><br>
-</litemplate>
-
-
- -

This example overrides what is normally used in the ALT attribute. -

-
-

Examples -

- -

Example 1 -

- -

It may be easier to see how the LISTBEGIN, LITEMPLATE, LISTEND resource -elements work when declared together: -

-
<!-- This represents the default values used by MHonArc -->
-<LISTBEGIN>
-<UL>
-<LI><A HREF="$TIDXFNAME$">Thread Index</A></LI>
-</UL>
-<HR>
-<UL>
-</LISTBEGIN>
-
-<LITEMPLATE> 
-<LI><STRONG>$SUBJECT$</STRONG> 
-<UL><LI><EM>From</EM>: $FROM$</LI></UL> 
-</LI> 
-</LITEMPLATE> 
-
-<LISTEND> 
-</UL> 
-</LISTEND> 
-
-
- -

Example 2 -

- -

Here's another example that changes the layout into a more compact listing, adds -Icons usage, and adds a time stamp information on when the index page was last -updated: -

-
<listbegin>
-<address>
-Last update: $CURDATE$<br>
-$NUMOFMSG$ messages<br>
-</address>
-<p>
-<UL>
-<LI><A HREF="$TIDXFNAME$">Thread Index</A></LI>
-</UL>
-<p>
-Messages listed in chronological order.  Listing format is the following:
-<blockquote>
-<img src="http://foo.org/gifs/gletter.gif" alt="* ">
-<strong>Subject</strong>
-(# of follow-ups)
-<em>From</em>.
-</blockquote>
-<p>
-<hr>
-</listbegin>
-
-<litemplate>
-<img src="$ICONURL$" alt="* "><strong>$SUBJECT:40$</strong>
-($NUMFOLUP$) <em>$FROMNAME$</em><br>
-</litemplate>
-
-<listend>
-</listend>
-
-
- - -
-[Previous][Next][Contents][FAQ][Bugs][Home] - - diff --git a/doc/install.html b/doc/install.html deleted file mode 100644 index 37b9f1b..0000000 --- a/doc/install.html +++ /dev/null @@ -1,381 +0,0 @@ - - - -MHonArc v1.2.2 -- Installation - - -[Previous][Next][Contents][FAQ][Bugs][Home] -
- -

Installation -

- -

This section instructs you on how to install and get MHonArc running on your -machine. The section covers Unix installation and MS-DOS/Windows installation. -

-
-
NOTE - -

For brevity, anything that applies to MS-DOS also applies to Windows. -

-
-

System Requirements -

- -

MHonArc is written in Perl 4. Therefore, you must have Perl 4 or 5 installed on your -system. If you do not know if Perl is installed on your system, ask your system -administrator. -

-

If Perl is not installed on your system, you can retrieve Perl at -<URL:http://www.cis.ufl.edu/perl/ftp.html>. I recommend version 4.0 -patchlevel 34, or later. MHonArc has not been tested on earlier versions. -

-
-
NOTE - -

MHonArc makes use of the Perl libraries newgetopt.pl and -timelocal.pl. These libraries are part of the normal Perl distribution. -

-
-

Extracting the Distribution File -

- -

Before extracting the distribution file, you may want copy the distribution file into -scratch directory, and work in there during installation. -

-

Tar/Gzip Distribution -

- -

You must have gzip and tar installed on your system. If gzip is not installed, you -may obtain gzip at <URL:ftp://prep.ai.mit.edu/pub/gnu>. Tar comes with all -Unix systems. However, MS-DOS users may have to obtain tar. -

-

To extract the file, type the following command at your shell's prompt: -

-
-
Unix - -

zcat MHonArc.tar.gz | tar xvof - -

-
-
MS-DOS - -

gunzip -dv MHonArc.tar.gz
-tar xvf MHonArc.tar -

-

A directory called "MHonArc" should be created. The directory contains all the -files need for installing MHonArc. -

-
-
NOTE - -

The actual name of the distribution file may differ from the example given. -

-

Zip Distribution -

- -

You must have pkzip or unzip installed on your system. -

-

To extract the file, type the following command at your shell's prompt: -

-

unzip mhonarc.zip
-

-OR
-
-pkunzip -d mhonarc.zip -

-
-
IMPORTANT - -

The directory structure of the zip file must be preserved during extraction -to insure proper installation. -

-

A directory called "MHonArc" should be created. The directory contains all the -files need for installing MHonArc. -

-
-
NOTE - -

The actual name of the distribution file may differ from the example given. -

-
-

Installing the Software -

- -

Once you have extracted the distribution file, change your current working -directory into the MHonArc directory created during the extraction of the -distribution file. -

-

Example: Assuming you are in the directory you extracted the distribution file in, -you can type the following on your command-line: -

-
-
Unix - -

cd MHonArc -

-
-
MS-DOS - -

cd MHONARC -

-

install.me -

- -

Contained in the MHonArc directory is a Perl program called "install.me". This -program will perform the tasks required to install MHonArc on you machine. The -install program is capable of running interactively, or in batch. -

-

Interactive Mode -

- -

To run install.me in interactive mode, type the following at your shell's -prompt: -

-

perl install.me -

-
-
NOTE - -

Make sure you are in the same directory as the install.me program. -

-

The program will then prompt you for the necessary information to install -MHonArc on your system. -

-

Here's an example (Unix) session: -

-
% perl install.me
-MHonArc Installation
-====================
-The installation process will ask you a series of questions on where
-the Perl executable is and where to put MHonArc files.  Just hit <CR>
-to accept the default values listed in ()'s.
-
-If directory path does not exist on your system, the installation
-program will create the path for you.
-
------------------------------------------------
-Note:  Make sure all pathnames are absolute.
------------------------------------------------
-
-Hit <CR> to continue ...
-Perl executable ("/usr/local/bin/perl")
--> /usr/bin/perl
-Location to install programs ("/usr/local/bin")
--> /mnt/ehood/bin
-Location to install libraries ("/usr/local/lib/MHonArc")
--> /mnt/ehood/lib/MHonArc
-Install documentation ("y")?  y
-Location to install docs ("/usr/local/lib/MHonArc/doc")
--> /mnt/ehood/lib/MHonArc/doc
-
-You've specified the following:
-        Perl location: /usr/bin/perl
-        Program directory: /mnt/ehood/bin
-        Library directory: /mnt/ehood/lib/MHonArc
-        Doc directory: /mnt/ehood/lib/MHonArc/doc
-Is this correct ("y")?  y
-Installing the following into /mnt/ehood/bin
-        mhonarc
-Installing the following into /mnt/ehood/lib/MHonArc
-        base64.pl
-        mhexternal.pl
-        mhtxthtml.pl
-        mhtxtplain.pl
-        mhtxtsetext.pl
-        qprint.pl
-        readmail.pl
-Installing the following into /mnt/ehood/lib/MHonArc/doc
-        mhonarc.txt
-        ...
-
-
- -

Batch Mode -

- -

To run install.me in batch mode, type the following at your shell's prompt: -

-

perl install.me install.cfg -

-
-
NOTE - -

Make sure you are in the same directory as the install.me program. -

-

The install.cfg contains the necessary information for intalling MHonArc on -your system. You will need to edit install.cfg to reflect your installation -requirements. -

-

Here is an example install.cfg: -

-
# Should executables be installed. 0 => NO, non-zero => YES.
-#
-$dobin = 1;
-
-# Should libraries be installed. 0 => NO, non-zero => YES.
-#
-$dolib = 1;
-
-# Should documentation be installed. 0 => NO, non-zero => YES.
-#
-$dodoc = 1;
-
-# Location for executable.  If using ms-dos, use something like
-# 'C:\\BIN'.
-#
-$bindir  = '/usr/local/bin';
-
-# Location for libraries.  If using ms-dos, use something like
-# 'C:\\LIB\\MHONARC'.
-#
-$libdir  = '/usr/local/lib/MHonArc';
-
-# Location for documents.  If using ms-dos, use something like
-# 'C:\\DOC\\MHONARC'.
-#
-$docdir  = '/usr/local/lib/MHonArc/doc';
-
-# Location of perl executable.  If using ms-dos, use something like
-# 'C:\\BIN\\PERL.EXE'.
-#
-$perlprg = '/usr/local/bin/perl';
-
-
-1; # DO NOT DELETE THIS LINE
-
-
- -

The file is Perl code, and therefore, must follow Perl syntax rules: -

-
    -
  • Anything following a `#' character is ignored. -
  • Strings values need to be enclosed in quotes. -
  • If you need to use a backslash in a string value, it must be escaped with a -backslash. Example: 'C:\\LIB\\MHONARC'. The same applies to the '$' -character. -
  • All statements must end with a semi-colon. -
  • The "1;" line must not be deleted. -
-
-
NOTE - -

You can verify the syntax of the configuration file by invoking "perl -c" -on the file. -

-

After you have successfully executed install.me, MHonArc is ready to use. -

-

MS-DOS Post install.me Note -

- -

If you would like the ability to run MHonArc like other programs, then create a -batch file that contains something like the following: -

-
@ECHO OFF
-C:\BIN\PERL.EXE C:\BIN\MHONARC %1 %2 %3 %4 %5 %6 %7 %8 %9
-
-
- -

Of course, you will need to change the paths to Perl and MHonArc to suit your -systems configuration. -

-

Sample batch files are available in the MHonArc distribution. -

-

Notes on install.me -

- -
    -
  • If you do not know the location of the Perl executable on your system, ask -your system administrator. -

  • All pathnames must be absolute. -

  • If a path does not exist that you specify, the path will be automatically -created if running in interactive mode. In batch mode, all paths specified -must already exist. -

  • During the installation process, the main MHonArc source file is modified -to be aware of the location of the Perl executable and MHonArc's library -files. If you ever need to install MHonArc in a different location, rerun the -install.me program. -

    NOTE: Location of the Perl exectuble is only relevant for Unix systems. -MS-DOS systems do not make use of the "#!" line in scripts. -

  • MHonArc requires the use of timelocal.pl and newgetopt.pl. These -libraries are part of the normal Perl distribution. -

-
-

Tested Environments -

- -

This section covers software environments MHonArc has worked successfully. -Feedback is welcome about other success, or failure, stories covering MHonArc -usage in other environments. -

-

Perl -

- -

MHonArc is known to work with the following version of Perl 4, or later: -

-

$RCSfile: perl.c,v $$Revision: 4.0.1.7 $$Date: 92/06/08 -14:50:39 $
-Patch level: 34
-

-

MHonArc is known also to work with Perl 5.001m and Perl 5.002 beta2. -

-
-
NOTE - -

The version numbers are based upon the Unix versions of Perl. DOS -version numbers may differ. -

-

Unix -

- -

Mail Software -

- -
    -
  • MH -
  • Elm, Mail, mail, and any other mail software that stores e-mail in UUCP -style mailbox format. UUCP format is where mail messages are separated -by a line beginning with "From " (I.e. the word "From" followed by a -space). You may need to utilize the MSGSEP resource if the message -separator is different from standard mailbox files (eg. MMDF format). -

-

News Software -

- -

Different news software store messages differently. Messages are either stored in a -format similiar to MH or similiar to a mailbox file: -

-
    -
  • MH style is where the messages are stored in a directory with each post a -separate file, and each file has a numeric filename. -

  • Mailbox style is where messages are stored in a single file. You may need -to utilize the MSGSEP resource if the message separator is different from -standard mailbox files. -

-

MS-DOS -

- -

Mail/News Software -

- -

MHonArc has been tested under MS-DOS with message files created by the -following mail and news programs: -

-
    -
  • Eudora -
  • WinVN -
  • Windows Trumpet -
  • NUPop -

-

It also works with individual RFC822 mail messages, but you must run MHonArc -without a batch file if you need to use redirection. For example: -

-

perl c:\bin\mhonarc <one.msg >one.htm
-perl c:\bin\mhonarc -add <one.msg

- -

- -
-[Previous][Next][Contents][FAQ][Bugs][Home] - - diff --git a/doc/intro.html b/doc/intro.html index 2b62428..97aef02 100644 --- a/doc/intro.html +++ b/doc/intro.html @@ -1,77 +1,116 @@ + -MHonArc v1.2.2 -- Introduction +MHonArc -- Introduction -[Next][Contents][FAQ][Bugs][Home] + + +

+[Prev][Next][TOC][FAQ][Bugs][Home] +

+
-

Introduction -

+

Introduction

+ +

MHonArc is a Perl +program for converting e-mail messages as specified in RFC 822 and +the +MIME standard to HTML. +MHonArc can perform the following tasks:

-

MHonArc is a Perl program for converting e-mail messages as specified in RFC 822 -and RFC 1521 (MIME) to HTML. MHonArc can perform the following tasks: -

    -
  • Convert mh(1) mail folders or UUCP/Unix style mailboxes into an HTML -mail archive. -
  • Add or remove messages to an existing HTML mail archive generated by -MHonArc. -
  • Convert a single message to HTML. -

+
  • Convert MH +mail folders or UUCP/Unix style mailboxes into an HTML mail archive. +
  • Add or remove messages to an existing HTML mail archive generated +by MHonArc. +
  • Convert a single message to HTML. + +

    Along with these tasks, MHonArc provides the following:

    +
      -
    • A main customizable index page for mail messages archived. -
    • A customizable thread index page listing messages by thread. +
    • A main customizable index for mail messages archived. +
    • A customizable thread index listing messages by thread.
    • Control over message formatting.
    • The ability to hook in your own custom message filters.
    -
    -

    Why Use MHonArc? -

    + +
    +

    Why Use MHonArc?

    Here are some reasons for using MHonArc:

    +
      -
    • You want to keep organized archives of mail messages and/or news -articles for a World Wide Web (WWW) server; complete with live -hypertext pointers to their authors and to any url's mentioned. -
    • You would like to control the layout of mail/news archives to keep a -consistent style to your WWW pages. -
    • You have a WWW client, but no MIME mail reader. MHonArc will allow -you to read MIME messages that includes images, audio, video, etc via -your Web client. -
    • Muli-platform support: MS-DOS and Unix. -
    • You think the MHonArc logo is really cool, and it deserves to be used. + +
    • You want to keep organized archives +of mail messages and/or news articles for a World Wide +Web (WWW) server; complete with live hypertext pointers +to their authors and to any url's mentioned. + +
    • You would like to control the layout of mail/news archives to +keep a consistent style to your WWW pages. + +
    • You have MIME messages that you want to include in your archives. + +
    • You have a WWW client, but no MIME mail reader. MHonArc +will allow you to read MIME messages that includes images, audio, +video, etc via your Web client. + +
    • Muli-platform support: Unix and MSDOS/Windows (MacOS?) + +
    • You think the MHonArc logo is really cool, and it deserves +to be used. +
    • You like Perl, and you want to see what it can do. + +
    • You need a mail archiving utility that can work under Perl 4 +and 5. +
    • Just cuz.
    -
    -

    Supported Platforms -

    -

    MHonArc (version 1.1, or later) will run under Unix or MS-DOS operating systems -with Perl 4 or 5 installed. -

    -
    -

    Availability -

    +
    +

    Supported Platforms

    -

    The latest information on MHonArc, and its availability, may be obtained at -<URL:http://www.oac.uci.edu/indiv/ehood/mhonarc.html>. +

    MHonArc (version 1.1, or later) will run under Unix or +MSDOS/Windows operating systems with Perl 4 or 5 installed. Execution +under MacOS has not been verified.

    -
    -

    About the Documentation -

    -

    The documentation is oriented towards Unix users. However, the section on -Installation does conver MS-DOS installation instructions. Notes are made in the -documentation when something may differ due to the operating system. +


    +

    Availability

    + +

    The latest information on MHonArc, where to get more help, +and its availability, may be obtained at <URL:http://www.oac.uci.edu/indiv/ehood/mhonarc.html>.


    -[Next][Contents][FAQ][Bugs][Home] + +

    +[Prev][Next][TOC][FAQ][Bugs][Home] +

    + + + +
    +
    +97/05/15 16:48:58
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + diff --git a/doc/layout.html b/doc/layout.html new file mode 100644 index 0000000..7c5b44b --- /dev/null +++ b/doc/layout.html @@ -0,0 +1,186 @@ + + + +MHonArc -- Page Layout + + + + + +

    +[Prev][Next][TOC][FAQ][Bugs][Home] +

    + +
    + + +

    Page Layout

    + +

    The section describes the layout of the pages created by +MHonArc. Each page's layout is controlled by resources +(see MHonArc Resources). +To simplify the description of each type of page created +by MHonArc, the following notation is used: +

    + +
    +
    ( )
    +
    Parentheses denote a group of resources. +
    +
    ?
    +
    Denotes that preceding resource, or group, is +optional. +
    +
    *
    +
    Denotes that preceding resource, or group, can +occur zero or more times. +
    +
    +
    +
    Denotes that preceding resource, or group, can +occur one or more times. +
    +
    + + +
    +

    Main Index Page

    + +

    The main index is normally the default index of an +archive. The main index list messages by date, +subject, author, or message number. +Since date listing is the default, the +main index is commonly referred to as the date index. +

    + +

    Main index page resource layout

    + +
    +IDXPGBEGIN
    +    HEADER
    +	LISTBEGIN
    +	(AUTHORBEGIN |
    +	 DAYBEGIN |
    +	 SUBJECTBEGIN)?
    +	LITEMPLATE+
    +	(AUTHOREND |
    +	 DAYEND |
    +	 SUBJECTEND)?
    +         LISTEND
    +    FOOTER
    +    DOC
    +IDXPGEND
    +
    + +

    Main index pages also contain comment declarations. Some of the +comment declarations are vital markers to allow MHonArc +to properly edit the index during archive updates. +

    + + +
    +

    Thread Index Page

    + +

    The thread index list messages by thread. Threads +are based upon In-Reply-To and References fields of +messages and by same Subjects. +

    + +

    The layout of a thread index page is more complicated +than other pages since threads are more +complex than a regular date or subject listing. +Also, MHonArc tries to provide the greatest +flexibility for customizing thread listing layout. +

    + +

    Thread index page resource layout

    + +
    +TIDXPGBEGIN
    +    THEAD
    +	((TTOPBEGIN
    +	    TSUBLISTBEG
    +		((TLITXT
    +		    [possible subthread listing]
    +		  TLIEND)|
    +		(TLINONE
    +		    [possible subthread listing]
    +		 TLINONEEND))+
    +	    TSUBLISTEND
    +	    (TSUBJECTBEG
    +		((TLITXT
    +		    [possible subthread listing]
    +		  TLIEND)|
    +		(TLINONE
    +		    [possible subthread listing]
    +		 TLINONEEND))+
    +	     TSUBJECTEND)?
    +	  TTOPEND)
    +	 |
    +	 TSINGLETXT)* [message w/o references or follow-ups]
    +    TFOOT
    +    DOC
    +TIDXPGEND
    +
    + +

    If the previous is not confusing enough, there are four other resources +for controlling the thread index page layout: +TCONTBEGIN, +TCONTEND, +TINDENTBEGIN, +TINDENTEND. +If the multiple page resource is +set, it is possible that a thread can span more than one page. These +resources are used to restart a thread that has been clipped due to +a page boundary. +

    + + +
    +

    Message Page

    + +

    The message page contains a single message converted +to HTML and archive navigational links. +

    + +

    Message page resource layout

    + +
    +MSGPGBEGIN
    +    MSGHEAD
    +    TOPLINKS
    +    SUBJECTHEADER
    +    Converted message header
    +    HEADBODYSEP
    +    Converted message body
    +    FOLREFS
    +    BOTLINKS
    +    MSGFOOT
    +MSGPGEND
    +
    + +

    Message pages also contain comment declarations. Some of the +comment declarations are vital markers to allow MHonArc +to properly edit the message when needed during updates. +

    + +
    + +

    +[Prev][Next][TOC][FAQ][Bugs][Home] +

    + + + +
    +
    +97/05/15 17:14:33
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + + diff --git a/doc/message.html b/doc/message.html deleted file mode 100644 index 313d4d9..0000000 --- a/doc/message.html +++ /dev/null @@ -1,510 +0,0 @@ - - - -MHonArc v1.2.2 -- Message Customization - - -[Previous][Next][Contents][FAQ][Bugs][Home] -
    - -

    Message Customization -

    - -

    This sections shows how to customize the appearance of messages when -converted to HTML. -

    -
    -

    Beginning Markup -

    - -

    MHonArc allows you to completely override the begining markup of the message -pages. I.e. You can control the opening <HTML> tag, the HEAD element contents, the -opening <BODY> tag, etc. Therefore, if you are not satisfied with the default -markup used, or have other needs that require control on the beginning markup, -you can set the MSGPGBEGIN resource file element. -

    -

    MSGPGBEGIN -

    - -

    The MSGPGBEGIN resource file element has the default value: -

    -
    <MSGPGBEGIN>
    -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    -<HTML>
    -<HEAD>
    -<TITLE>$SUBJECTNA:72$</TITLE>
    -<LINK REV="made" HREF="mailto:$FROMADDR$">
    -</HEAD>
    -<BODY>
    -</MSGPGBEGIN>
    -
    -
    - -

    The following variables may be used in the MSGPGBEGIN element: -

    -
      -
    • $DATE$ -- Message date. -
    • $DDMMYY$ -- Message date in dd/mm/yy format. -
    • $DOCURL$ -- URL to documentation. -
    • $FROM$ -- Contents of From field of message. -
    • $FROMADDR$ -- E-mail address contained in From field of message. -
    • $FROMNAME$ -- "English" name contained in From field of message. -
    • $GMTDATE$ -- Current GMT date. -
    • $IDXFNAME$ -- Filename of main index page. -
    • $IDXSIZE$ -- Max number of messages that may be listed in the index. -
    • $IDXTITLE$ -- The title of the index page. -
    • $LOCALDATE$ -- Current local date. -
    • $MMDDYY$ -- Message date in mm/dd/yy format. -
    • $MSGID$ -- Message ID of message. -
    • $MSGNUM$ -- Number assigned to message by MHonArc. -
    • $NUMOFIDXMSG$ -- Number of message listed. -
    • $NUMOFMSG$ -- Number of messages in the archive. -
    • $OUTDIR$ -- Pathname of archive. -
    • $PROG$ -- Program name. -
    • $SUBJECTNA$ -- Message subject text. -
    • $TIDXFNAME$ -- Filename of thread index page. -
    • $TIDXTITLE$ -- Title of thread index page. -
    • $VERSION$ -- Program version. -
    • $YYMMDD$ -- Message date in yy/mm/dd format. -
    -
    -

    End Markup -

    - -

    The ending markup of messages can be controlled by the MSGPGEND resource file -element. -

    -

    MSGPGEND -

    - -

    The MSGPGEND resource element may be used to define the ending markup of the -message pages. The default value is the following: -

    -
    <MSGPGEND>
    -</BODY>
    -</HTML>
    -</MSGPGEND>
    -
    -
    - -

    The resource variables allowed are the same as for MSGPGBEGIN. -

    -
    -

    Header and Footer -

    - -

    The MSGHEAD resource represents HTML text that should be inserted at the very -beginning of each converted message. The MSGFOOT resource represents HTML -text that should be appended to the end of each converted message. The default -value for both resources is empty. The following variables may be used in the -MSGHEAD and MSGFOOT content: -

    -
      -
    • $DATE$ -- Message date. -
    • $DDMMYY$ -- Message date in dd/mm/yy format. -
    • $DOCURL$ -- URL to documentation. -
    • $FROM$ -- Contents of From field of message. -
    • $FROMADDR$ -- E-mail address contained in From field of message. -
    • $FROMNAME$ -- "English" name contained in From field of message. -
    • $GMTDATE$ -- Current GMT date. -
    • $IDXFNAME$ -- Filename of main index page. -
    • $IDXSIZE$ -- Max number of messages that may be listed in the index. -
    • $IDXTITLE$ -- The title of the index page. -
    • $LOCALDATE$ -- Current local date. -
    • $MMDDYY$ -- Message date in mm/dd/yy format. -
    • $MSGID$ -- Message ID of message. -
    • $MSGNUM$ -- Number assigned to message by MHonArc. -
    • $OUTDIR$ -- Pathname of archive. -
    • $PROG$ -- Program name. -
    • $SUBJECTNA$ -- Message subject text. -
    • $TIDXFNAME$ -- Filename of thread index page. -
    • $TIDXTITLE$ -- Title of thread index page. -
    • $VERSION$ -- Program version. -
    • $YYMMDD$ -- Message date in yy/mm/dd format. -
    -
    -

    Navigational Links -

    - -

    MHonArc gives you the ability to control the layout of the navigational links for -each message page. Navigational links include links to previous and next -messages, link to main index, link to thread index, etc. The layout of the -navigational links are controlled by two resource file elements: TOPLINKS and -BOTLINKS. -

    -

    TOPLINKS -

    - -

    The TOPLINKS resource element defines the layout of the navigational links at the -top of each message page. The markup defined, will appear after the MSGHEAD -data and before the filtered message data. -

    -

    The default value for TOPLINKS is the following: -

    -
    <TOPLINKS>
    -<HR>
    -$PREVBUTTON$$NEXTBUTTON$<A HREF="$IDXFNAME$#$MSGNUM$">[Index]</A><A 
    -HREF="$TIDXFNAME$#$MSGNUM$">[Thread]</A>
    -</TOPLINKS>
    -
    - -
    -
    - -

    If no thread index is specified, then the thread link markup is removed. The -following variables are available: -

    -
      -
    • $DATE$ -- Message date. -
    • $DDMMYY$ -- Message date in dd/mm/yy format. -
    • $DOCURL$ -- URL to documentation. -
    • $FROM$ -- Contents of From field of message. -
    • $FROMADDR$ -- E-mail address contained in From field of message. -
    • $FROMNAME$ -- "English" name contained in From field of message. -
    • $GMTDATE$ -- Current GMT date. -
    • $IDXFNAME$ -- Filename of main index page. -
    • $IDXSIZE$ -- Max number of messages that may be listed in the index. -
    • $IDXTITLE$ -- The title of the index page. -
    • $LOCALDATE$ -- Current local date. -
    • $MMDDYY$ -- Message date in mm/dd/yy format. -
    • $MSGID$ -- Message ID of message. -
    • $MSGNUM$ -- Number assigned to message by MHonArc. -
    • $NEXTBUTTON$ -- Next button markup. See Conditional Links for more -information. -
    • $NEXTFROM$ -- Contenst of From field of the next message according to -the list order of the main index. -
    • $NEXTFROMADDR$ -- E-mail address contained in From field of the next -message according to the list order of the main index. -
    • $NEXTFROMNAME$ -- English" name contained in From field of the next -message according to the list order of the main index. -
    • $NEXTLINK$ -- Next link markup. See Conditional Links for more -information. -
    • $NEXTMSG$ -- Filename of next message according to the list order of the -main index. -
    • $NEXTMSGNUM$ -- Number assigned to next message according to the list -order of the main index. -
    • $NEXTSUBJECT$ -- Subject of next message according to the list order of -the main index. -
    • $NUMOFIDXMSG$ -- Number of message listed. -
    • $NUMOFMSG$ -- Number of messages in the archive. -
    • $PREVBUTTON$ -- Previous button markup. See Conditional Links for -more information. -
    • $PREVFROM$ -- Contenst of From field of the previous message according -to the list order of the main index. -
    • $PREVFROMADDR$ -- E-mail address contained in From field of the -previous message according to the list order of the main index. -
    • $PREVFROMNAME$ -- English" name contained in From field of the -previous message according to the list order of the main index. -
    • $PREVLINK$ -- Previous link markup. See Conditional Links for more -information. -
    • $PREVMSG$ -- Filename of previous message according to the list order of -the main index. -
    • $PREVMSGNUM$ -- Number assigned to previous message according to the -list order of the main index. -
    • $PREVSUBJECT$ -- Subject of previous message according to the list order -of the main index. -
    • $PROG$ -- Program name. -
    • $SUBJECTNA$ -- Message subject text. -
    • $TIDXFNAME$ -- Filename of thread index page. -
    • $TIDXTITLE$ -- Title of thread index page. -
    • $VERSION$ -- Program version. -
    • $YYMMDD$ -- Message date in yy/mm/dd format. -
    -

    BOTLINKS -

    - -

    The BOTLINKS resource element defines the layout of the navigational links at the -bottom of each message page. The markup defined, will appear after the filtered -message data and any thread links, and before the MSGFOOT data. -

    -

    The default value for BOTLINKS is the following: -

    -
    <BOTLINKS>
    -<HR>
    -<UL>
    -$PREVLINK$
    -$NEXTLINK$
    -<LI>Index(es):
    -<UL>
    -<LI><A HREF="$IDXFNAME$#$MSGNUM$"><STRONG>Main</STRONG></A></LI>
    -<LI><A HREF="$TIDXFNAME$#$MSGNUM$"><STRONG>Thread</STRONG></A></LI>
    -</BOTLINKS>
    -
    - -
    -
    - -

    If no thread index is specified, then the thread link markup is removed. The -variables available for BOTLINKS are the same as for TOPLINKS. -

    -

    Conditional Links -

    - -

    Since the state of some navigational links can change due the position of the -message in the archive (eg. first and last messages), special resources exist that -allows you to control the markup of some of the links based upon if the link is valid -or not for a given message. -

    -

    The resource elements for defining the conditional links are the following: -PREVBUTTON, NEXTBUTTON, PREVLINK, and NEXTLINK, and their inactive -counterparts, PREVBUTTONIA, NEXTBUTTONIA, PREVLINKIA, and NEXTLINKIA. -The appropriate value of these elements (ie. if it is active, or inactive) are -represented by the $PREVBUTTON$, $NEXTBUTTON$, $PREVLINK$, and -$NEXTLINK$ resource file variables, respectively, which may be used in other -resource elements' contents (TOPLINKS and BOTLINKS in particular). -

    -

    The defaults values for each conditional link resource is as follows: -

    -

    PREVBUTTON -

    -
    <PREVBUTTON>
    -<A HREF="$PREVMSG$">[Prev]</A>
    -</PREVBUTTON>
    -
    -
    - -

    NEXTBUTTON -

    -
    <NEXTBUTTON>
    -<A HREF="$NEXTMSG$">[Next]</A>
    -</NEXTBUTTON>
    -
    -
    - -

    PREVLINK -

    -
    <PREVLINK>
    -<LI>Prev: <STRONG><A HREF="$PREVMSG$">$PREVSUBJECT$</A></STRONG></LI>
    -</PREVLINK>
    -
    -
    - -

    NEXTLINK -

    -
    <NEXTLINK>
    -<LI>Next: <STRONG><A HREF="$NEXTMSG$">$NEXTSUBJECT$</A></STRONG></LI>
    -</NEXTLINK>
    -
    -
    - -

    All the "IA" elements default to empty content. -

    -
    -
    NOTE - -

    The last newline for the PREVBUTTON, NEXTBUTTON, PREVBUTTONIA, -and NEXTBUTTONIA elements is ignored by MHonArc. This allows a -"tight" grouping of button links; ie. no space between buttons. If you -desire to have a newline in the content, just insert a trailing blank line at -the end of the element's content. -

    -

    You should note that there is a correlation between the value of the conditional -links elements and the contents of the TOPLINKS and BOTLINKS elements. -

    -

    The following variables may be used within the conditional link elements. -

    -
      -
    • $NEXTFROM$ -- Contenst of From field of the next message according to -the list order of the main index. -
    • $NEXTFROMADDR$ -- E-mail address contained in From field of the next -message according to the list order of the main index. -
    • $NEXTFROMNAME$ -- English" name contained in From field of the next -message according to the list order of the main index. -
    • $NEXTMSG$ -- Filename of next message according to the list order of the -main index. -
    • $NEXTMSGNUM$ -- Number assigned to next message according to the list -order of the main index. -
    • $NEXTSUBJECT$ -- Subject of next message according to the list order of -the main index. -
    • $PREVFROM$ -- Contenst of From field of the previous message according -to the list order of the main index. -
    • $PREVFROMADDR$ -- E-mail address contained in From field of the -previous message according to the list order of the main index. -
    • $PREVFROMNAME$ -- English" name contained in From field of the -previous message according to the list order of the main index. -
    • $PREVMSG$ -- Filename of previous message according to the list order of -the main index. -
    • $PREVMSGNUM$ -- Number assigned to previous message according to the -list order of the main index. -
    • $PREVSUBJECT$ -- Subject of previous message according to the list order -of the main index. -
    -

    -

    -
    -
    WARNING - -

    Never include conditional link variables ($PREVBUTTON$, -$NEXTBUTTON$, $PREVLINK$, and $NEXTLINK$) in conditional link -element content. This will cause an infinite loop during execution and will -eventually lead to a crash due to a lack of memory. -

    -
    -

    Message Layout -

    - -

    Defining the format for the actual mail message data is divided into two parts: the -message head and the message body. Customizing the message header markup is -described in this section, but due to the nature of how messages are processed, the -message body format is controlled by the various MIME filters directly (see the -section on MIME for further details). -

    -

    Excluding Fields -

    - -

    The EXCS resource allows you to specify what fields should be excluded in the -HTML output. -

    -

    EXCS -

    - -

    Each line of the EXCS element specifies a mail header field to exclude in the -converted HTML output. Each line is treated as a Perl regular expression (NOTE: -the regular expression is already anchored to the begining of the line). -

    -

    The default value for EXCS is the following: -

    -
    <EXCS>
    -content-
    -errors-to
    -forward
    -lines
    -message-id
    -mime-
    -nntp-
    -originator
    -path
    -precedence
    -received
    -replied
    -return-path
    -status
    -via
    -x-
    -</EXCS>
    -
    -
    - -

    Any fields you specify for the EXCS resource will augment the default list, unless -the "Override" attribute is specified. If "Override" is specified, the default list -is discarded along with any other lists specified from previous EXCS elements; and -only header fields specified in the EXCS element are excluded. -

    -

    Field Order -

    - -

    The FIELDORDER resource allows you to control the order the message header -fields appear in the HTML output. -

    -

    FIELDORDER -

    - -

    Each line of the FIELDORDER element is the exact case-insensitive name of a -message header field. The order the fields are listed is the order they will appear in -the filtered message. The special field value "-extra-" represents all fields not -explicitly specified in the FIELDORDER element and not excluded by the EXCS -element. Extra fields are listed in sorted order. -

    -

    The following represents the default value of the FIELDORDER resource: -

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

    Field Formatting -

    - -

    The FIELDSTYLES and LABELSTYLES resources allow to control how each -message header field is formatted. -

    -

    FIELDSTYLES -

    - -

    Each line in the FIELDSTYLES element defines HTML elements to wrap around -the field text in mail headers (e.g. "To: field text", "From: field text"). The format -of each line is "field_name:html_element". This specifies to wrap -html_element around the text associated with field_name. If html_element -is empty, then the field text is not wrapped in any element. -

    -

    MHonArc defines a special field_name called "-default-". This is default -HTML element to wrap field text in if no explicit specific element is defined for the -label. -

    -

    field_name must be the exact name of a header field name, but character case is -ignored. -

    -

    The default value of FIELDSTYLES is the following: -

    -
    <FIELDSTYLES>
    --default-
    -</FIELDSTYLES>
    -
    -
    - -

    LABELSTYLES -

    - -

    Each line in the LABELSTYLES element defines HTML elements to wrap around -labels in mail headers (e.g. "To:", "From:"). The format of each line is -"field_name:html_element". This specifies to wrap html_element around -field_name. If html_element is empty, then the label is not wrapped in any -element. -

    -

    MHonArc defines a special field_name called "-default-". This is default -HTML element to wrap a label in if no explicit specific element is defined for the -label. -

    -

    field_name must be the exact name of a header field name, but character case is -ignored. -

    -

    The default value of LABELSTYLES is the following: -

    -
    <LABELSTYLES>
    --default-:em
    -</LABELSTYLES>
    -
    -
    - -
    -

    Other Resources -

    - -

    E-mail Links -

    - -

    MAILTOURL -

    - -

    URL to use for e-mail address hyperlinks in e-mail message header fields. The -following variables are defined for the MAILTOURL resource: -

    -
      -
    • $FROM$ -- Who the message is from. -
    • $MSGID$ -- Message ID of the message. -
    • $SUBJECT$ -- The subject of the message. -
    • $TO$ -- Destination e-mail address of link. -
    -

    MHonArc will use the following URL by default: "mailto:$TO$". -

    -
    -
    NOTE - -

    The MAILTOURL resource has different rules for variable expansion. If a -variable does not exactly match the set of variables available for the -MAILTOURL, the variable text will be taken literally as part of the element -content. Therefore, a single "$" can be used to represent a "$" character. -

    Also, variables in the MAILTOURL should NOT have ":NU" modifier. This -will prevent the variables from be recognized. MHonArc will -automatically treat the replacement value as a part of a URL string. -

    - -
    -[Previous][Next][Contents][FAQ][Bugs][Home] - - diff --git a/doc/mhonarc.1 b/doc/mhonarc.1 deleted file mode 100644 index 13e8f60..0000000 --- a/doc/mhonarc.1 +++ /dev/null @@ -1,3787 +0,0 @@ -.TH MHonArc 1 -.SH NAME -MHonArc \- Mail\-to\-HTML converter -.SH DESCRIPTION -.in 0 -.nf - - [INLINE] - - MHonArc - - An Internet mail\-to\-HTML converter. - - _________________________________________________________________ - -Table of Contents - - * Introduction - + Why Use MHonArc? - + Supported Platforms - + Availability - + About the Documentation - - * Installation - + System Requirements - + Extracting the Distribution File - + Installing the Software - + Tested Environments - - * Quick Start - + Converting MH mail folders or Mailbox files - + Adding Messages to an Archive - + Converting a single message - - * Overview - + Synopsis - + Options - + Environment - - * Resource File - + Resource Syntax - + Resource Elements - + Example Resource File - + Notes on Resource File - - * Adding Messages - + Examples - - * Removing Messages - + Message Numbers - + Scanning an Archive - - * Index Page Customization - + Filename - + Beginning Markup - + End Markup - + Include Files - + Listing Layout - + Icons - + Examples - - * Thread Index Customization - + Filename - + Beginning Markup - + End Markup - + Listing Layout - - * Message Customization - + Beginning Markup - + End Markup - + Header and Footer - + Navigational Links - + Message Layout - + Other Resources - - * MIME - + Default Filters - + Non\-MIME Messages - + Writing Filters - + Specifying Filters - - * Gory Details - + OS Detection - + Processing Steps - + Archive Integrity - + File Formats - + Notes - - * Diagnostics - + Informative messages - + Warnings - + Errors - + Perl Messages - - * Glossary - - * Contacts - + Mailing List - + People - - _________________________________________________________________ - - - Earl Hood - Isogen International Corp - 2200 North Lamar #230 - Dallas, TX 75202 - - Phone: (214) 953\-004 x127 - FAX: (214) 953\-3152 - - _________________________________________________________________ - - - - _________________________________________________________________ - - Introduction - - _MHonArc_ is a Perl program for converting e\-mail messages as - specified in RFC 822 and RFC 1521 (_MIME_) to HTML. _MHonArc_ can - perform the following tasks: - - * Convert mh(1) mail folders or UUCP/Unix style mailboxes into an - HTML mail archive. - * Add or remove messages to an existing HTML mail archive generated - by _MHonArc_. - * Convert a single message to HTML. - - Along with these tasks, _MHonArc_ provides the following: - - * A main customizable index page for mail messages archived. - * A customizable thread index page listing messages by thread. - * Control over message formatting. - * The ability to hook in your own custom message filters. - - _________________________________________________________________ - -Why Use MHonArc? - - Here are some reasons for using _MHonArc_: - - * You want to keep organized archives of mail messages and/or news - articles for a World Wide Web (_WWW_) server; complete with live - hypertext pointers to their authors and to any url's mentioned. - * You would like to control the layout of mail/news archives to keep - a consistent style to your WWW pages. - * You have a WWW client, but no MIME mail reader. _MHonArc_ will - allow you to read MIME messages that includes images, audio, - video, etc via your Web client. - * Muli\-platform support: MS\-DOS and Unix. - * You think the _MHonArc_ logo is really cool, and it deserves to be - used. - * You like Perl, and you want to see what it can do. - * Just cuz. - - _________________________________________________________________ - -Supported Platforms - - _MHonArc_ (version 1.1, or later) will run under Unix or MS\-DOS - operating systems with Perl 4 or 5 installed. - - _________________________________________________________________ - -Availability - - The latest information on _MHonArc_, and its availability, may be - obtained at . - - _________________________________________________________________ - -About the Documentation - - The documentation is oriented towards Unix users. However, the section - on Installation does conver MS\-DOS installation instructions. Notes - are made in the documentation when something may differ due to the - operating system. - - _________________________________________________________________ - - - _________________________________________________________________ - - Installation - - This section instructs you on how to install and get _MHonArc_ running - on your machine. The section covers _Unix_ installation and - _MS\-DOS/Windows_ installation. - - _NOTE_ - For brevity, anything that applies to MS\-DOS also applies to - Windows. - - _________________________________________________________________ - -System Requirements - - _MHonArc_ is written in Perl 4. Therefore, you must have Perl 4 or 5 - installed on your system. If you do not know if Perl is installed on - your system, ask your system administrator. - - If Perl is not installed on your system, you can retrieve Perl at - . I recommend version 4.0 - patchlevel 34, or later. _MHonArc_ has not been tested on earlier - versions. - - _NOTE_ - _MHonArc_ makes use of the Perl libraries newgetopt.pl and - timelocal.pl. These libraries are part of the normal Perl - distribution. - - _________________________________________________________________ - -Extracting the Distribution File - - Before extracting the distribution file, you may want copy the - distribution file into scratch directory, and work in there during - installation. - - Tar/Gzip Distribution - - You must have _gzip_ and _tar_ installed on your system. If _gzip_ is - not installed, you may obtain _gzip_ at - . _Tar_ comes with all Unix - systems. However, MS\-DOS users may have to obtain _tar_. - - To extract the file, type the following command at your shell's - prompt: - - _Unix_ - zcat MHonArc.tar.gz | tar xvof \- - - _MS\-DOS_ - gunzip \-dv MHonArc.tar.gz - tar xvf MHonArc.tar - - A directory called "MHonArc" should be created. The directory contains - all the files need for installing _MHonArc_. - - _NOTE_ - The actual name of the distribution file may differ from the - example given. - - Zip Distribution - - You must have _pkzip_ or _unzip_ installed on your system. - - To extract the file, type the following command at your shell's - prompt: - - unzip mhonarc.zip - - OR - - pkunzip \-d mhonarc.zip - - _IMPORTANT_ - The directory structure of the zip file must be preserved - during extraction to insure proper installation. - - A directory called "MHonArc" should be created. The directory contains - all the files need for installing _MHonArc_. - - _NOTE_ - The actual name of the distribution file may differ from the - example given. - - _________________________________________________________________ - -Installing the Software - - Once you have extracted the distribution file, change your current - working directory into the MHonArc directory created during the - extraction of the distribution file. - - _Example_: Assuming you are in the directory you extracted the - distribution file in, you can type the following on your command\-line: - - _Unix_ - cd MHonArc - - _MS\-DOS_ - cd MHONARC - - install.me - - Contained in the MHonArc directory is a Perl program called - "install.me". This program will perform the tasks required to install - _MHonArc_ on you machine. The install program is capable of running - interactively, or in batch. - - Interactive Mode - - To run install.me in interactive mode, type the following at your - shell's prompt: - - perl install.me - - _NOTE_ - Make sure you are in the same directory as the install.me - program. - - The program will then prompt you for the necessary information to - install _MHonArc_ on your system. - - Here's an example (Unix) session: - -% perl install.me -MHonArc Installation -==================== -The installation process will ask you a series of questions on where -the Perl executable is and where to put MHonArc files. Just hit -to accept the default values listed in ()'s. - -If directory path does not exist on your system, the installation -program will create the path for you. - -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -Note: Make sure all pathnames are absolute. -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- - -Hit to continue ... -Perl executable ("/usr/local/bin/perl") -\-> /usr/bin/perl -Location to install programs ("/usr/local/bin") -\-> /mnt/ehood/bin -Location to install libraries ("/usr/local/lib/MHonArc") -\-> /mnt/ehood/lib/MHonArc -Install documentation ("y")? y -Location to install docs ("/usr/local/lib/MHonArc/doc") -\-> /mnt/ehood/lib/MHonArc/doc - -You've specified the following: - Perl location: /usr/bin/perl - Program directory: /mnt/ehood/bin - Library directory: /mnt/ehood/lib/MHonArc - Doc directory: /mnt/ehood/lib/MHonArc/doc -Is this correct ("y")? y -Installing the following into /mnt/ehood/bin - mhonarc -Installing the following into /mnt/ehood/lib/MHonArc - base64.pl - mhexternal.pl - mhtxthtml.pl - mhtxtplain.pl - mhtxtsetext.pl - qprint.pl - readmail.pl -Installing the following into /mnt/ehood/lib/MHonArc/doc - mhonarc.txt - ... - - Batch Mode - - To run install.me in batch mode, type the following at your shell's - prompt: - - perl install.me install.cfg - - _NOTE_ - Make sure you are in the same directory as the install.me - program. - - The install.cfg contains the necessary information for intalling - _MHonArc_ on your system. You will need to edit install.cfg to reflect - your installation requirements. - - Here is an example install.cfg: - -# Should executables be installed. 0 => NO, non\-zero => YES. -# -$dobin = 1; - -# Should libraries be installed. 0 => NO, non\-zero => YES. -# -$dolib = 1; - -# Should documentation be installed. 0 => NO, non\-zero => YES. -# -$dodoc = 1; - -# Location for executable. If using ms\-dos, use something like -# 'C:\\\\BIN'. -# -$bindir = '/usr/local/bin'; - -# Location for libraries. If using ms\-dos, use something like -# 'C:\\\\LIB\\\\MHONARC'. -# -$libdir = '/usr/local/lib/MHonArc'; - -# Location for documents. If using ms\-dos, use something like -# 'C:\\\\DOC\\\\MHONARC'. -# -$docdir = '/usr/local/lib/MHonArc/doc'; - -# Location of perl executable. If using ms\-dos, use something like -# 'C:\\\\BIN\\\\PERL.EXE'. -# -$perlprg = '/usr/local/bin/perl'; - - -1; # DO NOT DELETE THIS LINE - - The file is Perl code, and therefore, must follow Perl syntax rules: - - * Anything following a `#' character is ignored. - * Strings values need to be enclosed in quotes. - * If you need to use a backslash in a string value, it must be - escaped with a backslash. Example: 'C:\\\\LIB\\\\MHONARC'. The same - applies to the '$' character. - * All statements must end with a semi\-colon. - * The "1;" line must not be deleted. - - _NOTE_ - You can verify the syntax of the configuration file by invoking - "perl \-c" on the file. - - After you have successfully executed install.me, _MHonArc_ is ready to - use. - - MS\-DOS Post install.me Note - - If you would like the ability to run _MHonArc_ like other programs, - then create a batch file that contains something like the following: - -@ECHO OFF -C:\\BIN\\PERL.EXE C:\\BIN\\MHONARC %1 %2 %3 %4 %5 %6 %7 %8 %9 - - Of course, you will need to change the paths to Perl and _MHonArc_ to - suit your systems configuration. - - Sample batch files are available in the _MHonArc_ distribution. - - Notes on install.me - - * If you do not know the location of the Perl executable on your - system, ask your system administrator. - * All pathnames must be absolute. - * If a path does not exist that you specify, the path will be - automatically created if running in interactive mode. In batch - mode, all paths specified must already exist. - * During the installation process, the main _MHonArc_ source file is - modified to be aware of the location of the Perl executable and - _MHonArc_'s library files. If you ever need to install _MHonArc_ - in a different location, rerun the install.me program. - _NOTE_: Location of the Perl exectuble is only relevant for Unix - systems. MS\-DOS systems do not make use of the "#!" line in - scripts. - * _MHonArc_ requires the use of timelocal.pl and newgetopt.pl. These - libraries are part of the normal Perl distribution. - - _________________________________________________________________ - -Tested Environments - - This section covers software environments _MHonArc_ has worked - successfully. Feedback is welcome about other success, or failure, - stories covering _MHonArc_ usage in other environments. - - Perl - - _MHonArc_ is known to work with the following version of Perl 4, or - later: - - $RCSfile: perl.c,v $$Revision: 4.0.1.7 $$Date: 92/06/08 14:50:39 $ - Patch level: 34 - - _MHonArc_ is known also to work with Perl 5.001m and Perl 5.002 beta2. - - _NOTE_ - The version numbers are based upon the Unix versions of Perl. - DOS version numbers may differ. - - Unix - - Mail Software - - * _MH_ - * _Elm_, _Mail_, _mail_, and any other mail software that stores - e\-mail in UUCP style mailbox format. UUCP format is where mail - messages are separated by a line beginning with "From " (I.e. the - word "From" followed by a space). You may need to utilize the - MSGSEP resource if the message separator is different from - standard mailbox files (eg. MMDF format). - - News Software - - Different news software store messages differently. Messages are - either stored in a format similiar to _MH_ or similiar to a mailbox - file: - - * _MH_ style is where the messages are stored in a directory with - each post a separate file, and each file has a numeric filename. - * Mailbox style is where messages are stored in a single file. You - may need to utilize the MSGSEP resource if the message separator - is different from standard mailbox files. - - MS\-DOS - - Mail/News Software - - _MHonArc_ has been tested under MS\-DOS with message files created by - the following mail and news programs: - - * _Eudora_ - * _WinVN_ - * _Windows Trumpet_ - * _NUPop_ - - It also works with individual RFC822 mail messages, but you must run - _MHonArc_ without a batch file if you need to use redirection. For - example: - - perl c:\\bin\\mhonarc one.htm - perl c:\\bin\\mhonarc \-add /inbox - - Where represents the path to the directory that contains the - mail folder _inbox_. If you are in the directory that contains inbox, - then you can leave out the "/". - - _MHonArc_ prints out messages showing its progress as your e\-mail is - processed. When _MHonArc_ finishes, the following files will be - created: - - * maillist.html: The main index file containing links to all mail - messages converted. Messages are listed with subjects and who the - messages are from. All messages are listed in sorted order by date - received/sent. - * threads.html: The file listing messages by thread. - * msg*.html: HTML versions of the mail messages, where * represents - a message number from 0 to the number of message processed minus - 1. - * .mhonarc.db (or MHONARC.DB under MS\-DOS): This database file is - needed inorder for _MHonArc_ to perform additions of new mail - messages to the archive. Information is stored to perform mail - threading updates when new messages are added, as well as any - resources set via Environment variables, Resource File, and/or - command\-line Options. - * _Other_: Depending on the content\-types of the e\-mail messages - converted, other files may be created for images, videos, - binaries, etc. See the section on MIME for more information. - - The format of each converted mail message is as follows: - - * A is inserted in the - HEAD element of HTML mail message file. This allows readers of the - message to send comments to the author of the mail message within - Web browsers that support such functionality (like _Lynx_). - * The title (i.e. TITLE element) contains the subject of the - message. - * Hyperlinks to the previous and next messages and the index pages - are located at the top of the message. - * Next, the subject appears in a H1 element. - * Next, follows the mail header with fields listed in a UL element - surrounded by HR's. - * Next, the actual body of the mail message. - * Next, links to any follow\-up, or referenced, messages. The - messages are listed by subject and who they are from. These links - allows you to easily follow mail threads. - * Last, are verbose links to the previous mail message, next mail - message, and index pages. - - The following is also done for each mail message processed: - - * Links are created in the "References" and "In\-Reply\-To" header - fields, and possibly the message body, if the destination - message\-ids are being processed. - * E\-mail addresses are converted to "mailto" hyperlinks in "To:", - "From:", "Cc:", and "Sender:" mail header fields. Currently, not - all Web browsers support the mailto URL. - * Newsgroups listed in a "Newsgroups:" mail header field are - converted to news hyperlinks. - - _MHonArc_ allows you to specify more than one mail folder to process - on the command\-line. - - _Example_ - % mhonarc /home/ehood/mail/inbox1 /home/ehood/mail/inbox2 ... - - All the files created will be put into the current working directory, - by default. You can control the destination of the output location by - using the \-outdir option. - - _Example_ - % mhonarc \-outdir /home/ehood/htmlarchive - /home/ehood/mail/inbox - - Here is a sample session converting a mail folder: - -% mhonarc ~/mail/inbox -Requiring MIME filter libraries ... - mhexternal.pl - mhtxthtml.pl - mhtxtplain.pl - mhtxtsetext.pl -Converting messages to ./maillist.html -Reading /mnt/ehood/mail/inbox .......... -Writing mail ... -Writing tmp/maillist.html ... -Writing tmp/threads.html ... -10 messages - - _________________________________________________________________ - -Adding Messages to an Archive - - If you have new messages you want to add to an existing archive, you - must utilizing the \-add command\-line option. With the \-add, you can do - the following: - - * Add a mail folder to an archive, or - * Add a single message to an archive. - - Adding a mail folder to an archive in the current working directory - can be done like the following: - - % mhonarc \-add /mailfolder - - If you are not in the same directory as the archive, then you can - specify the location of the archive to add to with the \-outdir option: - - % mhonarc \-add \-outdir /mailfolder - - _NOTE_ - _MHonArc_ will skip any messages that already exist in the - archive. Therefore, _MHonArc_ can be used to rescan the same - mail folder and only convert any new messages it finds. - - If no mail folder arguments are specified, then _MHonArc_ will attempt - to add a _single_ message read in from standard input. - - _Example_ - % mhonarc \-add < single.msg - - Or, from a pipe: - - % cat single.msg | mhonarc \-add - - See the section on Adding Messages for more information and examples - for adding messages to an archive. - - _________________________________________________________________ - -Converting a single message - - _MHonArc_ has the ability to process a single mail message independent - of creating, or modifying, and archive. To convert a single message to - HTML use the \-single command\-line option. The message to process can - be specified by a filename on the command\-line, or by reading the - message from standard input if no file is specified. The filtered - message is sent to standard output. All formatting options apply to - the single message as with messages being processed for an archive, - with the exception of formatting related specificly to archive - processing, like index links and mail thread links. - - Examples - - Input from standard input: - % mhonarc \-single < messagefile > file.html - - Filename on command\-line: - % mhonarc \-single messagefile > file.html - - _________________________________________________________________ - - - _________________________________________________________________ - - Overview - - This section gives an overview of _MHonArc_'s command\-line options and - environment variables. The _MHonArc_ resource file is covered in the - section Resource File. The resource file allows you to specify most of - the resources set by environment variables and command\-line options, - plus it give you the capability of completely customizing the HTML - output generated by _MHonArc_. - - _________________________________________________________________ - -Synopsis - - Invoke _MHonArc_ from your shell with the following syntax: - - % mhonarc [_options_] _mhfolder_... - % mhonarc [_options_] _mailbox_ ... - % mhonarc \-add [_options_] < _message_ - % mhonarc \-single [_options_] < _message_ > _message.html - _% mhonarc \-single [_options_] _message_ > _message.html - _% mhonarc \-rmm [_options_] _msg# _..._ - _ - _________________________________________________________________ - -Options - - The following options are available: - - \-add - - Add new messages to an existing archive. If no mail folder arguments - are given, _MHonArc_ assumes that a _single_ message is being added to - the archive via _standard input_. Otherwise, _MHonArc_ adds the - messages contained in the mail folders specified. - - \-dbfile name - - Use _name_ for the name of _MHonArc_ database file. The default is - ".mhonarc.db" (or "MHONARC.DB" under MS\-DOS). - - _NOTE_ - You should not override the default name unless absolutely - necessary, and you are confident about what you are doing. - - \-docurl url - - Use _url_ as the URL to _MHonArc_ documentation. The default is - "http://www.oac.uci.edu/indiv/ehood/mhonarc.html". - - \-editidx - - This option tells _MHonArc_ to rewrite the index page and re\-edit all - mail messages in the archive. This option is useful if you need to - change the layout of the index page and/or messages. - - \-footer filename - - Insert contents of filename at the bottom of the index page. See - Include Files in Index Page Customization for more information about - the footer file. - - \-force - - Override a lock on an archive if attempts to lock fail. I.e. After - trying unsuccessfully to lock an archive, _MHonArc_ will still perform - the actions requested. - - This option is useful to help dealing with locks that are no longer - valid (i.e. _stale locks_). A stale lock can exist if the _MHonArc_ - process that created the lock abnormally terminated and could not - perform the proper cleanup procedures. - - \-genidx - - Output an index page to standard output based upon the contents of an - archive, and utilizing any extra formatting options specified. - - \-header filename - - Insert contents of _filename_ at the beginning of the index page. See - Include Files in Index Page Customization for more information about - the header file. - - \-help - - Print out a help message about _MHonArc_. - - \-idxfname name - - Sets the name of the main index file to _name_. The default is - "maillist.html". - - \-idxsize # - - Set the maximum number of messages listed in the indexes. - - \-lockdelay # - - The sleep time, in seconds, between attempts to lock the archive. The - default value is 3. - - \-locktries # - - Set the number of time _MHonArc_ tries to lock a mail archive before - processing new messages. The default value is 10. _MHonArc_ waits - approximately 3 seconds before each try. - - See Archive Integrity for more information on the \-locktries options. - - \-mailtourl url - - Use _url_ for e\-mail address hyperlinks in mail message headers. The - url can contain the following _variables_ that get expanded during - run\-time: - - $FROM$ - Who the message is from. - - $MSGID$ - Message ID of the message. - - $SUBJECT$ - The subject of the message. - - $TO$ - Destination e\-mail address of link. - - The default URL is "mailto:$TO$" - - The \-mailtourl option has no effect if the \-nomailto option is - specified. - - \-maxsize # - - Set the maxinum number of messages allowed in the archive to _#_. If - messages are added to the archive which would cause the total number - of messages to exceed _#_, older messages (based on sort method) are - removed automatically. - - \-msgsep expression - - Use the _expression_ as the Perl regular expression that signifies the - message separator in Unix mailbox files. The default expression is - "^From " (minus the quotes). - - _NOTE_ - There is a space character after the From. - - \-nodoc - - Do not print link to documentation at end of index page. - - \-nomailto - - Do not convert e\-mail addresses in mail headers to mailto hyperlinks. - - \-nonews - - Do not convert newsgroups in the Newsgroups: mail header field to news - hyperlinks. - - \-noreverse - - Do not perform a reverse listing of the mail messages in the index - page. - - \-nosort - - Do not sort messages by date. Messages will be in the order they - appear in the mailboxes/folders. By default, _MHonArc_ sorts messages - by date sent/received. - - \-nosort takes precedence over the \-sort option. - - \-nothread - - Do not create a thread index page. - - \-notsubsort - - Do not sort threads by subject on thread index page. - - \-notreverse - - List threads in the thread index with oldest thread first. - - \-outdir path - - Set destination/location of the HTML mail archive to _path_. By - default, the current working directory is used. - - \-quiet - - Suppress processing messages when _MHonArc_ is running. - - \-rcfile file - - Use file as the resource file for _MHonArc_. _MHonArc_ does the - following to determine the location of file: - - 1. If its an absolute pathname, use it. - 2. If it is a relative pathname, check for it relative to the current - working directory. - 3. Otherwise, check for it relative to the location of the archive. - - See Resource File for more information. There is no default resource - file. - - \-reverse - - List messages in reverse order of the sorting option specified. For - example, if date sorting is specified, \-reverse will cause messages to - be listed in _reverse_ chronological order. - - \-rmm - - All non\-option command\-line arguments are treated as messages to - remove from the archive. Messages to remove are denoted by their - message numbers. - - \-savemem - - Normally, all messages are stored in memory and then written in one - shot. This option causes _MHonArc_ to write the message data as it is - processesd. This option will cause a slow down in execution time as - more disk I/O required, but it may allow large amounts of data to be - processed in a single process if memory is limited. - - _NOTE_ - The reason more disk I/O is required is that when the message - data is first written, all the archive navigational link - information is non\-existant. The information required to - correctly generate the navigational link information will not - exist until all messages are processed. Therefore, each new - message file must be reopened to add in the navigational link - information after all messages are processed. - - \-scan - - List contents of archive to standard output. - - \-single - - Convert a single mail message to HTML. The message can be specified by - a filename on the command\-line, or read from standard input if no file - is given. The filtered message is sent to standard output. - - The \-single option is useful tp convert individual messages to HTML - not related to a specific mail archive. Any option related to how - message formatting can be used with the \-single option. - - The \-single takes precedence over the \-add option. - - \-sort - - Perform chronological date sorting. This is the default. - - \-subsort - - Sort messages by subject. Subject sorting is case\-insensitive, and - begining "Re:", "A", "An", and "The" words are ignored. - - \-tidxfname name - - Sets the name of the thread index file to _name_. The default is - "threads.html". - - \-time - - Print out total CPU execution time taken when processing messages. - Time information is written to standard error. - - \-title string - - Set the title of the main index page to _string_. The default is - "_Mail Index_". - - \-thread - - Create a thread index page. This is the default. - - \-tlevels - - Set the maximum number of nested lists for the thread index page. The - default is 3. - - \-treverse - - List threads in the thread index with newest thread first. - - \-tsubsort - - List threads in the thread index by subject. - - \-ttitle string - - Set the title of the thread index page to _string_. The default is - "_Mail Thread Index_". - - \-umask umask - - Set the umask of the _MHonArc_ process to _umask_. The value is - treated as an octal number. - - NOTE - - The \-no* options always take precedence over their counterparts. For - example, if \-noreverse and \-reverse are both specified on the - command\-line, the \-noreverse will be applied. - - _________________________________________________________________ - -Environment - - _MHonArc_ supports the use of environment variables. The environment - variables allow you to set default options everytime you invoke - _MHonArc_. The following environment variables may be used: - - M2H_DBFILE - - Sets the name of _MHonArc_ database file. The default is ".mhonarc.db" - (or "MHONARC.DB" under MS\-DOS). - - _NOTE_ - You should not override the default name unless absolutely - necessary, and you are confident about what you are doing. - - M2H_DOCURL - - Set the URL used to point to _MHonArc_ documentation. The default is, - "http://www.oac.uci.edu/indiv/ehood/mhonarc.html". - - M2H_FOOTER - - Set the HTML footer file to insert at the bottom of the index page. No - default footer file is defined. See Include Files in Index Page - Customization for more information about the footer file. - - M2H_HEADER - - Set the HTML header file to insert at the top of the index page. No - default header file is defined. See Include Files in Index Page - Customization for more information about the header file. - - M2H_IDXFNAME - - Set the name of the index file. The default is, "maillist.html". - - M2H_IDXSIZE - - Sets the maximum number of messages listed in the indexes. - - M2H_LOCKFILE - - The sleep time, in seconds, between attempts to lock the archive. The - default value is 3. - - M2H_LOCKFILE - - Set the name of the lock file. The default name use is ".mhonarc.lck" - (or "MHONARC.LCK" under MS\-DOS). - - _NOTE_ - You should not change the default unless absolutely necessary. - - See Archive Integrity for more information about the lock file. - - M2H_LOCKTRIES - - Set the number of time _MHonArc_ tries to lock a mail archive before - processing new messages. The default value is 10. _MHonArc_ waits - approximately 3 seconds before each try. - - See Archive Integrity for more information on the M2H_LOCKTRIES - environment variable. - - M2H_MAILTOURL - - Sets the URL for e\-mail address hyperlinks in mail message headers. - The URL can contain the following _variables_ that get expanded during - run\-time: - - $FROM$ - Who the message is from. - - $MSGID$ - Message ID of the message. - - $SUBJECT$ - The subject of the message. - - $TO$ - Destination e\-mail address of link. - - The default URL is "mailto:$TO$" - - M2H_MAXSIZE - - Sets the maximum number of messages that an archive will contain. If - messages are added to the archive which would cause the total number - of messages to exceed M2H_MAXSIZE, older messages (based on sort - method) are removed automatically. - - M2H_OUTDIR - - Sets the destination/location of the HTML mail archive. The default is - the current working directory. - - M2H_RCFILE - - Specifies the Resource File for _MHonArc_. No default resource file is - defined. - - M2H_THREAD - - Flag to determine if _MHonArc_ generates a thread index. If set to - zero, the thread index will not be created. The default behavior is to - create a thread index. - - M2H_TIDXFNAME - - Sets the name of the thread index file. The default is "threads.html". - - M2H_TITLE - - Sets the default title of the index page. The default is "_Main - Index_". - - M2H_TLEVELS - - Sets the maximum number of nested lists for the thread index page. The - default is 3. - - M2H_TTITLE - - Sets the title of the thread index page. The default is "_Mail Thread - Index_". - - NOTE - - Environment variables may be overriden by the Resource File or - command\-line Options. - - _________________________________________________________________ - - - _________________________________________________________________ - - Resource File - - _MHonArc_ supports the ability to read in a resource file to control - the behavior of _MHonArc_. The resource file allows you to specify - most of the resources set by environment variables and command\-line - options, and it allows you to specify other resources to control - _MHonArc_'s behavior. - - The resource file is specified by the M2H_RCFILE environment variable - or the \-rcfile command\-line option. The command\-line option overrides - the environment variable if both are defined. - - _NOTE_ - _MHonArc_ will store the information specified in the resource - file in the database for the archive. Therefore, it is - unnecessary to respecify the resource file duing archive - updates unless changes are required from the current settings. - - _________________________________________________________________ - -Resource Syntax - - Resources are set in the file by using _elements_ similiar in style to - HTML/SGML markup. However, _MHonArc_ uses simpler parsing rules for - the resource file than standard SGML: - - * Any line that is not a recognized element open tag, _and_ the line - is not contained within an element, is ignored. This implies that - regular text can be put anywhere _outside_ of recognized elements - for commenting purposes. - _NOTE_: You should use SGML comment declarations () - when commenting a resource file. This will eliminate possible - conflict with later versions of _MHonArc_ if more stricter parsing - rules are adopted. - * The opening tag of an element must occur by itself on a single - line. Whitespace is allowed before the the open tag. - * No comments are allowed inside elements because the text will be - treated as element content. - * Each element must be closed with a tag on its own - line unless _explicitly_ stated otherwise in the Resource Elements - section. Whitespace is allowed before the close tag. - * Some elements can take an optional attribute called "Override". - This tells _MHonArc_ that the contents of the element will - completely override the default behavior of _MHonArc_, and - previous instances of the element. _Example_: "". - If "Override" is not specified, then the contents of the element - augment the current setting. - * Element names are case\-insensitive. - * Elements can occur in any order in the resource file. - - Resource Variables - - Some resource element contents may contain variables. Variables get - expanded to strings at run\-time. - - _NOTE_ - Variable expansion will only take place in resource elements - that are intended to have variables as part of their content. - If an element is not meant to have variables, the variable text - will be taken literally as part of the element content. - - The syntax of the _variables_ to use in resource elements is as - follows: - - $_VARIABLE_[:[_N_][U]]$ - - The items in []'s are optional. Definition of each part: - - $ - The $ character represents the beginning, and ending, of the - variable. - - _VARIABLE_ - This is the the actual name of the variable. All variable names - must be uppercase. - - :[_N_][U] (_optional_) - This defines a maximum length of the replacement string for the - variable. The option "U" denotes that the replacement string - should be treated as part of a URL string. This can be useful - when the variable may contain special characters, and the - variable is used withing a URL. - - _No_ whitespace is allowed between the opening $ and closing $. If an - unrecognized variable is encountered, it gets replaced with an empty - string. If a literal "$" is needed, use "$$". - - _SPECIAL NOTE_ - The MAILTOURL resource has different rules for variable - expansion. If a variable does not exactly match the set of - variables available for the MAILTOURL, the variable text will - be taken literally as part of the element content. Therefore, a - single "$" can be used to represent a "$" character. - - Also, variables in the MAILTOURL should _NOT_ have ":NU" - modifier. This will prevent the variables from be recognized. - _MHonArc_ will automatically treat the replacement value as a - part of a URL string. - - Here are some examples of legal variable usage: - - * $SUBJECT$ - * $FROMNAME$ - * $SUBJECT:50$ - * $SUBJECTNA:60U$ - * $FROMADDR:U$ - - Each resource element will define what variables are defined for it. - - _________________________________________________________________ - -Resource Elements - - The following are complete listings of all the resource elements - defined by _MHonArc_. Many element descriptions will reference to - other sections of the documentation on the exact usage of the element. - - Empty Elements - - The following list of elements contain no textual content. Therefore, - no end tag is required: - - NODOC - - Do not put link to documentation on main index page. - - NOMAILTO - - Do not convert e\-mail addresses in mail headers to mailto hyperlinks. - - NONEWS - - Do not convert newsgroups in the Newsgroups: mail header field to news - hyperlinks. - - NOREVERSE - - Do not perform a reverse listing of the mail messages in the main - index page. - - NOSORT - - List messages in the index page in the order they are processed. - - NOTHREAD - - Do not create thread index. - - NOTREVERSE - - List threads in the thread index with oldest thread first. - - NOTSUBSORT - - Do not sort thread by subject in thread index page. - - REVERSE - - List messages in reverse listing order for the main index page. - - SORT - - List messages in the index page in chronological order. - - SUBSORT - - Sort messages by subject. Subject sorting is case\-insensitive, and - begining "Re:", "A", "An", and "The" words are ignored. - - THREAD - - Create thread index. This is the default. - - TREVERSE - - List threads in the thread index with newest thread first. - - TSUBSORT - - Sort thread by subject in thread index page. - - Non\-Empty Elements - - The following list of elements contain textual content, therefore, - each element must be _explicitly_ closed with an element end tag - (examples are given in Example Resource File): - - BOTLINKS - - Markup for defining the various hyperlinks at the bottom of converted - messages. See Navigational Links of Message Customization for usage of - this element. - - DBFILE - - Use _name_ for the name of _MHonArc_ database file. The default is - ".mhonarc.db" (or "MHONARC.DB" under MS\-DOS). - - _NOTE_ - You should not override the default name unless absolutely - necessary, and you are confident about what you are doing. - - DOCURL - - URL to _MHonArc_ documentation. The default is - "http://www.oac.uci.edu/indiv/ehood/mhonarc.html". - - EXCS - - Set of message header fields to exclude from messages. See Excluding - Fields of Message Customization for usage of this element. - - FIELDORDER - - The order the message header fields appear in messages. See Field - Order of Message Customization for usage of this element. - - FIELDSTYLES - - The format specification for message header field values. See Field - Formatting of Message Customization for usage of this element. - - FOOTER - - File to include at the end of the index page. See Include Files in - Index Page Customization for more information about the footer file. - - HEADER - - File to include at the beginning of the index page. See Include Files - in Index Page Customization for more information about the header - file. - - ICONS - - The ICONS element is used to specify the icons that represent the - different content\-types of messages. See Icons in Index Page - Customization for usage of this element. - - IDXFNAME - - The name of the index file. The default is "maillist.html". - - LABELSTYLES - - The format specification for message header field labels. See Field - Formatting in Message Customization for usage of this element. - - LISTBEGIN - - Markup for beginning the main index list. See Listing Layout in Index - Page Customization for usage of this element. - - LITEMPLATE - - Markup for an entry in the main index list. See Listing Layout in - Index Page Customization for usage of this element. - - LISTEND - - Markup for terminating the main index list. See Listing Layout in - Index Page Customization for usage of this element. - - MAILTOURL - - Url to use for e\-mail hyperlinks. See E\-mail Links in Message - Customization for usage of this element. - - MIMEARGS - - Arguments to MIME filters. See Specifying Filters in MIME for usage of - this element. - - MIMEFILTERS - - Routines for filtering messages. See Specifying Filters in MIME for - usage of this element. - - MSGFOOT - - Footer text for converted messages. See Header and Footer in Message - Customization for usage of this element. - - MSGHEAD - - Header text for converted messages. See Header and Footer in Message - Customization for usage of this element. - - MSGSEP - - Perl regular expression that represents the message separator for - mailbox files. The default expression is "^From ". - - OTHERINDEXES - - List of resource files (one per line) defining other index pages to - generate when creating, or updating, an archive. - - _CAUTION_ - It is very important that each resource file specified defines - the IDXFNAME (or the TIDXFNAME _and_ THREAD elements for a - thread index) to prevent overwriting of the default index - pages. - - _MHonArc_ will only store the name of the resource files listed in the - database. Therefore, for any subsequent updates the archive, the extra - index resource files must exist inorder to generate the extra index - pages. - - _NOTE_ - Since _MHonArc_ will look in the archive location for resource - files specified with relative pathnames, you can keep the other - index resource files in the same location as the archive, and - just specify the filenames for the OTHERINDEXES element in the - main resource file. - - When create resource files for extra indexes, make sure to explicitly - set all resources desired since some resource settings may no longer - be set to the defaults due to database settings, or from a previously - read resource file. Ie. _MHonArc_ does not reset to the default - settings when reading in the other resource files. - - PERLINC - - Each line represents a path to search when requiring MIME filters. See - Specifying Filters in MIME for the use of this element. - - TFOOT - - Markup that appears after the thread index listing. See Listing Layout - in Thread Index Customization for usage of this element. - - THEAD - - Markup that appears before the thread index listing. See Listing - Layout in Thread Index Customization for usage of this element. - - TIDXFNAME - - The name of the thread index file. The default is "threads.html". - - TIMEZONES - - Each line of the TIMEZONES element defines a timezone acronym and its - hour offset from UTC/GMT (_Universal Coordinate Time_). The format of - each line is "timezone_acronym:hour_offset". Examples of timezone - acronyms are: UTC, PDT, EST. The hour offset is should be positive for - timezones West of UTC, and negative for time zones East of UTC. - - _MHonArc_ has a default list of timezone acronyms defined with hour - offsets. Therefore, the list given in the resource file will augment - the default list, unless the "Override" attribute is specified. If - "Override" is specified, the default list, along with any other lists - specified in previous TIMEZONES elements, are discarded, and only the - timezone acronyms specified in the TIMEZONES element will be used. - - The following is the default value for TIMEZONES: - - -UTC:0 -GMT:0 -AST:4 -ADT:3 -EST:5 -EDT:4 -CST:6 -CDT:5 -MST:7 -MDT:6 -PST:8 -PDT:7 - - - Most of the time, the date used by _MHonArc_ uses a hour offset - instead of a timezone acronym. However, mail messages may contain - timezone acronyms in received/sent dates and _MHonArc_ must be told - what the hour offset from UTC the timezone acronym represents in order - to properly sort messages by date. - - TITLE - - Title for the main index page. The default is "_Mail Index_". - - TLEVELS - - The maximum number of nested lists for the thread index. The default - is 3. - - TLITXT - - Markup for an entry in the thread index list. See Listing Layout in - Thread Index Customization for usage of this element. - - TOPLINKS - - Markup for defining the various hyperlinks at the top of converted - messages. See Navigational Links in Message Customization for usage of - this element. - - TTITLE - - Title for the thread index page. The default is "_Mail Thread Index_". - - UMASK - - Sets the umask for the _MHonArc_ process. The value is treated as an - octal number. The resource is only applicable on Unix systems. - - _________________________________________________________________ - -Example Resource File - - - - -MHonArc test - - - -MHonArc test - - - - - - -
    -Last updated: $LOCALDATE$
    -$NUMOFMSG$ messages in chronological order
    -
    - -

    -Listing format is the following: -

    -

    • -Subject -(# of follow\-ups) -From
      -
    -

    -


    -
      - - - - - -
    • -$SUBJECT:40$ -($NUMFOLUP$) $FROMNAME$
      - - - -
    -

    -


    - -Home - -

    - - - - -

    -Thread index
    -Last updated: $LOCALDATE$
    -$NUMOFMSG$ messages
    -
    - -
    - - - - -apparently -errors\-to -followup -forward -lines -message\-id -mime\- -nntp\- -originator -path -precedence -received -replied -return\-path -status -via -x\- - - - -\-default\- -subject:strong -from:strong -to:strong - - - -\-default\- -subject:strong -from:strong -to:strong -keywords:em -newsgroups:strong - - - -
    -MHonArc test archive -
    -
    - - - -Home | -Main Index | -Thread Index - - - - - -application/octet\-stream:http://foo.org/icons/binary.xbm -application/postscript:http://foo.org/icons/postscript.xbm -audio/basic:http://foo.org/icons/sound.xbm -image/gif:http://foo.org/icons/image.xbm -image/jpeg:http://foo.org/icons/image.xbm -image/tiff:http://foo.org/icons/image.xbm -multipart/alternative:http://foo.org/icons/alternative.xbm -multipart/digest:http://foo.org/icons/text.xbm -multipart/mixed:http://foo.org/icons/mixed.xbm -multipart/parallel:http://foo.org/icons/mixed.xbm -text/richtext:http://foo.org/icons/mixed.xbm -text/html:http://foo.org/icons/mixed.xbm -text/plain:http://foo.org/icons/text.xbm -unknown:http://foo.org/icons/unknown.doc.xbm -video/mpeg:http://foo.org/icons/movie.xbm -video/quicktime:http://foo.org/icons/movie.xbm - - - _________________________________________________________________ - -Notes on Resource File - - * Elements can be duplicated. The following elements augment - previous instances of themselves: - + EXCS (can specify Override attribute) - + FIELDSTYLES - + ICONS (can specify Override attribute) - + LABELSTYLES - + MIMEFILTERS (can specify Override attribute) - + PERLINC (can specify Override attribute) - + TIMEZONES (can specify Override attribute) - The Override attribute will discard previous settings of the - element. - * If duplicate instances of other elements exist, the last instance - takes precedence. - * If an element only accepts a single line of content, then the last - line is used for the element's content. - * If elements have conflicting resource settings (eg. NOSORT and - SORT), the last element defined takes precedence. - * Resource file settings override environment variables. - * Command\-line options override any settings in the resource file. - * If you want to do an exact match of a field in the EXCS element, - append a '$' after the field name. - - _________________________________________________________________ - - - _________________________________________________________________ - - Adding Messages - - Adding messages to an archive is done via the \-add option. If no - mailbox/folder arguments are given, _MHonArc_ assumes that a _single_ - message is being added to the archive via _standard input_. Otherwise, - _MHonArc_ adds the messages contained in the mail folders specified. - - _NOTE_ - _MHonArc_ will skip any messages that already exist in an - archive. If a message to be added has a message\-ID that equals - a message\-ID of an archived message, the message is skipped. - - _________________________________________________________________ - -Examples - - Adding a mail folder - - Here is example session adding an mail folder to an existing archive: - -% mhonarc \-add test/www -Requiring MIME filter libraries ... - mhexternal.pl - mhtxthtml.pl - mhtxtplain.pl - mhtxtsetext.pl -Adding messages to ./maillist.html -Reading test/www/ ........................................ -Writing HTML ... -49 messages - - .forward - - _MHonArc_ can be used to add new messages as they are received by - using the ".forward" file in your home directory. Here is how I would - set up my .forward file to invoke _MHonArc_ on incoming mail: - -\\ehood, "|/mnt/ehood/bin/webnewmail #ehood" - - _NOTE_ on .forward entry: - The "\\ehood" tells sendmail to still deposit the incoming - message to my mail spool file. The "#ehood" Bourne shell - comment is needed to insure the command is unique from another - user. Otherwise, sendmail may not invoke the program for you or - the other user. - - "webnewmail" is a Perl program that calls _MHonArc_ with the - appropriate arguments. A wrapper program is used instead of calling - _MHonArc_ directly to keep the .forward file simple. Here is the code - to the webnewmail program: - -#!/usr/local/bin/perl - -$cmd = "/mnt/ehood/bin/mhonarc \-add \-quiet " . - "\-outdir /mnt/ehood/public_html/newmail"; -open(M2H, "|$cmd"); -print M2H ; -close(M2H); - - The webnewmail can be modified to check the mail header before calling - _MHonArc_ to perform selective archiving of messages. For example, - webnewmail can check the To: field and only archive messages that come - from a specific mailing list. - - Cron - - This example uses cron(1) to update some mail archives from MH mail - folders. - - The following entry is in my crontab file: - -0 0 * * * webmail - - webmail is a script executed every night that calls _MHonArc_ to - perform the update: - -#! /bin/csh \-f - -umask 022 -setenv M2H_RCFILE $HOME/.mhonarc.rc -## WWW messages -mhonarc \-add \\ - \-outdir $HOME/public_html/doc/wwwmail \\ - $HOME/mail/www -folder +www >& /dev/null -refile first\-last +www.ar >& /dev/null # Archive original messages - -## Tools messages -mhonarc \-add \\ - \-outdir $HOME/public_html/doc/toolsmail \\ - $HOME/mail/tools $HOME/mail/dtd -folder +tools >& /dev/null -refile first\-last +tools.ar >& /dev/null # Archive original messages -folder +dtd >& /dev/null -refile first\-last +dtd.ar >& /dev/null # Archive original messages - -folder +inbox >& /dev/null # Set current folder to inbox - - - To avoid mail everynight from cron due to output from _MHonArc_, the - \-quiet option can be used for each call to _MHonArc_, or use the - following line in your crontab file: - -0 0 * * * webmail > /dev/null - - Standard error is not redirected to /dev/null so mail is still - received if errors occured during _MHonArc_ execution. - - _________________________________________________________________ - - - _________________________________________________________________ - - Removing Messages - - Removing messages from an archive is done via the \-rmm option. - Messages to be deleted are designated by message numbers on the - command\-line. - - _Example_ - -% mhonarc \-rmm 24 28 39 48 -Removing messages from ./maillist.html ... - Removing message 24 - Removing message 28 - Removing message 39 - Removing message 48 - -Writing mail ... -Writing tmp/maillist.html ... -Writing tmp/threads.html ... -45 messages - - _________________________________________________________________ - -Message Numbers - - Normally, you will never have to worry about message numbers unless - you want to remove messages from an archive. Therefore, you will need - to know how _MHonArc_ assigns message numbers when processing - messages. - - When a message is processed, the smallest available number is assigned - to it, starting with 0. The number assigned to a message becomes part - of the filename for the HTML version of the message (eg. - msg00042.html). - - To avoid message number conflicts, _MHonArc_ determines the smallest - available number by finding the largest assigned number and adding one - to it. - - _________________________________________________________________ - -Scanning an Archive - - You will quickly find out that finding the message numbers for a - messages you want to remove can be a cumbersome task if all you have - to work with are the message filenames. To ease this task, _MHonArc_ - gives you the ability to scan an archives contents via the \-scan - command\-line option. - - Example - -% mhonarc \-scan -100 messages in .: - -Msg # YY/MM/DD From Subject -\-\-\-\-\- \-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- - 513 95/02/09 Rick Silterra EDComment(sic) - 517 95/02/09 Earl Hood Re: DTD2HTML - 512 95/02/09 Earl Hood Re: edc2html - 516 95/02/09 John Barnum Re: DTD2HTML - 515 95/02/09 Earl Hood Re: DTD2HTML - 511 95/02/09 Rick Silterra edc2html - 514 95/02/08 John Barnum DTD2HTML - 510 95/02/06 jflores mhonarc_diagnostics.doc.html - 509 95/02/06 web Dr.Web: Status Review + Thank You - 508 95/02/05 Earl Hood Re: sgml to html converters - 507 95/02/03 Aileen Barry sgml to html converters - 506 95/01/28 Earl Hood Re: MHonarc: Deleting Messages from an archiv - 505 95/01/28 Floyd Moore MHonarc: Deleting Messages from an archive - 504 95/01/25 Earl Hood Re: MHonArc - 503 95/01/25 Earl Hood Re: MHonArc -... - - The messages are listed in the same order as they are listed in the - archive's index page. You will notice that the list order does not - necessarily correspond with message number order. If you always want - the messages listed in message number order when scanning, use the - following: - -% mhonarc \-scan \-nosort \-noreverse -82 messages in .: - -Msg # YY/MM/DD From Subject -\-\-\-\-\- \-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- - 0 94/05/09 Michael O´Sulli Re: Finger within an html - 1 94/04/31 John M. Troyer Re: TROFF to HTML Converters - 2 94/05/04 John D. Kilburg ANNOUNCE: Chimera 1.53 - 3 94/05/17 Stephen Billing Re: government www? - 4 94/05/21 C. Emory Tate Re: government www? - 5 94/05/24 Daniel W. Conno Re: Comments on HTML 2.0 document/DTD - 6 94/05/24 Dan Connolly Re: Validating HTML documents: - 7 94/05/25 Henrik Frystyk CERN Common World\-Wide Web Library 2.16pre2 A - 8 94/06/04 Denesh Bhabuta Re: Atari on www (revisited) - 9 94/06/07 Dale Newfield ANNOUNCE: Come explore The Edge \- SIGGRAPH 94 - 10 94/06/11 Roy T. Fielding Announcing libwww\-perl 0.12 -... - - _________________________________________________________________ - - - _________________________________________________________________ - - Index Page Customization - - _MHonArc_ creates an index page with links to all mail messages - filtered (unless processing a single message with the \-single option). - _MHonArc_ allows you to have complete customization over the - appearance of the index page by setting various resource either - through environment variables, command\-line options, or the resource - file. - - _________________________________________________________________ - -Filename - - By default, the filename of the index page is "maillist.html". - However, a different name may be specified with the M2H_IDXFNAME - environment variable, the IDXFNAME resource element, or the \-idxfname - command\-line option. - - _________________________________________________________________ - -Beginning Markup - - _MHonArc_ allows you to completely override the begining markup of the - index page. I.e. You can control the opening tag, the HEAD - element contents, the opening tag, etc. Therefore, if you are - not satisfied with the default behavior of how the TITLE resource is - used, or have other needs that require control on the beginning - markup, you can set the IDXPGBEGIN resource file element. - - IDXPGBEGIN - - The best way to show how the IDXPGBEGIN works, the following - represents the default setting _MHonArc_ uses: - - - - - -$IDXTITLE$ - - -

    $IDXTITLE$

    -
    - - _NOTE_ - Technically, setting the TITLE resource, via the M2H_TITLE - environment variable, the TITLE resource element, or the \-title - command\-line option, sets the $IDXTITLE$ resource file - variable. - - The resource variables allowed in the IDXPGBEGIN element are the - following: - - * $DOCURL$ \-\- URL to documentation - * $GMTDATE$ \-\- Current GMT date. - * $IDXFNAME$ \-\- Filename of main index page. - * $IDXSIZE$ \-\- Max number of messages that may be listed in the - index. - * $IDXTITLE$ \-\- The title of the index page. - * $LOCALDATE$ \-\- Current local date. - * $NUMOFIDXMSG$ \-\- Number of message listed. - * $NUMOFMSG$ \-\- Number of messages in the archive. - * $OUTDIR$ \-\- Pathname of archive. - * $PROG$ \-\- Program name. - * $TIDXFNAME$ \-\- Filename of thread index page. - * $TIDXTITLE$ \-\- Title of thread index page. - * $VERSION$ \-\- Program version. - - See Resource Variables for more information on the usage of variables. - - _________________________________________________________________ - -End Markup - - Since _MHonArc_ allows you to control the beginning markup, it makes - sense for it to allow you to control the ending markup. - - IDXPGEND - - The IDXPGEND resource element may be used to define the ending markup - of the index page. The default value is the following: - - - - - - - The resource variables allowed are the same as for IDXPGBEGIN. - - _________________________________________________________________ - -Include Files - - _MHonArc_ allows you to include the contents of files into the index - page via the header and footer resources. - - _NOTE_ - The use of include files is discouraged since the LISTBEGIN and - LISTEND resources can be used to achieve the same results. - Also, the support for the include resource may be removed in - future releases. - - The header file is specified via the M2H_HEADER environment variable, - the HEADER resource element, or the \-header command\-line option. The - contents of the header file are inserted above the message listing, - and right after the H1 title element. - - _NOTE_ - Filename should not contain the , , and - tags; these tags are automatically provided by _MHonArc_, or - defined by the IDXPGBEGIN resource file element. - - The footer file is specified via the M2H_FOOTER environment variable, - the FOOTER resource element, or the \-footer command\-line option. The - contents of the footer file are inserted after the message listing. - - _NOTE_ - Filename should not contain the , and tags; - these tags are automatically provided by _MHonArc_, or defined - by the IDXPGEND resource file element. - - The header and footer files allow you to incorporate search\-forms, - hyperlinks to other pages, or any other HTML markup you like. - - It is only necessary to specify the header and/or footer files the - first time you create an archive. The contents included from the - header and/or footer files are preserved in any subsequent additions - to the archive. Only respecify the header and/or footer files if you - need to make changes to the header/footer contents. - - _________________________________________________________________ - -Listing Layout - - _MHonArc_ lists messages in the order specified by the various sort - options. However, you have complete control on how the message listing - are formatted via the LISTBEGIN, LITEMPLATE, and LISTEND resource - elements in the Resource File. These elements allow you to specify the - HTML markup to use in the index page. - - LISTBEGIN - - The LISTBEGIN resource element specifies the text to begin the message - list. The text can be any valid HTML markup. Plus, _MHonArc_ defines - the following variables you may use which get expanded at run\-time: - - * $DOCURL$ \-\- URL to documentation - * $GMTDATE$ \-\- Current GMT date. - * $IDXFNAME$ \-\- Filename of main index page. - * $IDXSIZE$ \-\- Max number of messages that may be listed in the - index. - * $IDXTITLE$ \-\- The title of the index page. - * $LOCALDATE$ \-\- Current local date. - * $NUMOFIDXMSG$ \-\- Number of message listed. - * $NUMOFMSG$ \-\- Number of messages in the archive. - * $OUTDIR$ \-\- Pathname of archive. - * $PROG$ \-\- Program name. - * $TIDXFNAME$ \-\- Filename of thread index page. - * $TIDXTITLE$ \-\- Title of thread index page. - * $VERSION$ \-\- Program version. - - _MHonArc_'s LISTBEGIN default value is the following: - - - -
    -
  • + + +
    +

    Resource Variables

    + +

    N/A

    + + +
    +

    Examples

    + +

    None. + + +


    +

    Version

    + +

    2.0 +

    + + +
    +

    See Also

    + +

    +TSUBJECTBEG +

    + + +
    +
    +97/05/13 17:30:31
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + + diff --git a/doc/resources/tsublistbeg.html b/doc/resources/tsublistbeg.html new file mode 100644 index 0000000..c60d665 --- /dev/null +++ b/doc/resources/tsublistbeg.html @@ -0,0 +1,208 @@ + + + +MHonArc Resources: TSUBLISTBEG + + + +
    +MHonArc Resource List
    +
    + +
    +

    TSUBLISTBEG

    + + +
    +

    Syntax

    + +
    + +
    Envariable
    +

    N/A +

    +
    + +
    Element
    +

    +<TSUBLISTBEG>
    +markup ...
    +</TSUBLISTBEG>
    +

    +
    + +
    Command-line Option
    +

    N/A +

    +
    + +
    + + +
    +

    Description

    + +

    TSUBLISTBEG defines the markup for starting a sub-thread +listing. +

    + + +
    +

    Default Setting

    + +
    +<TSubListBeg>
    +<UL>
    +</TSubListBeg>
    +
    + + +
    +

    Resource Variables

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    VariableValue
    $DOCURL$URL to documentation.
    $FIRSTPG$Filename of first page of main index.
    $GMTDATE$Current GMT date.
    $IDXFNAME$Filename of main index page.
    $IDXLABEL$Label for main index page.
    $IDXPREFIX$Prefix of filenames of main index pages.
    $IDXSIZE$Max number of messages that may be listed in index page.
    $IDXTITLE$The title of the main index page.
    $LASTPG$Filename of last page in of main index.
    $LOCALDATE$Current local date.
    $NUMOFIDXMSG$Number of message listed.
    $NUMOFMSG$Number of messages in the archive.
    $NUMOFPAGES$Number of index pages.
    $OUTDIR$Pathname of archive.
    $PROG$Program name
    $TFIRSTPG$Filename of first page of thread index.
    $TIDXFNAME$Filename of thread index page.
    $TIDXLABEL$Label for thread index page.
    $TIDXPREFIX$Prefix of filenames of thread index pages.
    $TIDXTITLE$Title of thread index.
    $TLASTPG$Filename of last page of thread index.
    $TNEXTPG$Filename of next page of the thread index.
    $TNEXTPGLINK$Markup linking to the next page of the thread index.
    $TPREVPG$Filename of the previous page of the thread index.
    $TPREVPGLINK$Markup linking to the previous page of the thread index.
    $VERSION$Program version.
    + + +
    +

    Examples

    + +

    None. +

    + + +
    +

    Version

    + +

    2.0 +

    + + +
    +

    See Also

    + +

    +TSUBLISTEND, +TTOPBEGIN +

    + + +
    +
    +97/05/13 17:30:32
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + + diff --git a/doc/resources/tsublistend.html b/doc/resources/tsublistend.html new file mode 100644 index 0000000..90e18ff --- /dev/null +++ b/doc/resources/tsublistend.html @@ -0,0 +1,97 @@ + + + +MHonArc Resources: TSUBLISTEND + + + +
    +MHonArc Resource List
    +
    + +
    +

    TSUBLISTEND

    + + +
    +

    Syntax

    + +
    + +
    Envariable
    +

    N/A +

    +
    + +
    Element
    +

    +<TSUBLISTEND>
    +markup ...
    +</TSUBLISTEND>
    +

    +
    + +
    Command-line Option
    +

    N/A +

    +
    + +
    + + +
    +

    Description

    + +

    TSUBLISTEND defines the markup for ending a sub-thread +listing. +

    + + +
    +

    Default Setting

    + +
    +<TSubListEnd>
    +</UL>
    +</TSubListEnd>
    +
    + + +
    +

    Resource Variables

    + +

    N/A

    + + +
    +

    Examples

    + +

    None. +

    + + +
    +

    Version

    + +

    2.0 +

    + + +
    +

    See Also

    + +

    +TSUBLISTBEG, +

    + + +
    +
    +97/05/13 17:30:32
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + + diff --git a/doc/resources/ttitle.html b/doc/resources/ttitle.html new file mode 100644 index 0000000..77bd950 --- /dev/null +++ b/doc/resources/ttitle.html @@ -0,0 +1,107 @@ + + + +MHonArc Resources: TTITLE + + + +
    +MHonArc Resource List
    +
    + +
    +

    TTITLE

    + + +
    +

    Syntax

    + +
    + +
    Envariable
    +

    +M2H_TTITLE=string +

    +
    + +
    Element
    +

    +<TTITLE>
    +string
    +</TTITLE>
    +

    +
    + +
    Command-line Option
    +

    +-ttitle string +

    +
    + +
    + + +
    +

    Description

    + +

    TTITLE defines the value of the $TIDXTITLE resource +variable. Unless doing custom page layout, the effect of setting +the TTITLE resource sets the title of the thread index. +

    + + +
    +

    Default Setting

    + +
    +Mail Thread Index
    +
    + + +
    +

    Resource Variables

    + +

    N/A

    + + +
    +

    Examples

    + +

    It is common to set TTITLE to the name of the mailing list, or +newsgroup, being archived and that the index is a thread index. +For example: +

    + +
    +<TTitle>
    +MHonArc Mailing List (by thread)
    +</TTitle>
    +
    + + +
    +

    Version

    + +

    1.1 +

    + + +
    +

    See Also

    + +

    +TIDXPGBEGIN, +TITLE +

    + + +
    +
    +97/05/13 17:30:33
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + + diff --git a/doc/resources/ttopbegin.html b/doc/resources/ttopbegin.html new file mode 100644 index 0000000..2bd9694 --- /dev/null +++ b/doc/resources/ttopbegin.html @@ -0,0 +1,250 @@ + + + +MHonArc Resources: TTOPBEGIN + + + +
    +MHonArc Resource List
    +
    + +
    +

    TTOPBEGIN

    + + +
    +

    Syntax

    + +
    + +
    Envariable
    +

    N/A +

    +
    + +
    Element
    +

    +<TTOPBEGIN>
    +markup ...
    +</TTOPBEGIN>
    +

    +
    + +
    Command-line Option
    +

    N/A +

    +
    + +
    + + +
    +

    Description

    + +

    TTOPBEGIN defines the markup for the root, or start, +of a thread. TTOPBEGIN should define any starting markup +for the thread and markup for the root message of the thread. +

    + + +
    +

    Default Setting

    + +
    +<TTopBegin>
    +<LI><STRONG>$SUBJECT$</STRONG>,
    +<EM>$FROMNAME$</EM>
    +</TTopBegin>
    +
    + + +
    +

    Resource Variables

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    VariableValue
    $A_ATTR$The NAME and HREF attributes to use in an anchor to link to the archived message. The NAME attribute links the messages to the index page.
    $A_HREF$The HREF attribute to use in an anchor to link to the archived message.
    $A_NAME$The NAME attribute to use in an anchor for messages to link to the index page.
    $DATE$The date of the message.
    $DDMMYY$Message date in dd/mm/yy format.
    $FROM$The complete text in the From: field of the message.
    $FROMADDR$The e-mail address in the From: field of the message.
    $FROMNAME$The human name of the person in the From: field of the message. If no human name is found, the username specified in the e-mail address is used.
    $ICON$The context-type sensistive icon.
    $ICONURL$The URL to the context-type sensistive icon.
    $MMDDYY$Message date in mm/dd/yy format.
    $MSGGMTDATE$GMT date of current message.
    $MSGID$The message-id of the message.
    $MSGLOCALDATE$Local date of current message.
    $MSGNUM$The message number assigned to the message by MHonArc (includes leading zeros).
    $NUMFOLUP$Number of explicit follow-ups to the message.
    $ORDNUM$The current listing number of the message.
    $SUBJECT$The subject text of the message wrapped in an anchor element that hyperlinks to the message.
    $SUBJECTNA$The subject text of the message without the anchor element.
    $YYMMDD$Message date in yy/mm/dd format.
    + + +
    +

    Examples

    + +

    MHonArc has several resources for customizing +thread page layout. Therefore the following shows a way to +customize the layout using the various thread resource +available. +

    + +

    For this example, +The thread index is setup where a thread will have the subject +in bold at the top of the thread and the names of the authors +of the messages in the thread will be hyperlinked to the +actual message. Nested unordered lists are used to provide a +visual cue of the depths of the thread. +Unique messages are show in normal text. +

    + +
    +<!--    TTOPBEGIN is the markup for the beginning of a thread, and the
    +        first message in a thread.
    +  -->
    +<TTOPBEGIN>
    +<p>
    +<li><a $A_NAME$><strong>$SUBJECTNA$</strong></a><br>
    +<a $A_HREF$>$FROMNAME$</a>
    +</TTOPBEGIN>
    + 
    +<!--    TTOPEND is the markup for closing a main thread.
    +  -->
    +<TTOPEND>
    +</li>
    +</p>
    +</TTOPEND>
    + 
    +<!--    TLITXT is the markup for a message *within* a thread
    +  -->
    +<TLITXT>
    +<li><a $A_ATTR$>$FROMNAME$</a>
    +</TLITXT>
    + 
    +<TLIEND>
    +</li>
    +</TLIEND>
    + 
    +<!--    TSINGLETXT is the markup for a message not in a thread.  I.e.
    +        it does not start a thread or is part of a thread.
    +  -->
    +<TSINGLETXT>
    +<li><a $A_NAME$>$SUBJECTNA$</a>,
    +<a $A_HREF$>$FROMNAME$</a>
    +</li>
    +</TSINGLETXT>
    + 
    +<!--    TSUBJECTBEG is any markup at the beginning of a sub-thread that
    +        is based on the subject of the message.  We just put in a
    +	comment declaration so the reader will see nothing.
    +  -->
    +<TSUBJECTBEG>
    +<!-- Possible follow-ups -->
    +</TSUBJECTBEG>
    +
    + +

    An item to note is how the example includes the proper resource +variables, $A_NAME$ and $A_ATTR$, to allow the +index hyperlinks in messages to behave properly. +

    + + +
    +

    Version

    + +

    2.0 +

    + + +
    +

    See Also

    + +

    +TLITXT, +TSINGLETXT, +TSUBJECTBEG, +TTOPEND +

    + + +
    +
    +97/05/13 17:30:33
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + + diff --git a/doc/resources/ttopend.html b/doc/resources/ttopend.html new file mode 100644 index 0000000..a207447 --- /dev/null +++ b/doc/resources/ttopend.html @@ -0,0 +1,96 @@ + + + +MHonArc Resources: TTOPEND + + + +
    +MHonArc Resource List
    +
    + +
    +

    TTOPEND

    + + +
    +

    Syntax

    + +
    + +
    Envariable
    +

    N/A +

    +
    + +
    Element
    +

    +<TTOPEND>
    +markup ...
    +</TTOPEND>
    +

    +
    + +
    Command-line Option
    +

    N/A +

    +
    + +
    + + +
    +

    Description

    + +

    TTOPEND defines the markup for the end of a thread listing. +

    + + +
    +

    Default Setting

    + +
    +<TTopEnd>
    +</LI>
    +</TTopEnd>
    +
    + + +
    +

    Resource Variables

    + +

    N/A

    + + +
    +

    Examples

    + +

    None. +

    + + +
    +

    Version

    + +

    2.0 +

    + + +
    +

    See Also

    + +

    +TTOPBEGIN +

    + + +
    +
    +97/05/13 17:30:34
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + + diff --git a/doc/resources/umask.html b/doc/resources/umask.html new file mode 100644 index 0000000..1f56ef5 --- /dev/null +++ b/doc/resources/umask.html @@ -0,0 +1,103 @@ + + + +MHonArc Resources: UMASK + + + +
    +MHonArc Resource List
    +
    + +
    +

    UMASK

    + + +
    +

    Syntax

    + +
    + +
    Envariable
    +

    +M2H_UMASK=umask +

    +
    + +
    Element
    +

    +<UMASK>
    +umask
    +</UMASK>
    +

    +
    + +
    Command-line Option
    +

    +-umask umask +

    +
    + +
    + + +
    +

    Description

    + +

    The UMASK resource defines the umask value for the +MHonArc process. This resource is only valid +on Unix systems. Consult the umask(1) manpage for +more information. +

    + + +
    +

    Default Setting

    + +

    Value inherited from the parent process. +

    + + +
    +

    Resource Variables

    + +

    N/A

    + + +
    +

    Examples

    + +

    If you want to make sure that the files created by +MHonArc are readable by others, do something like +the following: +

    + +
    +    % mhonarc -umask 022  ...
    +
    + + +
    +

    Version

    + +

    1.0 +

    + + +
    +

    See Also

    + +

    +

    + + +
    +
    +97/05/13 17:30:35
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + + diff --git a/doc/resources/weekdays.html b/doc/resources/weekdays.html new file mode 100644 index 0000000..cef0201 --- /dev/null +++ b/doc/resources/weekdays.html @@ -0,0 +1,112 @@ + + + +MHonArc Resources: WEEKDAYS + + + +
    +MHonArc Resource List
    +
    + +
    +

    WEEKDAYS

    + + +
    +

    Syntax

    + +
    + +
    Envariable
    +

    +M2H_WEEKDAYS=day1:day2:...:day7 +

    +
    + +
    Element
    +

    +<WEEKDAYS>
    +day1:day2:...:day7
    +</WEEKDAYS>
    +

    +
    + +
    Command-line Option
    +

    +-weekdays day1:day2:...:day7 +

    +
    + +
    + + +
    +

    Description

    + +

    The WEEKDAYS resource defines the names for the days of the week. You +can set this resource to redefine weekday names to reflect +a particular locale for the +GMTDATEFMT and +LOCALDATEFMT +resources. When setting this resource, make sure to +define all 7 days. +

    + + +
    +

    Default Setting

    + +
    +Sunday:Monday:Tuesday:Wednesday:Thursday:Friday:Saturday
    +
    + + +
    +

    Resource Variables

    + +

    N/A

    + + +
    +

    Examples

    + +

    None. +

    + + +
    +

    Version

    + +

    2.0 +

    + + +
    +

    See Also

    + +

    +GMTDATEFMT, +LOCALDATEFMT, +MONTHS, +MONTHSABR, +WEEKDAYSABR +

    + + +
    +
    +97/05/13 17:30:35
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + + diff --git a/doc/resources/weekdaysabr.html b/doc/resources/weekdaysabr.html new file mode 100644 index 0000000..5188652 --- /dev/null +++ b/doc/resources/weekdaysabr.html @@ -0,0 +1,113 @@ + + + +MHonArc Resources: WEEKDAYSABR + + + +
    +MHonArc Resource List
    +
    + +
    +

    WEEKDAYSABR

    + + +
    +

    Syntax

    + +
    + +
    Envariable
    +

    +M2H_WEEKDAYSABR=day1:day2:...:day7 +

    +
    + +
    Element
    +

    +<WEEKDAYSABR>
    +day1:day2:...:day7
    +</WEEKDAYSABR>
    +

    +
    + +
    Command-line Option
    +

    +-weekdaysabr day1:day2:...:day7 +

    +
    + +
    + + +
    +

    Description

    + +

    The WEEKDAYSABR resource defines the abbreviated +names for the days of the week. You +can set this resource to redefine abbreviated weekday names to reflect +a particular locale for the +GMTDATEFMT and +LOCALDATEFMT +resources. When setting this resource, make sure to +define all 7 days. +

    + + +
    +

    Default Setting

    + +
    +Sun:Mon:Tue:Wed:Thu:Fri:Sat
    +
    + + +
    +

    Resource Variables

    + +

    N/A

    + + +
    +

    Examples

    + +

    None. +

    + + +
    +

    Version

    + +

    2.0 +

    + + +
    +

    See Also

    + +

    +GMTDATEFMT, +LOCALDATEFMT, +MONTHS, +MONTHSABR, +WEEKDAYS +

    + + +
    +
    +97/05/13 17:30:36
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + + diff --git a/doc/thread.html b/doc/thread.html deleted file mode 100644 index b1b92b4..0000000 --- a/doc/thread.html +++ /dev/null @@ -1,225 +0,0 @@ - - - -MHonArc v1.2.2 -- Thread Index Customization - - -[Previous][Next][Contents][FAQ][Bugs][Home] -
    - -

    Thread Index Customization -

    - -

    The thread index compliments the main index. If a thread index is created, each -message in the archive will contain an extra link to the thread index. -

    -

    Customizing the thread index is very similiar to customizing the main index. -

    -
    -

    Filename -

    - -

    By default, the filename of the index page is "threads.html". However, a -different name may be specified with the M2H_TIDXFNAME environment variable, -the TIDXFNAME resource element, or the -tidxfname command-line option. -

    -
    -

    Beginning Markup -

    - -

    MHonArc allows you to completely override the begining markup of the thread -index page. I.e. You can control the opening <HTML> tag, the HEAD element -contents, the opening <BODY> tag, etc. Therefore, if you are not satisfied with the -default behavior of how the TTITLE resource is used, or have other needs that -require control on the beginning markup, you can set the TIDXPGBEGIN resource -file element. -

    -

    TIDXPGBEGIN -

    - -

    The best way to show how the TIDXPGBEGIN works, the following represents the -default setting MHonArc uses: -

    -
    <TIDXPGBEGIN>
    -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    -<HTML>
    -<HEAD>
    -<TITLE>$TIDXTITLE$</TITLE>
    -</HEAD>
    -<BODY>
    -<H1>$TIDXTITLE$</H1>
    -</TIDXPGBEGIN>
    -
    -
    - -
    -
    NOTE - -

    Technically, setting the TTITLE resource, via the M2H_TTITLE -environment variable, the TTITLE resource file element, or the -ttitle -command-line option, sets the $TIDXTITLE$ resource file variable. -

    -

    The resource variables allowed in the TIDXPGBEGIN element are the following: -

    -
      -
    • $DOCURL$ -- URL to documentation -
    • $GMTDATE$ -- Current GMT date. -
    • $IDXFNAME$ -- Filename of main index page. -
    • $IDXSIZE$ -- Max number of messages that may be listed in the index. -
    • $IDXTITLE$ -- The title of the index page. -
    • $LOCALDATE$ -- Current local date. -
    • $NUMOFIDXMSG$ -- Number of message listed. -
    • $NUMOFMSG$ -- Number of messages in the archive. -
    • $OUTDIR$ -- Pathname of archive. -
    • $PROG$ -- Program name. -
    • $TIDXFNAME$ -- Filename of thread index page. -
    • $TIDXTITLE$ -- Title of thread index page. -
    • $VERSION$ -- Program version. -
    -

    See Resource Variables for more information on the usage of variables. -

    -
    -

    End Markup -

    - -

    Along with controlling the beginning markup, you can control the ending markup. -

    -

    TIDXPGEND -

    - -

    The TIDXPGEND resource element may be used to define the ending markup of the -index page. The default value is the following: -

    -
    <TIDXPGEND>
    -</BODY>
    -</HTML>
    -</TIDXPGEND>
    -
    -
    - -

    The resource variables allowed are the same as for TIDXPGBEGIN. -

    -
    -

    Listing Layout -

    - -

    By default, MHonArc lists the threads in chronological order. The thread with the -oldest initital messsage is listed first, and the thread with the newest initital -message is listed last. The TREVERSE resource may be set to have the thread listing -from newest thread to oldest thread. If the TSUBSORT resource is set, then threads -are sorted by subject. -

    -

    HTML markup can be added to the thread index page by defining the THEAD and -TFOOT resource file elements. Usage of THEAD and TFOOT is discussed later in this -section. -

    -

    MHonArc uses HTML unorder lists for formatting the thread index list. Nested list -markup is used to show the threads. Since threads can become very large, the -TLEVELS resource can be used to limit the number of nested lists allowed. The -default nesting level is 3. -

    -

    Customization over the thread index list format is more restrictive than the main -index. All thread index entries are contained in the HTML LI element, which is -contained in an UL element. The entry text itself can be customized via the TLITXT -resource file element. Usage of TLITXT is discussed later in this section. -

    -

    THEAD -

    - -

    The THEAD resource element specifies text to be inserted before the thread index -listing. The text can be any valid HTML markup. Plus, MHonArc defines the -following variables you may use which get expanded at run-time: -

    -
      -
    • $DOCURL$ -- URL to documentation -
    • $GMTDATE$ -- Current GMT date. -
    • $IDXFNAME$ -- Filename of main index page. -
    • $IDXSIZE$ -- Max number of messages that may be listed in the index. -
    • $IDXTITLE$ -- The title of the index page. -
    • $LOCALDATE$ -- Current local date. -
    • $NUMOFIDXMSG$ -- Number of message listed. -
    • $NUMOFMSG$ -- Number of messages in the archive. -
    • $OUTDIR$ -- Pathname of archive. -
    • $PROG$ -- Program name. -
    • $TIDXFNAME$ -- Filename of thread index page. -
    • $TIDXTITLE$ -- Title of thread index page. -
    • $VERSION$ -- Program version. -
    -

    MHonArc's THEAD default value is the following: -

    -
    <THEAD>
    -<UL>
    -<LI><A HREF="$IDXFNAME$">Main Index</A></LI>
    -</UL>
    -<HR>
    -</THEAD>
    -
    -
    - -

    TLITXT -

    - -

    The TLITXT specifies the markup to use for each entry in the thread index. Only -markup that is legal within the HTML LI element should be used. When you -define the contents for the TLITXT resource element, you may use the following -variables defined by MHonArc (see Resource Variables on the usage of variables): -

    -
      -
    • $A_ATTR$ -- The NAME and HREF attributes to use in an anchor to link to -the archived message. The NAME attribute links the messages to the index -page. -
    • $A_HREF$ -- The HREF attribute to use in an anchor to link to the archived -message. -
    • $A_NAME$ -- The NAME attributes to use in an anchor for messages to link -to the index page. -
    • $DATE$ -- The date of the message. -
    • $DDMMYY$ -- Message date in dd/mm/yy format. -
    • $ICON$ -- The context-type sensistive icon. See Icons for information. -
    • $ICONURL$ -- The URL to the context-type sensistive icon. See Icons for -information. -
    • $MMDDYY$ -- Message date in mm/dd/yy format. -
    • $NUMFOLUP$ -- Number of follow-ups for the given message. -
    • $FROM$ -- The complete text in the From: field of the message. -
    • $FROMADDR$ -- The e-mail address in the From: field of the message. -
    • $FROMNAME$ -- The English name of the person in the From: field of the -message. If no English name is found, the username specified in the e-mail -address is used. -
    • $MSGNUM$ -- The message numbers assigned to the message by MHonArc. -
    • $ORDNUM$ -- The current listing number of the message. -
    • $SUBJECT$ -- The subject text of the message wrapped in an anchor -element that hyperlinks to the message. -
    • $SUBJECTNA$ -- The subject text of the message without the anchor -element. -
    • $YYMMDD$ -- Message date in yy/mm/dd format. -
    -

    -

    -
    -
    NOTE - -

    Do not specify $A_ATTR$, $A_NAME, and $SUBJECT$ together in the -LITEMPLATE element. Since all of these variables contain the NAME -atrribute. Invalid HTML will be created since multiple anchors will have -the same NAME identifier. -

    -

    TLITXT's default value is the following: -

    -
    <TLITXT>
    -($NUMFOLUP$) <STRONG>$SUBJECT:40$</STRONG>, <EM>$FROMNAME$</EM>
    -</TLITXT>
    -
    - -

    TFOOT -

    - -

    The TFOOT resource element specifies the text to use after the end the thread index -list. The text can be any valid HTML markup. TFOOT may contain the same -variables as THEAD. -

    -

    TFOOT's default value is nil. -

    - -
    -[Previous][Next][Contents][FAQ][Bugs][Home] - - diff --git a/examples/deffilters.rc b/examples/deffilters.rc deleted file mode 100644 index 3b0d8b4..0000000 --- a/examples/deffilters.rc +++ /dev/null @@ -1,73 +0,0 @@ - - - -application/mac-binhex40:m2h_external'filter:mhexternal.pl -application/octet-stream:m2h_external'filter:mhexternal.pl -application/oda:m2h_external'filter:mhexternal.pl -application/pdf:m2h_external'filter:mhexternal.pl -application/postscript:m2h_external'filter:mhexternal.pl -application/rtf:m2h_external'filter:mhexternal.pl -application/x-bcpio:m2h_external'filter:mhexternal.pl -application/x-cpio:m2h_external'filter:mhexternal.pl -application/x-csh:m2h_external'filter:mhexternal.pl -application/x-dvi:m2h_external'filter:mhexternal.pl -application/x-gtar:m2h_external'filter:mhexternal.pl -application/x-hdf:m2h_external'filter:mhexternal.pl -application/x-latex:m2h_external'filter:mhexternal.pl -application/x-mif:m2h_external'filter:mhexternal.pl -application/x-netcdf:m2h_external'filter:mhexternal.pl -application/x-patch:m2h_text_plain'filter:mhtxtplain.pl -application/x-sh:m2h_external'filter:mhexternal.pl -application/x-shar:m2h_external'filter:mhexternal.pl -application/x-sv4cpio:m2h_external'filter:mhexternal.pl -application/x-sv4crc:m2h_external'filter:mhexternal.pl -application/x-tar:m2h_external'filter:mhexternal.pl -application/x-tcl:m2h_external'filter:mhexternal.pl -application/x-tex:m2h_external'filter:mhexternal.pl -application/x-texinfo:m2h_external'filter:mhexternal.pl -application/x-troff-man:m2h_external'filter:mhexternal.pl -application/x-troff-me:m2h_external'filter:mhexternal.pl -application/x-troff-ms:m2h_external'filter:mhexternal.pl -application/x-troff:m2h_external'filter:mhexternal.pl -application/x-ustar:m2h_external'filter:mhexternal.pl -application/x-wais-source:m2h_external'filter:mhexternal.pl -application/zip:m2h_external'filter:mhexternal.pl -audio/basic:m2h_external'filter:mhexternal.pl -audio/x-aiff:m2h_external'filter:mhexternal.pl -audio/x-wav:m2h_external'filter:mhexternal.pl -image/gif:m2h_external'filter:mhexternal.pl -image/ief:m2h_external'filter:mhexternal.pl -image/jpeg:m2h_external'filter:mhexternal.pl -image/tiff:m2h_external'filter:mhexternal.pl -image/x-cmu-raster:m2h_external'filter:mhexternal.pl -image/x-pbm:m2h_external'filter:mhexternal.pl -image/x-pgm:m2h_external'filter:mhexternal.pl -image/x-pict:m2h_external'filter:mhexternal.pl -image/x-pnm:m2h_external'filter:mhexternal.pl -image/x-portable-anymap:m2h_external'filter:mhexternal.pl -image/x-portable-bitmap:m2h_external'filter:mhexternal.pl -image/x-portable-graymap:m2h_external'filter:mhexternal.pl -image/x-portable-pixmap:m2h_external'filter:mhexternal.pl -image/x-ppm:m2h_external'filter:mhexternal.pl -image/x-rgb:m2h_external'filter:mhexternal.pl -image/x-xbitmap:m2h_external'filter:mhexternal.pl -image/x-xbm:m2h_external'filter:mhexternal.pl -image/x-xpixmap:m2h_external'filter:mhexternal.pl -image/x-xpm:m2h_external'filter:mhexternal.pl -image/x-xwd:m2h_external'filter:mhexternal.pl -image/x-xwindowdump:m2h_external'filter:mhexternal.pl -message/partial:m2h_text_plain'filter:mhtxtplain.pl -text/html:m2h_text_html'filter:mhtxthtml.pl -text/plain:m2h_text_plain'filter:mhtxtplain.pl -text/richtext:m2h_text_plain'filter:mhtxtplain.pl -text/setext:m2h_text_setext'filter:mhtxtsetext.pl -text/tab-separated-values:m2h_text_plain'filter:mhtxtplain.pl -text/x-html:m2h_text_html'filter:mhtxthtml.pl -text/x-setext:m2h_text_setext'filter:mhtxtsetext.pl -video/mpeg:m2h_external'filter:mhexternal.pl -video/quicktime:m2h_external'filter:mhexternal.pl -video/x-msvideo:m2h_external'filter:mhexternal.pl -video/x-sgi-movie:m2h_external'filter:mhexternal.pl - diff --git a/examples/frames.rc b/examples/frames.rc new file mode 100644 index 0000000..6112958 --- /dev/null +++ b/examples/frames.rc @@ -0,0 +1,577 @@ + + + + + + + + + + + + +FRAME-MAIN +target="MAIN" + + + +FRAME-IDX +target="INDEX" + + + + +NAV-LINKS + + + + + + + + + + + + + + + +
    Thread LinksDate Links
    $TPREVBUTTON$$TNEXTBUTTON$Index$PREVBUTTON$$NEXTBUTTON$Index
    +
    + + + +IDXPG-TBL-LINKS-ATTRS +width="100%" border=0 cellpadding=0 cellspacing=0 + + + + + + + +
    + + + + + + + + +25 + + + + + + + + + + + + + +frm$MSGNUM$.html + + +Message View + + + + + + + + + + +nav$MSGNUM$.html + + +Message Navigation + + +$NAV-LINKS$ + + + + + + + + + + + + +$MAIN-TITLE$ (thread) + + + + +>> + + +>> + + + +<< + + +<< + + + + + +
    + + + + + +
    Page $PAGENUM$ of $NUMOFPAGES$ +
    <<<< +$TPREVPGLINK$ +$TNEXTPGLINK$ +>>>> +
    +
    +
      + + + + +
    +
    + + + + + +
    <<<< +$TPREVPGLINK$ +$TNEXTPGLINK$ +>>>> +
    Page $PAGENUM$ of $NUMOFPAGES$ +
    + + + + + +

    +

  • $SUBJECTNA$
    +$FROMNAME$ + + + + +
  • +

    + + + + + +
  • $FROMNAME$ + + + +
  • + + + + +
  • $SUBJECTNA$, +$FROMNAME$ +
  • +
    + + + +Possible follow-ups + + + + +
  • $SUBJECTNA$, (continued) + + + + +
  • + + + + +
      + + + + +
    + + + + + + + + +$MAIN-TITLE$ (date) + + + + +>> + + +>> + + + + +<< + + +<< + + + + + + + + + + +
    Page $PAGENUM$ of $NUMOFPAGES$ +
    <<<< +$PREVPGLINK$ +$NEXTPGLINK$ +>>>> +
    +
    +
      + + + + +
    +
    + + + + + +
    <<<< +$PREVPGLINK$ +$NEXTPGLINK$ +>>>> +
    Page $PAGENUM$ of $NUMOFPAGES$ +
    + + + + +
  • $SUBJECTNA$ +
    • $FROMNAME$
    +
  • +
    + + + + + + + +

    $SUBJECTNA$

    +
    +
    + + + + + +subject +xref + + + + +-default-:strong + + + + +-default-: + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + +Next + + + +Next + + + +Prev + + + +Prev + + + +Next + + + +Next + + + +Prev + + + +Prev + + + + + + + + +text/plain:quote maxwidth=78 + + + + + +iso-8859-1:-decode- + diff --git a/examples/icons.rc b/examples/icons.rc index 2be0034..c972909 100644 --- a/examples/icons.rc +++ b/examples/icons.rc @@ -1,10 +1,15 @@ +
    + + diff --git a/examples/mhonarc.rc b/examples/mhonarc.rc deleted file mode 100644 index 86463ad..0000000 --- a/examples/mhonarc.rc +++ /dev/null @@ -1,96 +0,0 @@ - - - -Example MIME mail messages converted by MHonArc - - - - -
    -Last update: $LOCALDATE$
    -$NUMOFMSG$ messages in chronological order
    -
    -

    -Listing format is the following: -

    -* -Subject -(# of follow-ups) -From
    -

    -


    -
    - - - -* -$SUBJECT:40$ -($NUMFOLUP$) $FROMNAME$
    -
    - - - -

    -


    -Back to Earl Hood's Home Page -

    - - - -apparently -errors-to -followup -forward -lines -message-id -mime- -nntp- -originator -path -precedence -received -replied -return-path -status -via -x- - - - --default- -subject:strong -from:strong -to:strong - - - --default- -subject:strong -from:strong -to:strong -keywords:em -newsgroups:strong - - - -application/octet-stream:http://www.oac.uci.edu/indiv/ehood/icons/binary.xbm -application/postscript:http://www.oac.uci.edu/indiv/ehood/icons/postscript.xbm -audio/basic:http://www.oac.uci.edu/indiv/ehood/icons/sound.xbm -image/gif:http://www.oac.uci.edu/indiv/ehood/icons/image.xbm -image/jpeg:http://www.oac.uci.edu/indiv/ehood/icons/image.xbm -image/tiff:http://www.oac.uci.edu/indiv/ehood/icons/image.xbm -multipart/alternative:http://www.oac.uci.edu/indiv/ehood/icons/alternative.xbm -multipart/digest:http://www.oac.uci.edu/indiv/ehood/icons/text.xbm -multipart/mixed:http://www.oac.uci.edu/indiv/ehood/icons/mixed.xbm -multipart/parallel:http://www.oac.uci.edu/indiv/ehood/icons/mixed.xbm -text/richtext:http://www.oac.uci.edu/indiv/ehood/icons/mixed.xbm -text/html:http://www.oac.uci.edu/indiv/ehood/icons/mixed.xbm -text/plain:http://www.oac.uci.edu/indiv/ehood/icons/text.xbm -unknown:http://www.oac.uci.edu/indiv/ehood/icons/unknown.doc.xbm -video/mpeg:http://www.oac.uci.edu/indiv/ehood/icons/movie.xbm -video/quicktime:http://www.oac.uci.edu/indiv/ehood/icons/movie.xbm - - diff --git a/faq/about.html b/faq/about.html new file mode 100644 index 0000000..f5b3182 --- /dev/null +++ b/faq/about.html @@ -0,0 +1,72 @@ + + + +MHonArc FAQ: About the FAQ + + + +

    +[Prev][Next][TOC][Home] +

    + + + +
    +

    About the FAQ

    + +

    Summary

    + +

    This documents contains answers to some of the frequently +asked question on MHonArc. MHonArc is +a Perl program +for converting e-mail messages as specified in RFC 822 and MIME to HTML. +MHonArc has the ability to maintain an archive of converted +messages, or it can be used as a basic e-mail->HTML converter.

    + +

    The FAQ is intended to compliment the documentation provided in +the MHonArc distribution. The documentation is still +the key source to answers to any question you may have. +While reading this FAQ, it may be beneficial to have the +documentation easily accessible. +

    + +

    Version

    + +

    Since the FAQ has multiple pages, the date that each page is +updated is at the bottom of each page. +

    + +

    Location

    + +

    (http://www.oac.uci.edu/indiv/ehood/MHonArc/faq/faq.html) +

    + +

    Author

    + +

    Earl Hood, ehood@medusa.acs.uci.edu

    + + +
    + + +

    +[Prev][Next][TOC][Home] +

    + + +
    +
    +97/05/15 16:48:05
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + diff --git a/faq/archives.html b/faq/archives.html new file mode 100644 index 0000000..676ecf4 --- /dev/null +++ b/faq/archives.html @@ -0,0 +1,480 @@ + + + +MHonArc FAQ: Archives + + + +

    +[Prev][Next][TOC][Home] +

    + + + +
    +

    Archives

    + + +

    Why does a message get split into mulitple messages with no headers?

    + +

    If you are processing UUCP mailbox files, messages are +separated by a line starting with "From " (ie. The +word "From" followed by a space). Some mail software +will prefix lines in message bodies with a `>' +to avoid MUA's from incorrectly treating the line as a message +separator. However, some mail software doesn't.

    + +

    To avoid incorrect separator detection, many MUAs perform +a more stricter detection of separators beyond "From ". +MHonArc, by default, will treat lines starting +with "From " as a message separator, which can lead to +incorrect message termination if the From line has not been escaped +with a `>'.

    + +

    To fix the problem, use the MSGSEP resource to +instruct MHonArc to use a stricter test detecting a message +separator. The following MSGSEP resource setting is +known to work well:

    + +
    +<MsgSep>
    +^From \S+\s+\S+\s+\S+\s+\d+\s+\d+:\d+:\d+\s+\d+
    +</MsgSep>
    +
    + +

    If this fails, you can try the CONLEN +resource available in v2.0. The CONLEN resource, when set, tells +MHonArc to utilize the Content-Length fields +in the message head. If your MTA defines this field accurately +(sendmail on Solaris does), then you can utilize this +feature.

    + + +

    Can I move a message from one archive to another?

    + +

    No. In order to achieve the same effect, you must add the original, +unprocessed, message to the destination archive, then remove the +appropriate HTML version of the message from the source archive.

    + + +

    Can I reconstruct a database from the HTML messages?

    + +

    Yes. The following was contributed by +Stephane Bortzmeyer: +

    + +
    +
      +
    • Subject: Improvment to MHonArc FAQ
    • +
    • From: bortzmeyer@internatif.org (Stephane Bortzmeyer)
    • +
    • Date: Sun, 13 Apr 1997 15:29:31 +0200
    • +
    +
    +... some text deleted ...
    +
    +Having rmed my database :-( I had to write such a program. I include it at the end,
    +it seems quite simple, while necessiting a few text edition after (you just have to
    +include the output of my program in an empty database).
    +
    +
    +#!/usr/local/bin/perl
    +
    +require 'timelocal.pl';
    +require '/web/mail/MHonArc/lib/mhutil.pl';
    +require '/web/mail/MHonArc/lib/mhtime.pl';
    +
    +$dir = shift (@ARGV);
    +
    +opendir (DIR, "$dir") || die "Cannot open $dir: $!";
    +while ($file = readdir (DIR)) {
    +    if ($file =~ /^msg([0-9]+)\.html$/) {
    +        $no = $1;
    +        open (FILE, "< $dir/$file") || die "Cannot open $file: $!";
    +        while (<FILE>) {
    +            chop;
    +            if (/^<!--X-([^:]*): (.*)-->$/) {
    +                $headers{$1} = $2;
    +                $headers{$1} =~ s/ *$//;
    +            }
    +        }
    +        close (FILE);
    +        @date = &parse_date ($headers{'Date'});
    +        $date = &get_time_from_date ($date[1], $date[2], $date[3], $date[4], $date[5], $date[6]);
    +        $id = "$date $no";
    +        print STDERR "Message $id:\n";
    +        foreach $header (keys (%headers)) {
    +            print STDERR "$header: $headers{$header}\n";
    +            $name = $header;
    +            $name =~ s/-//;
    +            $$name{$id} = $headers{$header};
    +        }
    +    } 
    +}
    +closedir (DIR);
    +print "%ContentType = (\n";
    +foreach $key (keys (%ContentType)) {
    +    print "\'$key\', \'$ContentType{$key}\',\n";
    +}
    +print ");\n";
    +print "%Date = (\n";
    +foreach $key (keys (%Date)) {
    +    print "\'$key\', \'$Date{$key}\',\n";
    +}
    +print ");\n";
    +print "%From = (\n";
    +foreach $key (keys (%From)) {
    +    print "\'$key\', \'$From{$key}\',\n";
    +}
    +print ");\n";
    +print "%MsgId = (\n";
    +foreach $key (keys (%MessageId)) {
    +    print "\'$key\', \'$MessageId{$key}\',\n";
    +}
    +print ");\n";
    +print "%Subject = (\n";
    +foreach $key (keys (%Subject)) {
    +    print "\'$key\', \'$Subject{$key}\',\n";
    +}
    +print ");\n";
    +print "%IndexNum = (\n";
    +foreach $key (keys (%MessageId)) {
    +    ($garbage, $num) = split (' ', $key);
    +    print "\'$key\', \'$num\',\n";
    +}
    +print ");\n";
    +
    +
    + + + +

    Is it safe to add messages to an archive as they are received?

    + +

    Yes. MHonArc performs archive locking to protect from +multiple MHonArc process attempting to write to an archive +at the same time. This locking allows MHonArc to safely +be used to add messages as they are received. +

    + + +

    So it is safe. How do I do it??

    + +

    The following example assumes you are using on a Unix system +using sendmail as the mail transfer agent. +Please refer to documentation about sendmail if you +are not familiar with it +(sendmail, 2ed, from O'Reilly is an excellent source). +

    + +

    The approach shown here uses a +.forward file in the home directory of the +account you want mailed archived. For this example, let's +assume it is my account. +Here is how to set up the .forward file +to invoke MHonArc on incoming mail:

    + +
    +\ehood, "|/home/ehood/bin/webnewmail #ehood"
    +
    + +
    +
    NOTE on .forward entry: +

    The "\ehood" tells sendmail +to still deposit the incoming message to my mail spool file. The +"#ehood" Bourne shell comment is needed to insure the +command is unique from another user. Otherwise, sendmail +may not invoke the program for you or the other user. +

    + +

    webnewmail is a Perl program that calls +MHonArc with the appropriate arguments. A wrapper program +is used instead of calling MHonArc directly to keep +the .forward file simple, but you can call MHonArc +directly if you want. Here is the code to the +webnewmail program:

    + +
    +#!/usr/local/bin/perl
    +# Edit above path to point to where perl is on your system.
    +
    +##	Specify a package to protect names from MHonArc.
    +##	MHonArc uses package main for most stuff; a minor
    +##	inconvenience.
    +
    +package webnewmail;
    +
    +##	Edit to point to installed mhonarc.
    +
    +$MHonArc = "/home/ehood/bin/mhonarc";
    +
    +##	Define ARGV (ARGV is same across all packages).
    +##	Edit options as required/desired.
    +
    +@ARGV = ("-add",
    +	 "-quiet",
    +	 "-outdir", "/home/ehood/public_html/newmail");
    +
    +##	Just require mhonarc, this prevents the overhead of a
    +##	fork/exec.  We reset the namespace to main just in-case.
    +
    +package main;
    +require $webnewmail'MHonArc;
    +	# Or, $webnewmail::MHonArc (Perl 5 style)
    +
    +
    + +

    The webnewmail program has to have the executable +bit set. This is achieved by using "chmod a+x webnewmail". +

    + + +

    Can I get MHonArc to filter messages to different archives?

    + +

    No. This is outside of the MHonArc's scope. You can grow your +own filter, using the method described in the previous question, to +scan the message header an invoke MHonArc with the proper arguments. +Or. you can use a tool like Procmail +(http://www.ii.com/internet/robots/procmail/). +Here are a some messages from users about using Procmail: +

    + +
    + +
    +... some text deleted ...
    +
    +Here is what I use in .procmailrc to archive the mhonarc list:
    +
    +NEWDATE="`/usr/bin/date +%Y-%m`"
    +MHONARC_MBOX="/local/mail/lists/mhonarc/$NEWDATE.mbox"
    +:0: $MHONARC_MBOX$LOCKEXT
    +* ^Sender:.*owner-mhonarc@
    +{
    +        :0 c
    +        $MHONARC_MBOX
    +
    +        :0 c
    +        | /local/mail/mhonarc-1.2.2/mailarchive -add mhonarc "$NEWDATE"
    +}
    +
    +Mailarchive is nothing more than a wrapper around mhonarc with my long.
    +list of options.
    +
    +Achim
    +P.S. Procmail itself comes with an example manual page. It's worth
    +     looking into it.
    +
    +
    +
    + +
    + +
    +You can actually dispense with the wrapper if you use environment
    +variables to pass options to MHonArc, but I'm sure Achim has a good
    +reason for doing it his way.  Just for the purposes of comparion,
    +here's how I do it:
    +
    +eeeweb% cat .procmailrc
    +#Set on when debugging
    +VERBOSE=off
    +#Replace `mail' with your mail directory (Pine uses mail, Elm uses Mail)
    +MAILDIR=$HOME/Mail
    +#Directory for storing procmail log and rc files
    +PMDIR=$HOME/.procmail
    +#Path and options for mhonarc
    +MHONARC='/dcs/packages/infosys/bin/mhonarc -add -quiet -umask 022 -idxfname inde
    +x.html'
    +:0
    +* ^Originator:.*@classes.uci.edu
    +{
    +  MHHOME=$HOME/classarc
    +  LOGFILE=$PMDIR/classlists.log
    +  INCLUDERC=$PMDIR/rc.classlists
    +}
    +:0 E
    +{
    +  MHHOME=$HOME/mail-arc
    +  LOGFILE=$PMDIR/otherlists.log
    +  INCLUDERC=$PMDIR/rc.otherlists
    +}
    +
    +and then in the file .procmail/rc.classlists or rc.otherlists (depending
    +on the Originator: of the message), lots of the following:
    +
    +# Procmail Entry for uci-www
    +:0 E
    +* ^TOuci-www
    +{
    +  :0 c
    +  uci-www/.
    +
    +  :0
    +  |$MHONARC -rcfile $MHHOME/uci-www/0-rcfile.html -outdir $MHHOME/uci-www
    +}
    +
    +Eric D. Friedman
    +friedman@uci.edu
    +
    +
    + +
    + +
    +... some text deleted ...
    +
    +I use procmail to drive mhonarc archives from Majordomo.  I set up a
    +single pseudouser and drive several archives from the one pseudouser. 
    +
    +Here's a sample .forward file:
    +
    +"|/usr/ucb/rsh cappuccino \"set IFS=' '; exec
    +/usr/local/procmail/bin/procmail #widget\""
    +
    +Another example is:
    +
    +"|/bin/csh -c \"set IFS=' '; exec /usr/local/procmail/bin/procmail
    +#widget\""
    +
    +Two reasons to use the "rsh cappuccino":
    +1. doesn't require the user to be able to login to server, although
    +   the username must still be valid
    +2. gets the processing load off the mail server
    +
    +Here's an example .procmail recipe:
    +
    +LOGFILE=$HOME/procmail_errors
    +LOGABSTRACT=all
    +LOCKEXT=.lock
    +VERBOSE=on
    +UMASK=003
    +
    +# widget: list short description
    +:0 H
    +* ^List-Name: widget
    +{
    +  # The rotate call (under construction) does archive rotation
    +  # leave commented!
    +  #:0c i
    +  #| /home/web-arch/bin/rotate /usr/local/web/webarchive/widget
    +
    +  # Put the mail in the mailbox, which is used by archiver to re-generate
    +  # the html indexes
    +  :0 cA
    +  /usr/local/web/webarchive/widget/current/mbox
    +
    +  # The mhonarc call examines mbox, turns the mail messages into .html
    +  # documents, and compiles the indexes.
    +  # -reverse -treverse\
    +  :0 ia
    +  | /usr/local/mhonarc/bin/mhonarc \
    +    -idxfname index.shtml \
    +    -tidxfname threads.shtml \
    +    -rcfile widget.rc\
    +    -outdir /usr/local/web/webarchive/widget/current \
    +    /usr/local/web/webarchive/widget/current/mbox
    +
    +}
    +
    +I have a directory per archive, and put the current period in directory
    +"current".  Then I have an index page per archive that indexes the
    +periods, plus gives information about the list and how to
    +subscribe/unsubscribe.  The widget.rc file resides in the pseudouser's
    +home directory.
    +
    +Note the 
    +* ^List-Name: widget
    +I put the following in the majordomo list's config file:
    +
    +message_headers   <<  END
    +List-Name: widget
    +END
    +
    +This adds the "List-Name" header to messages, which is what procmail
    +filters for.
    +
    +Hope this helps
    +
    +Paul McKinley
    +Unix SysAdmin Contractor
    +
    +
    + + +

    Is it safe to specify -add when no archive exists?

    + +

    Yes. If MHonArc sees no archive exists when perform +an add, it will automatically create the archive. +

    + +
    +
    WARNING
    +

    Make sure the file maillist.html (or the value +of the IDXFNAME resource) does not exist if no archive exists and +-add has been specified. Otherwise, unpredictable output +of the maillist.html file may result if maillist.html +is not in the proper format. +

    +
    +
    + + +

    Why are there "jumps" in message numbers?

    + +

    Big gaps in the message number sequence may occur if you +defined the MAXSIZE resource and you have +MHonArc rescanning a mail folder for adding new messages. +The problem occurs when MHonArc +reads in messages that will automatically get deleted due +to MAXSIZE. Ie. Messages subject to automatic deletion are +the oldest ones. If the input contains old messages that will +get deleted at the end of processing, the old messages will +still use up message numbers since messages to be deleted are not +determined until all input is read. Since MHonArc does +not keep information about deleted messages, if the messages are +fed into MHonArc again, the "jumping" will occur +again (and the jump will get larger for each additional update). +

    + +

    To avoid the problem, try to pass only new, never processed, +messages to MHonArc instead of having MHonArc +rescanning the same mail folder for new messages. Another +approach is to set either the EXPIREAGE or +EXPIREDATE resources (available in v2.0 beta 2, +or later). These work as an alternative to MAXSIZE and will help in +preventing message number jumping since expiration of a message is +checked when it is initially read (bypassing the assignment of +a message number).

    + + +
    + + +

    +[Prev][Next][TOC][Home] +

    + + +
    +
    +97/05/20 12:42:04
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + + diff --git a/faq/envs.html b/faq/envs.html new file mode 100644 index 0000000..4dc937d --- /dev/null +++ b/faq/envs.html @@ -0,0 +1,184 @@ + + + +MHonArc FAQ: Supported Environments + + + +

    +[Prev][Next][TOC][Home] +

    + + + +
    +

    Supported Environments

    + + +

    What platforms can MHonArc run under?

    + +

    MHonArc is known to run under many varieties of Unix, +MS-DOS/Windows, WinNT, Win95, OS/2. +

    + + +

    What about Mac?

    + +

    MHonArc has been coded to support MacPerl, but no +adequate testing has been done to verify the code. +Please notify the author if you are interested in +testing MHonArc under MacPerl. +

    + + +

    What version of Perl is required to run MHonArc?

    + +

    MHonArc can run under Perl 4 or 5. Perl 5 is recommended +for performance reasons and for the possibility that future releases +of MHonArc will use Perl 5 features.

    + +
    +
    NOTE
    +

    Current plans are for MHonArc v3 +to be the Perl 5 rewrite of MHonArc v2.x. v2.x will +probably be the last major version to run under Perl 4. +

    +
    +
    + + +

    What mail user agents (MUA's) does MHonarc support?

    + +

    MHonArc can convert mail that is stored in UUCP mailbox +format (ie. all messages are in a single file), or in the format used +by the +Rand Message Handler +(MH) (messages are contained in separate +files within a directory). MHonArc is known to work with +the following MUAs: MH, mail, Mail, +Elm, Eudora, WinVN, Windows +Trumpet, and NUPop.

    + +
    +
    NOTE + +

    To support some MUA's, it may require redefining the +MSGSEP or MHPATTERN resource. Please consult the documentation +for more information about these resources.

    +
    + + +

    Can MHonArc process Compuserve messages?

    + +

    Here is a response from a user: +

    +
    +
      +
    • Subject: Re: CompuServe --> html
    • +
    • From: Steve Pacenka <sp17@cornell.edu>
    • +
    • Date: Thu, 06 Mar 1997 09:09:00 -0500
    • +
    +
    +At 11:38 AM 3/6/97 +0100, Bernard Frit wrote:
    +>Hi everybody,
    +>
    +>A friend of mine has a lot of archives in CompuServe
    +>thread and message format. He'd like to convert them
    +>in a convenient format (html or whatever) with thread
    +>indexing features as MHonArc is doing it for mail
    +>archives.
    +>
    +>At the first glance, I didn't find out how to configure
    +>MHonArc to do the job.
    +
    +The Compuserve "file cabinet" format is too far from the basic SMTP message
    +format that MHonArc recognizes.
    +
    +Your friend can find software on Compuserve to read the file cabinet format
    +and emit ascii text that is closer to SMTP message format that MHonArc can
    +use.  A search of IBMFF using the keywords "cabinet" and "convert" yielded
    +several items including these two:
    +
    +Forum Name: CSNAVSUPPORT                 Library: Member Uploads  (6)
    +  Accesses: 839                       Size: 11368
    +      File: THRDCO.ZIP           Submitted: [72662,70]   26-Aug-94
    +
    +
    +This program converts forum message threads to a plain text file  called
    +COLLECT.TXT.  Your favorite word processor can then search  for any message
    +on any topic that you have downloaded.  It is  public domain and was
    +created because I have so many forum  thread messages which I can't search.
    +
    +-----
    +Forum Name: PCEFORUM                 Library: Telecom/Reseaux  (8)
    +  Accesses: 32                        Size: 30865
    +      File: SHWCIM.ZIP           Submitted: [72241,2132]   08-Nov-96
    +
    +Une fois stockes dans le "Cabinet"  CompuServe, les messages des forums et
    +les courriers sont codes dans des fichiers binaires que l'on ne peut pas
    +relire directement. Cet utilitaire a pour but de convertir n'importe quel
    +fichier de la base WinCIM en fichier ASCII pur. Freeware en anglais.
    +
    +-- SP
    +
    +
    +
    + + +

    Can MHonArc create non-English archives?

    + +

    Yes. With MHonArc's page layout customizations features, +you can have MHonArc create pages in any language supported +by Web client software. Plus, messages containing non-English text +is supported during message conversion. For text messages, +MHonArc supports the ISO-8859 character sets and the +ISO-2022-JP character set. +

    + + +

    Can I create bilingual archives?

    + +

    Yes. You can actually create archives that have as many +indexes as you want in as many languages that you want. Through +the OTHERINDEXES resource can define any number of extra indexes +to create. For each index, you can redfine the index resources +to use whatever text (English or non-English) you desire. +

    +
    +
    NOTE
    +

    There is no support for mulitple variations of message +pages in an archive. Therefore, a single language must be +chosen for message pages, or you can include redundant information +using multiple languages. +

    +
    +
    +
    +
    NOTE
    +

    Actual message data will be in the language used in the +message. MHonArc has no built-in language translation. +

    +
    +
    + + +
    + + +

    +[Prev][Next][TOC][Home] +

    + + +
    +
    +97/05/15 16:48:06
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + diff --git a/faq/faq.html b/faq/faq.html new file mode 100644 index 0000000..bd04c2d --- /dev/null +++ b/faq/faq.html @@ -0,0 +1,139 @@ + + + +MHonArc Frequently Asked Questions + + + + + + + +

    MHonArc Frequently Asked Questions

    + +

    This documents contains answers to some of the frequently +asked question on MHonArc. MHonArc is +a Perl program +for converting e-mail messages as specified in RFC 822 and MIME to HTML. +MHonArc has the ability to maintain an archive of converted +messages, or it can be used as a basic e-mail->HTML converter.

    + + +
    +

    Table of Contents

    + + + + + + + + + + + + + + +
    +
    +97/05/15 16:48:07
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + diff --git a/faq/general.html b/faq/general.html new file mode 100644 index 0000000..899ef0b --- /dev/null +++ b/faq/general.html @@ -0,0 +1,188 @@ + + + +MHonArc FAQ: General Information + + + +

    +[Prev][Next][TOC][Home] +

    + + + +
    +

    General

    + + +

    What is MHonArc?

    + +

    MHonArc is +a Perl program +for converting e-mail messages as specified in RFC 822 and MIME to HTML. +MHonArc has the ability to maintain an archive of converted +messages, or it can be used as basic e-mail->HTML converter. +

    + + +

    What's the latest version of MhonArc?

    + +

    2.0.0. +

    + + +

    Where can I get MHonArc?

    + +

    The latest information on MHonArc, +and its availability, may be obtained at (http://www.oac.uci.edu/indiv/ehood/mhonarc.html). +

    + + +

    How much does MHonArc cost?

    + +

    Its FREE! MHonArc is distributed under +the GNU General Public License. A copy of the license is included in +the distribution. Please read it for more information.

    + +

    Although MHonArc is freely available, it is NOT +in the public domain. Applicable copyrights still apply. +

    + + +

    Where can I get help on MHonArc?

    + +

    The first place to try is the documentation that comes with +MHonArc. The documentation is quite extensive, and may +provide answers to most of your questions.

    + +

    Second, you can read this FAQ. +

    + +

    Third, a mailing list, mhonarc@rosat.mpe-garching.mpg.de, is available to +provide a discussion forum on the usage and development of +MHonArc. Appropriate topics for the list include: usage +questions, bug reports, behavioral enhancements, documentation bugs, +and general help.

    + +

    To subscribe to the mailing list, send mail to mhonarc-request@rosat.mpe-garching.mpg.de +with the command,

    + +
    +subscribe
    +
    + +

    as the message body. +

    + +

    If you send mail mhonarc@rosat.mpe-garching.mpg.de, your message will be +distributed to all subscribers on the list.

    + +

    The mailing list is archived by +Majordomo. You can also use the WWW to access +the archive (with full text search using +Glimpse) at +(http://www.rosat.mpe-garching.mpg.de/mailing-lists/mhonarc/) +

    + + +

    How does MHonArc compare to other e-mail converters, like Hypermail?

    + +

    Hypermail, +(http://www.eit.com/software/hypermail/hypermail.html) +is probably the only other major free program for archiving +e-mail on the Web. There are other free programs available, +but Hypermail and MHonArc appear to be the two major programs +in use. + +

    Although Hypermail is a good product, +MHonArc has the following advanatages: +

    +

      +
    • Support variant mail folders types. Hypermail supports only +UUCP style mailboxes. +

      +
    • +
    • Support for MIME. Hypermail does not support MIME. With +the MIME model, you can extend MHonArc to handle content-types +that it does not support by default. Also, with MIME, non-textual +data like images will be handled properly. +

      +
    • +
    • Page customization. MHonArc gives you complete control +on how pages are formatted. This allows you to tailor your archives +to fit the style of your Web site. Hypermail has a predefined +style for pages generated. Note, Hypermail does support some +simple options that effect how data is converted to HTML. +

      +
    • +
    • Multi-platform support. MHonArc basically runs on any system +that Perl runs. Hypermail is only known to run on Unix systems, +however, there may be a WinNT port. +

      +
    • +
    + +

    The other major difference is that MHonArc is written in +Perl, and Hypermail is written in C (there is also a Lisp version). +There are pros and cons of both languages. In sum, Perl allows +for easier modification, portability, and extensiblility. C +provides better execution speed. +

    + +

    There are other differences, so consult the documentation of +both programs to get a more complete list. Your needs willl +ultimately decide which program is best for you. +

    + + +

    Are their "real-world" examples of MHonArc usage?

    + +

    Take your pick: +

    + + + +
    + + +

    +[Prev][Next][TOC][Home] +

    + + +
    +
    +97/05/15 16:48:08
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + diff --git a/faq/indexpgs.html b/faq/indexpgs.html new file mode 100644 index 0000000..2b60f79 --- /dev/null +++ b/faq/indexpgs.html @@ -0,0 +1,100 @@ + + + +MHonArc FAQ: Index Pages + + + +

    +[Prev][Next][TOC][Home] +

    + + + +
    +

    Index Pages

    + + +

    What are all the different index types?

    + +

    MHonArc catagorizes indexes into to types: +main and thread. Main covers indexes +listing messages by the following criteria: +

    +
      +
    • Author +
    • Date +
    • Subject +
    • Message number +
    + +

    When the documentation refers to main index, +it refers to the index listing messages by author, date, or +subject. Therfore, all resources. and resource variables, that +refer to the main index apply to either an author, date, or +subject index. The type of main index is controled by +the SORT, SUBSORT, AUTHSORT resources. +

    + +

    By default, MHonArc creates a date index +and a thread index. +Author index support is available only in v2.0 beta 2 or later. +

    + + +

    Can I have additional indexes beyond the default main and thread index?

    + +

    Yes. In version 1.2 (or later), a resource was added called +OTHERINDEXES. With this resource, you are able to +define an arbitrary number of indexes you desire. The additional +indexes may be in any format you desire and that is supported +by MHonArc. Refer to the documentation for the usage of +OTHERINDEXES. +

    + +
    +
    NOTE
    +

    MHonArc will NOT automatically +create links to any indexes created via the OTHERINDEXES resource. +You will need to modify the relevant index and messages resources +to contain the additional links. See the LISTBEGIN and +THEAD resources. +

    +
    +
    + + +

    Can I have multi-page indexes?

    + +

    Yes, in v2.0 or later. Setting the MULTIPG and IDXSIZE will cause +indexes to to be listed across multiple pages with IDXSIZE determine +the number of messages listed per page. +

    + + +

    Can I sort messages by author?

    + +

    Yes, with v2.0 beta 2, or later. +

    + + +
    + + +

    +[Prev][Next][TOC][Home] +

    + + +
    +
    +97/05/15 16:48:09
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + diff --git a/faq/mime.html b/faq/mime.html new file mode 100644 index 0000000..ee3bae8 --- /dev/null +++ b/faq/mime.html @@ -0,0 +1,83 @@ + + + +MHonArc FAQ: MIME + + + +

    +[Prev][Next][TOC][Home] +

    + + + +
    +

    MIME

    + + +

    What is MIME?

    + +

    MIME stands for Multipurpose Internet +Mail Extensions. +An HTML version of the RFCs that define MIME are available at (http://www.oac.uci.edu/indiv/ehood/MIME/MIME.html). +

    + +

    In sum, MIME "redefines the format of message bodies to +allow multi-part textual and non-textual message bodies to +be represented and exchanged without loss of information." [RFC +1521]

    + + +

    Does MHonArc support message header extensions for non-ASCII text

    + +

    v2.0 or later. +

    + + +

    How can I get MHonArc to recognize content-types it states it does not recognize?

    + +

    This question can be anwsered by reading about the MIMEFILTERS +resource of the +MHonArc documentation. The solution may require registering +a pre-existing filter for the given content-type, or hooking in a +new filter.

    + + +

    Can I override the default filters in MHonArc

    + +

    Yes. MHonArc's default filters are hooked in +as described in the MIMEFILTERS resource. +

    + + +

    Can I override the multipart/* processing of MHonArc

    + +

    Yes, but not recommended. Make sure you are familiar with how +MHonArc does things before considering implemting your own multipart +filter. In sum, you can completely replace MHonArc's filters +with your own if you so desire. +

    + + +
    + + +

    +[Prev][Next][TOC][Home] +

    + + +
    +
    +97/05/15 16:48:09
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + diff --git a/faq/monicon.gif b/faq/monicon.gif new file mode 100644 index 0000000000000000000000000000000000000000..a0a9161391e022a624a64264cf74261e453ac8cf GIT binary patch literal 452 zcmZ?wbhEHblw}ZM_#(-`%D`eGz^1FLCaD{)=b!H_!jNXf9q($WlD9-++9#EXHHhEE$9eq3Pq|AFDy{wYAk3>ZN1CkrP7 zgCv9EKQ#pf&)kCiqLS1Ug|wplTm^SeH-*gH#Pn1vh1`t%yu_kpz4Xj91|5(YAlEst z{!>trX>u^}nx^QnO6$#SfrA-6AO z0XwDs{3RE-4scB@u~0ga8_w$G`cK+NPsH-tT^A8;Q3*z2J|;cQb|yYyMu`U3sDh$m zfh>k3fyveRmP~9SnSzxJm6;3JnCAE~3lxir^D^^_ujBVw6>TCA#pSp?-PWMg4qVOu!)(Hy5>+X^;@`JaPX z8FxssGcq!CgfKBYWOQKo&-dZ9!h?e{2KEddD-u>QwS;i + + +MHonArc FAQ: Message Pages + + + +

    +[Prev][Next][TOC][Home] +

    + + + +
    +

    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>
    +<tbody>
    +</FIELDSBEG>
    +<LABELBEG>
    +<tr>
    +<td align="right" valign="top">
    +</LABELBEG>
    +<LABELEND>
    +</td>
    +</LABELEND>
    +<FLDBEG>
    +<td align="left">
    +</FLDBEG>
    +<FLDEND>
    +</td>
    +</tr>
    +</FLDEND>
    +<FIELDSEND>
    +</tbody>
    +</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>
    +
    + + +

    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. 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. +

    + + +

    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. +

    + + +
    + + +

    +[Prev][Next][TOC][Home] +

    + + +
    +
    +97/05/15 16:48:13
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + diff --git a/faq/threads.html b/faq/threads.html new file mode 100644 index 0000000..06767d1 --- /dev/null +++ b/faq/threads.html @@ -0,0 +1,90 @@ + + + +MHonArc FAQ: Threading + + + +

    +[Prev][Next][TOC][Home] +

    + + + +
    +

    Threading

    + + +

    How does threading work?

    + +

    MHonArc utilizes the References and +In-Reply-To fields of mail messages for generating +threads. It is up to the mail user agents (MUAs) to define these +fields. The References field is normally utilized by +news software, while In-Reply-To is normally utilized +be e-mail software.

    + +

    In v2.0, MHonArc will also check message subjects for +threads. Hence, if the MUA fails to include the reference message +ID, MHonArc will still group messages of the same subject +together (utilizing the message date for thread order). +

    + + +

    Why isn't threading working for me?

    + +

    In versions prior to v2.0, If the mail you archive does not +contain References and In-Reply-To fields, +MHonArc will not detect a thread, even though there are +messages that are follow-ups to existing messages.

    + + + +

    How can I get my MUA to define the References or In-Reply-To field?

    + +

    The answer varies depending on your MUA. You'll need to look at the +documentation of your MUA to find the answer. +

    + +

    For MH users, the following in your replcomps file will work: +

    + +
    %<{date}In-reply-to: Your message of "\
    +%<(nodate{date})%{date}%|%(pretty{date})%>."%<{message-id}
    +             %{message-id}%>\n%>\
    +
    +
    + +

    Or, you can use the following if you prefer the +References field format:

    + +
    %<{message-id}References: \
    +%<{references}%(void{references})%(trim)%(putstr) %>
    +            %(void{message-id})%(trim)%(putstr)\n%>\
    +
    +
    + +

    Author welcomes feedback from users on how to configure other MUAs. +

    + + +
    + + +

    +[Prev][Next][TOC][Home] +

    + + +
    +
    +97/05/15 16:48:10
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + diff --git a/faq/usage.html b/faq/usage.html new file mode 100644 index 0000000..5ad524c --- /dev/null +++ b/faq/usage.html @@ -0,0 +1,180 @@ + + + +MHonArc FAQ: General Usage + + + +

    +[Prev][Next][TOC][Home] +

    + + + +
    +

    General Usage

    + + +

    What are "resources"?

    + +

    The behavior of MHonArc is controled by resources. +Resources are set, or defined, by command-line options, environment +variables, or a resource file. For example, the MAXSIZE resource tells +MHonArc the maximum number of messages in an archive. To set +the resource, you can use the -maxsize +command-line option, the M2H_MAXSIZE envariable, or the +<MAXSIZE> resource file element. +

    + +

    See the documentation for more information. +

    + + +

    I get an error that "newgetopt.pl" cannot be required, where is it?

    + +

    newgetopt.pl comes with the standard Perl distribution. Check with +your sys admin on where it is located (it should be in the default Perl +search path). +

    + + +

    Does MHonArc provide searching of archives?

    + +

    No, but a searching can be provided by another utility. See +the MHonArc home page +(http://www.oac.uci.edu/indiv/ehood/mhonarc.html) to +some links to contributed programs for searching MHonArc +archives. +Also, any standard search engine can be used. For example, the +MHonArc mailing list archive +(http://www.rosat.mpe-garching.mpg.de/mailing-lists/mhonarc/) +provides a +Glimpse +(http://glimpse.cs.arizona.edu:1994/) +search engine for searching messages. For more information, see +the respective documentation of the search engine software of +interest. +

    + +
    +
    NOTE
    +

    Through MHonArc's resources, it is easy to provide +a search form to whatever search utility you may use without +modifying MHonArc source code. +

    +
    +
    + + +

    Is there a Web interface for MHonArc?

    + +

    There is no known Web interface that uses MHonArc to +allow people to read incoming mail or perform archive administration +function. If you know of one, please contact the author of the FAQ. +

    + + +

    Does MHonArc require that the original message be available when updating an archive?

    + +

    No. Once a message is archived, the original can be stored +away. MHonArc preserves all relevant information in its +database. For possible recovering purposes, it is recommended +to preserve original messages in a storage archive. This allows +you to rebuild MHonArc archives in case of data corruption. +

    + + +

    Do I have to respecify the resource file each time I update an archive?

    + +

    No. The archive database stores all resource settings. The only +time you need to respecify the resource file is if changes are required +in the layout of the archive.

    + +
    +
    NOTE + +

    When utilizing the OTHERINDEXES resource, +the resource filenames listed in the main resource file are stored +in the database, but the resources for each additional index are +NOT. Hence, the resource files defining the additional +indexes must be accesible. +

    + + +

    Can I have MHonArc process a bunch of separate message files?

    + +

    Yes. MH mail folder processing is just processing a bunch of +separate message files in a directory. MHonArc uses +the MHPATTERN resource to determine which files to process. Therefore, +all you need to do is redefine the MHPATTERN resource and pass +the directory your message files are in when invoking MHonArc. +

    + +

    For example, say I want to process all files in a directory +called "messages". I'd do the following: +

    +
    +    % mhonarc -mhpattern "^[^.]" messages
    +
    +

    MHPATTERN can be any Perl regular expression. The one in +the example matches any file not beginning with ".". This +is to avoid the special files "." and ".." which are directories. +

    + +

    The other way to process individual message files is to do +it one at a time. For example: +

    +
    +    % mhonarc -add < file1.822
    +    % mhonarc -add < file2.822
    +    ...
    +
    + + +

    Can I tell MHonArc to read a mailbox from standard input?

    + +

    Yes, but only in v2.0 or later (v2.0 beta releases do not have +the capability). The syntax is something like the following: +

    +
    +    % mhonarc [options-here] -- -
    +
    +

    The "--" tells MHonArc to terminate all command-line +option processing and treat all following arguments as mail +folders. The "-" signifies to use standard input as a mailbox +source. +

    + +

    Since MHonArc can read a mailbox from stdin, this +allows MHonArc to be part of a pipeline where MHonArc +takes input from some preprocessor that massages some data to +make it suitable for processing by MHonArc. For example: +

    +
    +    % mypreproc | mhonarc -- -
    +
    + + +
    + + +

    +[Prev][Next][TOC][Home] +

    + + +
    +
    +97/05/15 16:48:11
    + +MHonArc
    +Copyright © 1997, Earl Hood, ehood@medusa.acs.uci.edu
    +
    + + diff --git a/install.cfg b/install.cfg index afaa147..da4639b 100644 --- a/install.cfg +++ b/install.cfg @@ -1,68 +1,74 @@ -##---------------------------------------------------------------------------## -## File: -## install.cfg -## Description: -## This is a sample configuration file for install.me for -## non-interactive use. This allows you to install the program -## in batch mode. To invoke install.me in batch mode, just -## specify the configuration file on the command-line: -## -## perl install.me install.cfg -## -## This file is Perl code, and therefore, must follow Perl syntax -## rules: -## -## o Anything following a '#' character is ignored. -## -## o Strings values need to be enclosed in quotes. -## -## o If you need to use a backslash in a string value, -## it must be escaped with a backslash. Example: -## -## 'C:\\LIB\\MHONARC'. -## -## The same applies to the '$' character. -## -## o All statements must end with a semi-colon: ; -## -## Notes: -## o Paths specified in the configuration file should exist. -## install.me will not automatically create them as it does -## in interactive mode. -## -##---------------------------------------------------------------------------## +##************************************************************************## +## 97/02/24 12:34:23 +##************************************************************************## -# Should executables be installed. 0 => NO, non-zero => YES. -# -$dobin = 1; +## Set flags +$dobin = 1; # Set to 1 if exectuables to install +$dolib = 1; # Set to 1 if libraries to install +$dodoc = 1; # Set to 1 if documents to install +$doman = 0; # No manpages to install -# Should libraries be installed. 0 => NO, non-zero => YES. -# -$dolib = 1; +## Set default values +$bindir = (!$MSDOS ? '/usr/local/bin' : 'C:\\BIN'); +$libdir = (!$MSDOS ? '/usr/local/lib/MHonArc' : 'C:\\LIB\\MHONARC'); +$docdir = (!$MSDOS ? '/usr/local/lib/MHonArc/doc' : 'C:\\DOC\\MHONARC'); +$perlprg = (!$MSDOS ? '/usr/local/bin/perl' : 'C:\\BIN\\PERL.EXE'); -# Should documentation be installed. 0 => NO, non-zero => YES. -# -$dodoc = 1; -# Location for executable. If using ms-dos, use something like -# 'C:\\BIN'. -# -$bindir = '/usr/local/bin'; +##************************************************************************## +## SHOULD NOT HAVE TO MODIFY ANYTHING PASSED HERE +##************************************************************************## -# Location for libraries. If using ms-dos, use something like -# 'C:\\LIB\\MHONARC'. -# -$libdir = '/usr/local/lib/MHonArc'; +## Set files to install +$relbin = '.'; # Location of source bin files relative to install.me +@binfiles = ( + 'mhonarc', +); +$rellib = 'lib'; # Location of source lib files relative to install.me +@libfiles = ( + 'base64.pl', + 'ewhutil.pl', + 'iso8859.pl', + 'mhdb.pl', + 'mhdysub.pl', + 'mhexternal.pl', + 'mhidxrc.pl', + 'mhinit.pl', + 'mhrcfile.pl', + 'mhrcvars.pl', + 'mhtime.pl', + 'mhtxthtml.pl', + 'mhtxtplain.pl', + 'mhtxtsetext.pl', + 'mhusage.pl', + 'mhutil.pl', + 'osinit.pl', + 'qprint.pl', + 'readmail.pl', + 'rfc822.pl', +); +$reldoc = 'doc'; # Location of source doc files relative to install.me +@docfiles = ( + 'contacts.html', + 'diagnos.html', + 'intro.html', + 'layout.html', + 'mhonarc.html', + 'quickstart.html', + 'resources', # This is a directory + 'resources.html', + 'monicon.gif', + 'monstamp_t.gif', +); -# Location for documents. If using ms-dos, use something like -# 'C:\\DOC\\MHONARC'. -# -$docdir = '/usr/local/lib/MHonArc/doc'; +## Define intro text +$introText =< to accept +the default values listed in ()'s. -# Location of perl executable. If using ms-dos, use something like -# 'C:\\BIN\\PERL.EXE'. -# -$perlprg = '/usr/local/bin/perl'; +EndofIntro - -1; # DO NOT DELETE THIS LINE +1; diff --git a/install.me b/install.me index e8128d3..91b2018 100755 --- a/install.me +++ b/install.me @@ -1,18 +1,16 @@ #! /usr/local/bin/perl ##---------------------------------------------------------------------------## ## File: -## install.me +## @(#) install.me 1.8 97/05/15 16:55:42 @(#) ## Author: -## Earl Hood ehood@isogen.com +## Earl Hood ehood@medusa.acs.uci.edu ## Description: ## Configurable installation program. -## Just edit the variables in the CONFIG section for setting defaults -## for the particular program. -## To Do: -## o Add support for manpages to go in different section directories. +## Create an install.cfg file to define variables with the +## values appropriate for the software you want to install. ## ##---------------------------------------------------------------------------## -## Copyright (C) 1995,1996 Earl Hood, ehood@isogen.com +## Copyright (C) 1995-1997 Earl Hood, ehood@medusa.acs.uci.edu ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -45,102 +43,94 @@ package main; $'DIRSEP = '/'; $'CURDIR = '.'; } ## Store name of program - ($tmp = $'DIRSEP) =~ s/(\W)/\\$1/g; - ($'PROG = $0) =~ s%.*[$tmp]%%o; + ($'DIRSEPrxp = $'DIRSEP) =~ s/(\W)/\\$1/g; + ($'PROG = $0) =~ s%.*[$DIRSEPrxp]%%o; } +eval 'umask 022' if $UNIX; # Set umask + ##--------------------------------------------------------------------------- -## Begin CONFIG section +## BEGIN template for install.cfg ## -eval 'umask 022' if $UNIX; # Set umask +## Flag if Perl 5 install (use "use lib ..." instead if @INC) +$doPerl5 = 0; ## Set flags $dobin = 1; # Set to 1 if exectuables to install $dolib = 1; # Set to 1 if libraries to install $dodoc = 1; # Set to 1 if documents to install +$doman = 1; # Set to 1 if manpages to install ## Set default values $bindir = (!$MSDOS ? '/usr/local/bin' : 'C:\\BIN'); -$libdir = (!$MSDOS ? '/usr/local/lib/MHonArc' : 'C:\\LIB\\MHONARC'); -$docdir = (!$MSDOS ? '/usr/local/lib/MHonArc/doc' : 'C:\\DOC\\MHONARC'); +$libdir = (!$MSDOS ? '/usr/local/lib' : 'C:\\LIB'); +$docdir = (!$MSDOS ? '/usr/local/lib' : 'C:\\DOC'); +$mandir = (!$MSDOS ? '/usr/local/man' : 'C:\\MAN'); $perlprg = (!$MSDOS ? '/usr/local/bin/perl' : 'C:\\BIN\\PERL.EXE'); -## Set files to install +## Set files to install. File can be a directory. If so, the +## directory is copied to destination + $relbin = '.'; # Location of source bin files relative to install.me -@binfiles = ( - "mhonarc", -); +@binfiles = (); + $rellib = 'lib'; # Location of source lib files relative to install.me -@libfiles = ( - "base64.pl", - "mhdb.pl", - "mhexternal.pl", - "mhtxt2022.pl", - "mhtxthtml.pl", - "mhtxtplain.pl", - "mhtxtsetext.pl", - "mhinit.pl", - "mhutil.pl", - "osinit.pl", - "qprint.pl", - "readmail.pl", -); +@libfiles = (); + $reldoc = 'doc'; # Location of source doc files relative to install.me -@docfiles = ( - "adding.html", - "contacts.html", - "details.html", - "diagnos.html", - "indexpg.html", - "install.html", - "intro.html", - "message.html", - "mhonarc.html", - "mhonarc.txt", - "mime.html", - "overview.html", - "qstart.html", - "rcfile.html", - "removing.html", - "stamp_t.gif", - "thread.html", -); +@docfiles = (); + +$relman = 'man'; # Location of source manpages relative to install.me +@manfiles = (); ## Define intro text $introText =< -to accept the default values listed in ()'s. - -If directory path does not exist on your system, the installation -program will create the path for you. +the Perl executable is and where to put files. Just hit to accept +the default values listed in ()'s. EndofIntro ## -## End CONFIG section +## END template for install.cfg ##--------------------------------------------------------------------------- + ##--------------------------------------------------------------------------- -## Main routine +## Main routine ##--------------------------------------------------------------------------- { + +$Batch = 0; +$CfgFile = "install.cfg"; +if ($ARGV[0] =~ /^batch$/i) { + shift(@ARGV); + $Batch = 1; +} +if ($ARGV[0] =~ /\S/) { + $CfgFile = shift(@ARGV); +} + +require $CfgFile || die "Unable to require $CfgFile\n"; + { package uio; - @LastText = (); ## Cached text - $use_handler = 1; ## Flag to use private CONT signal handler - $ext_sigcont; ## External CONT handler + @LastText = (); ## Cached text + $use_handler = 1; ## Flag to use private CONT signal handler } -if ($ARGV[0]) { ## Check for batch mode - eval qq{require "$ARGV[0]"}; - die "ERROR: Unable to read $ARGV[0]\n" if $@; +if ($Batch) { ## Check for batch mode + print STDOUT "Batch mode install ...\n"; -} else { ## Interactive mode +} else { ## Interactive mode print STDOUT $introText; &print_note("Make sure all pathnames are absolute."); &pause(); + $dobin = 0 unless scalar(@binfiles); + $dolib = 0 unless scalar(@libfiles); + $dodoc = 0 unless scalar(@docfiles); + $doman = 0 unless scalar(@manfiles); do { ## Get installation directories and path to Perl while (1) { @@ -151,88 +141,129 @@ if ($ARGV[0]) { ## Check for batch mode $perlprg = $tmp; if ($dobin) { do { - $tmp = &prompt_user_def("Location to install programs", - $bindir, 0, 1); + $tmp = &interpolate_path( + &prompt_user_def("Location to install programs", + $bindir, 0, 1)); } while (!&create_dir($tmp)); $bindir = $tmp; } if ($dolib) { do { - $tmp = &prompt_user_def("Location to install libraries", - $libdir, 0, 1); + $tmp = &interpolate_path( + &prompt_user_def("Location to install libraries", + $libdir, 0, 1)); } while (!&create_dir($tmp)); $libdir = $tmp; } if ($dodoc) { if (&ask_question("Install documentation", 1)) { do { - $tmp = &prompt_user_def("Location to install docs", - $docdir, 0, 1); + $tmp = &interpolate_path( + &prompt_user_def("Location to install docs", + $docdir, 0, 1)); } while (!&create_dir($tmp)); $docdir = $tmp; } else { $dodoc = 0; } } + if ($doman) { + if (&ask_question("Install manpages", 1)) { + do { + $tmp = &interpolate_path( + &prompt_user_def("Location to install manpages", + $mandir, 0, 1)); + } while (!&create_dir($tmp)); + $mandir = $tmp; + } else { + $doman = 0; + } + } print STDOUT "\n", "You've specified the following:\n", "\tPerl location: $perlprg\n"; print STDOUT "\tProgram directory: $bindir\n" if $dobin; print STDOUT "\tLibrary directory: $libdir\n" if $dolib; print STDOUT "\tDoc directory: $docdir\n" if $dodoc; + print STDOUT "\tMan directory: $mandir\n" if $doman; } while (!&ask_question("Is this correct", 1)); } ## Install files -$perlprg = "#! $perlprg\n"; -$perlprg .= "unshift(\@INC, '$libdir');\n" if $dolib; +$perlprg = "#!$perlprg\n"; +if ($dolib) { + if ($doPerl5) { + $perlprg .= "use lib '$libdir';\n"; + } else { + $perlprg .= "unshift(\@INC, '$libdir');\n"; + } +} if ($dobin && @binfiles) { print STDOUT "Installing the following into $bindir\n"; foreach $file (@binfiles) { - &cp("$relbin$DIRSEP$file", "$bindir$DIRSEP$file", $perlprg); + ($destfile = $file) =~ s%.*$DIRSEPrxp%%o; + &cp("$relbin$DIRSEP$file", "$bindir$DIRSEP$destfile", $perlprg); print STDOUT "\t", $file, "\n"; - chmod 0755, "$bindir/$file"; + eval 'chmod 0755, "$bindir$DIRSEP$file"'; } } if ($dolib && @libfiles) { print STDOUT "Installing the following into $libdir\n"; foreach $file (@libfiles) { - &cp("$rellib$DIRSEP$file", "$libdir$DIRSEP$file"); + ($destfile = $file) =~ s%.*$DIRSEPrxp%%o; + &cp("$rellib$DIRSEP$file", "$libdir$DIRSEP$destfile"); print STDOUT "\t", $file, "\n"; } } if ($dodoc && @docfiles) { print STDOUT "Installing the following into $docdir\n"; foreach $file (@docfiles) { - &cp("$reldoc$DIRSEP$file", "$docdir$DIRSEP$file"); + ($destfile = $file) =~ s%.*$DIRSEPrxp%%o; + &cp("$reldoc$DIRSEP$file", "$docdir$DIRSEP$destfile"); print STDOUT "\t", $file, "\n"; } } +if ($doman && @manfiles) { + print STDOUT "Installing the following into $mandir\n"; + local($sect) = (1); + foreach $file (@manfiles) { + ($destfile = $file) =~ s%.*$DIRSEPrxp%%o; + ($sect) = $destfile =~ m%\.([\d\w]+)$%; + &create_dir("$mandir${DIRSEP}man${sect}", 1); + &cp("$relman$DIRSEP$file", + "$mandir${DIRSEP}man${sect}${DIRSEP}$destfile"); + print STDOUT "\t$file -> $mandir${DIRSEP}man${sect}\n"; + } +} exit 0; } + ##--------------------------------------------------------------------------- ## Main subroutines ##--------------------------------------------------------------------------- + sub create_dir { local($d) = shift; - local($tmp); - ($tmp = $DIRSEP) =~ s/(\W)/\\$1/g; - local(@a) = grep($_ ne '', split(/$tmp/o, $d)); + local($noask) = shift; + local(@a) = grep($_ ne '', split(/$'DIRSEPrxp/o, $d)); local($path, $dir); + if ((! -e $d) && (!$noask)) { + return 0 unless &ask_question(qq{$d does not exist. Create}, 1); + } if ($MSDOS) { if ($d =~ m%^\s*([a-zA-Z]:)?[/\\]%) { $path = shift @a; } else { - $path = '.'; + $path = $CURDIR; } } else { if ($d =~ /^\s*\//) { $path = ''; } else { - $path = '.'; + $path = $CURDIR; } } foreach $dir (@a) { @@ -253,9 +284,47 @@ sub create_dir { } 1; } + +##--------------------------------------------------------------------------- +sub interpolate_path { + local($path) = shift; + + $path =~ s/^~/$ENV{'HOME'}/; + $path =~ s/\$(\w+)/$ENV{$1}/ge; + $path; +} + ##--------------------------------------------------------------------------- sub cp { local($src, $dst, $prepend) = @_; + + if (-d $src) { + if (! -e $dst) { + mkdir($dst,0777) || die "Unable to create $dst: $!\n"; + } + opendir(DIR, $src) || die "Unable to open $src: $!\n"; + @files = grep(!/^(sccs|\.|\..)$/i, readdir(DIR)); + closedir(DIR); + foreach $file (@files) { + $srcpn = "$src$DIRSEP$file"; + $dstpn = "$dst$DIRSEP$file"; + if (-d $srcpn) { + &cp($srcpn, $dstpn, $prepend); + } else { + &cpfile($srcpn, $dstpn, $prepend); + } + } + + + } else { + &cpfile($src, $dst, $prepend); + } +} + +##--------------------------------------------------------------------------- +sub cpfile { + local($src, $dst, $prepend) = @_; + open(SRC, $src) || die "Unable to open $src: $!\n"; open(DST, "> $dst") || die "Unable to create $dst: $!\n"; if (-B $src) { binmode( SRC ); binmode( DST ); } @@ -269,6 +338,37 @@ sub cp { ############################################################################### +##---------------------------------------------------------------------------## +## File: +## @(#) uio.pl 1.2 97/03/11 12:29:46 @(#) +## Author: +## Earl Hood ehood@medusa.acs.uci.edu +## Description: +## This package contains subroutines for user input routines and +## screen output routines. +##---------------------------------------------------------------------------## +## Copyright (C) 1994-1997 Earl Hood, ehood@medusa.acs.uci.edu +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +##---------------------------------------------------------------------------## + +if (!$uio'NoDate) { + # date.pl is needed for get_later_date() + require 'date.pl' || warn "Unable to require date.pl\n"; +} + package uio; ##---------------------------------------------------------------------------## @@ -312,14 +412,20 @@ package uio; ## value is one. More inforamtion is below in the various ## subroutine descriptions. ##---------------------------------------------------------------------------## + ##------------------## ## Global variables ## ##------------------## ##--------------------------------------------------------------------------- + @LastText = (); ## Cached text $use_handler = 1; ## Flag to use private CONT signal handler +$term_io_bug = 0; ## Flag if bogus reads must be done when + ## consective suspend/foregrounds are done $ext_sigcont; ## External CONT handler + ##--------------------------------------------------------------------------- + ##---------------------------------## ## Private subroutine declerations ## ##---------------------------------## @@ -332,6 +438,7 @@ $ext_sigcont; ## External CONT handler sub print_txt { print STDOUT @_; @LastText = @_; } + ##--------------------------------------------------------------------------- ## This routine is used by print_{error, info, note, warning} ## routines to output an informitive message to STDOUT. @@ -352,6 +459,7 @@ sub print_message { print STDOUT "$dashes\n", "$mesg\n", "$dashes\n"; $* = 0; } + ##--------------------------------------------------------------------------- ## handler() is the private signal handler for the uio package. ## It's used to when SIGCONT is caught for redisplay cached text. @@ -362,8 +470,9 @@ sub handler { $ext_sigcont ne "") { &$ext_sigcont(@_); } print STDOUT @LastText; &'flush(STDOUT); - push(@Redo, 1); + push(@Redo, 1) if $term_io_bug; } + ##--------------------------------------------------------------------------- ## set_handler() sets the private CONT signal handler. ## @@ -372,6 +481,7 @@ sub set_handler { $ext_sigcont = $SIG{'CONT'}; $SIG{'CONT'} = "uio'handler"; } + ##--------------------------------------------------------------------------- ## reset_handler() restores the external handler ## @@ -379,7 +489,9 @@ sub reset_handler { return unless $use_handler; $SIG{'CONT'} = $ext_sigcont; } + ##--------------------------------------------------------------------------- + ##--------------------------------## ## Public subroutine declerations ## ##--------------------------------## @@ -469,7 +581,7 @@ sub main'print_warning { &print_message("WARNING", @_); } sub main'get_lc_string { local($tmp); $tmp = ; - while (shift(@Redo)) { $tmp = ; } + if ($term_io_bug) { while (shift(@Redo)) { $tmp = ; } } chop $tmp; $tmp =~ tr/A-Z/a-z/; $tmp; @@ -480,7 +592,7 @@ sub main'get_lc_string { sub main'get_string { local($tmp); $tmp = ; - while (shift(@Redo)) { $tmp = ; } + if ($term_io_bug) { while (shift(@Redo)) { $tmp = ; } } chop $tmp; $tmp; } @@ -492,7 +604,7 @@ sub main'pause { local($tmp); &print_txt("\nHit to continue ... "); $tmp = ; - while (shift(@Redo)) { $tmp = ; } + if ($term_io_bug) { while (shift(@Redo)) { $tmp = ; } } &reset_handler(); } ##--------------------------------------------------------------------------- diff --git a/lib/base64.pl b/lib/base64.pl index edc463d..55c70c0 100644 --- a/lib/base64.pl +++ b/lib/base64.pl @@ -3,6 +3,8 @@ # A. P. Barrett , October 1993 # $Revision: 1.4 $$Date: 1994/08/11 16:08:51 $ # +# @(#) base64.pl 1.1 96/09/17 @(#) +# # Modified March 21, 1996 by ehood@convex.com # -> Changes to base64'uudecode to strip out any begin/end # lines from input string. diff --git a/lib/ewhutil.pl b/lib/ewhutil.pl new file mode 100644 index 0000000..96a0c39 --- /dev/null +++ b/lib/ewhutil.pl @@ -0,0 +1,129 @@ +##---------------------------------------------------------------------------## +## File: +## @(#) ewhutil.pl 1.5 97/04/23 13:38:51 @(#) +## Author: +## Earl Hood ehood@medusa.acs.uci.edu +## Description: +## Generic utility routines +##---------------------------------------------------------------------------## +## Copyright (C) 1996,1997 Earl Hood, ehood@medusa.acs.uci.edu +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +##---------------------------------------------------------------------------## + +##--------------------------------------------------------------------------- +## Remove duplicates in an array. +## +sub remove_dups { + local(*array) = shift; + local(%dup); + @array = grep($dup{$_}++ < 1, @array); + %dup = (); +} + +##--------------------------------------------------------------------------- +## numerically() is used to tell 'sort' to sort by numbers. +## +sub numerically { + $a <=> $b; +} + +##--------------------------------------------------------------------------- +## "Entify" special characters +## +sub htmlize { # Older name + local($txt) = $_[0]; + $txt =~ s/&/\&/g; $txt =~ s/>/>/g; $txt =~ s//>/g; $txt =~ s/ $dst") || die("ERROR: Unable to create $dst\n"); + print DST ; + close(SRC); + close(DST); +} + +##--------------------------------------------------------------------------- +## Remove a directory (or file) +## +sub rmdir { + local($file) = shift; + + if (-d $file) { + local(@files) = (); + + if (!opendir(DIR, $file)) { + warn qq{Warning: Unable to open "$file"\n}; + return 0; + } + @files = grep(!/^(\.|\..)$/i, readdir(DIR)); + closedir(DIR); + foreach (@files) { + &rmdir($file . $'DIRSEP . $_); + } + if (!rmdir($file)) { + warn qq{Warning: Unable to remove "$file": $!\n}; + return 0; + } + + } else { + if (!unlink($file)) { + warn qq{Warning: Unable to delete "$file": $!\n}; + return 0; + } + } + 1; +} + +##--------------------------------------------------------------------------- +## Translate html string back to regular string +## +sub dehtmlize { + local($str) = shift; + $str =~ s/\<//g; + $str =~ s/\&/\&/g; + $str; +} + +##--------------------------------------------------------------------------- +## Escape special characters in string for URL use. +## +sub urlize { + local($url) = shift; + $url =~ s/([^\w])/sprintf("%%%X",unpack("C",$1))/ge; + $url; +} + +##---------------------------------------------------------------------------## +1; diff --git a/lib/iso8859.pl b/lib/iso8859.pl new file mode 100644 index 0000000..f68d0a4 --- /dev/null +++ b/lib/iso8859.pl @@ -0,0 +1,1167 @@ +##---------------------------------------------------------------------------## +## File: +## @(#) iso8859.pl 1.1 96/09/17 @(#) +## Author: +## Earl Hood ehood@medusa.acs.uci.edu +## Description: +## Routines to process data encoded in iso8859 character sets. +##---------------------------------------------------------------------------## +## Copyright (C) 1996 Earl Hood, ehood@medusa.acs.uci.edu +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +##---------------------------------------------------------------------------## + +package iso_8859; + +############################################################################### +## Mapping arrays for characters to entity references +############################################################################### + +##--------------------------------------------------------------------------- +## US-ASCII/Common characters +##--------------------------------------------------------------------------- + +%US_ASCII_To_Ent = ( + #-------------------------------------------------------------------------- + # Hex Code Entity Ref # ISO external entity and description + #-------------------------------------------------------------------------- + 0x26, "&", # ISOnum : Ampersand + 0x3C, "<", # ISOnum : Less-than sign + 0x3E, ">", # ISOnum : Greater-than sign + + 0xA0, " ", # ISOnum : NO-BREAK SPACE +); + +##--------------------------------------------------------------------------- +## ISO-8859-1: Latin-1 +##--------------------------------------------------------------------------- + +%ISO_8859_1_To_Ent = ( + #-------------------------------------------------------------------------- + # Hex Code Entity Ref # ISO external entity and description + #-------------------------------------------------------------------------- + 0xA1, "¡", # ISOnum : INVERTED EXCLAMATION MARK + 0xA2, "¢", # ISOnum : CENT SIGN + 0xA3, "£", # ISOnum : POUND SIGN + 0xA4, "¤", # ISOnum : CURRENCY SIGN + 0xA5, "¥", # ISOnum : YEN SIGN + 0xA6, "¦", # ISOnum : BROKEN BAR + 0xA7, "§", # ISOnum : SECTION SIGN + 0xA8, "¨", # ISOdia : DIAERESIS + 0xA9, "©", # ISOnum : COPYRIGHT SIGN + 0xAA, "ª", # ISOnum : FEMININE ORDINAL INDICATOR + 0xAB, "«", # ISOnum : LEFT-POINTING DOUBLE ANGLE + # QUOTATION MARK + 0xAC, "¬", # ISOnum : NOT SIGN + 0xAD, "­", # ISOnum : SOFT HYPHEN + 0xAE, "®", # ISOnum : REGISTERED SIGN + 0xAF, "¯", # ISOdia : OVERLINE (MACRON) + 0xB0, "°", # ISOnum : DEGREE SIGN + 0xB1, "±", # ISOnum : PLUS-MINUS SIGN + 0xB2, "²", # ISOnum : SUPERSCRIPT TWO + 0xB3, "³", # ISOnum : SUPERSCRIPT THREE + 0xB4, "´", # ISOdia : ACUTE ACCENT + 0xB5, "µ", # ISOnum : MICRO SIGN + 0xB6, "¶", # ISOnum : PILCROW SIGN + 0xB7, "·", # ISOnum : MIDDLE DOT + 0xB8, "¸", # ISOdia : CEDILLA + 0xB9, "¹", # ISOnum : SUPERSCRIPT ONE + 0xBA, "º", # ISOnum : MASCULINE ORDINAL INDICATOR + 0xBB, "»", # ISOnum : RIGHT-POINTING DOUBLE ANGLE + # QUOTATION MARK + 0xBC, "¼", # ISOnum : VULGAR FRACTION ONE QUARTER + 0xBD, "½", # ISOnum : VULGAR FRACTION ONE HALF + 0xBE, "¾", # ISOnum : VULGAR FRACTION THREE QUARTERS + 0xBF, "¿", # ISOnum : INVERTED QUESTION MARK + 0xC0, "À", # ISOlat1: LATIN CAPITAL LETTER A WITH GRAVE + 0xC1, "Á", # ISOlat1: LATIN CAPITAL LETTER A WITH ACUTE + 0xC2, "Â", # ISOlat1: LATIN CAPITAL LETTER A WITH + # CIRCUMFLEX + 0xC3, "Ã", # ISOlat1: LATIN CAPITAL LETTER A WITH TILDE + 0xC4, "Ä", # ISOlat1: LATIN CAPITAL LETTER A WITH + # DIAERESIS + 0xC5, "Å", # ISOlat1: LATIN CAPITAL LETTER A WITH RING + # ABOVE + 0xC6, "Æ", # ISOlat1: LATIN CAPITAL LETTER AE + 0xC7, "Ç", # ISOlat1: LATIN CAPITAL LETTER C WITH CEDILLA + 0xC8, "È", # ISOlat1: LATIN CAPITAL LETTER E WITH GRAVE + 0xC9, "É", # ISOlat1: LATIN CAPITAL LETTER E WITH ACUTE + 0xCA, "Ê", # ISOlat1: LATIN CAPITAL LETTER E WITH + # CIRCUMFLEX + 0xCB, "Ë", # ISOlat1: LATIN CAPITAL LETTER E WITH + # DIAERESIS + 0xCC, "Ì", # ISOlat1: LATIN CAPITAL LETTER I WITH GRAVE + 0xCD, "Í", # ISOlat1: LATIN CAPITAL LETTER I WITH ACUTE + 0xCE, "Î", # ISOlat1: LATIN CAPITAL LETTER I WITH + # CIRCUMFLEX + 0xCF, "Ï", # ISOlat1: LATIN CAPITAL LETTER I WITH + # DIAERESIS + 0xD0, "Ð", # ISOlat1: LATIN CAPITAL LETTER ETH (Icelandic) + 0xD1, "Ñ", # ISOlat1: LATIN CAPITAL LETTER N WITH TILDE + 0xD2, "Ò", # ISOlat1: LATIN CAPITAL LETTER O WITH GRAVE + 0xD3, "Ó", # ISOlat1: LATIN CAPITAL LETTER O WITH ACUTE + 0xD4, "Ô", # ISOlat1: LATIN CAPITAL LETTER O WITH + # CIRCUMFLEX + 0xD5, "Õ", # ISOlat1: LATIN CAPITAL LETTER O WITH TILDE + 0xD6, "Ö", # ISOlat1: LATIN CAPITAL LETTER O WITH + # DIAERESIS + 0xD7, "×", # ISOnum : MULTIPLICATION SIGN + 0xD8, "Ø", # ISOlat1: LATIN CAPITAL LETTER O WITH STROKE + 0xD9, "Ù", # ISOlat1: LATIN CAPITAL LETTER U WITH GRAVE + 0xDA, "Ú", # ISOlat1: LATIN CAPITAL LETTER U WITH ACUTE + 0xDB, "Û", # ISOlat1: LATIN CAPITAL LETTER U WITH + # CIRCUMFLEX + 0xDC, "Ü", # ISOlat1: LATIN CAPITAL LETTER U WITH + # DIAERESIS + 0xDD, "Ý", # ISOlat1: LATIN CAPITAL LETTER Y WITH ACUTE + 0xDE, "Þ", # ISOlat1: LATIN CAPITAL LETTER THORN + # (Icelandic) + 0xDF, "ß", # ISOlat1: LATIN SMALL LETTER SHARP S (German) + 0xE0, "à", # ISOlat1: LATIN SMALL LETTER A WITH GRAVE + 0xE1, "á", # ISOlat1: LATIN SMALL LETTER A WITH ACUTE + 0xE2, "â", # ISOlat1: LATIN SMALL LETTER A WITH CIRCUMFLEX + 0xE3, "ã", # ISOlat1: LATIN SMALL LETTER A WITH TILDE + 0xE4, "ä", # ISOlat1: LATIN SMALL LETTER A WITH DIAERESIS + 0xE5, "å", # ISOlat1: LATIN SMALL LETTER A WITH RING ABOVE + 0xE6, "æ", # ISOlat1: LATIN SMALL LETTER AE + 0xE7, "ç", # ISOlat1: LATIN SMALL LETTER C WITH CEDILLA + 0xE8, "è", # ISOlat1: LATIN SMALL LETTER E WITH GRAVE + 0xE9, "é", # ISOlat1: LATIN SMALL LETTER E WITH ACUTE + 0xEA, "ê", # ISOlat1: LATIN SMALL LETTER E WITH CIRCUMFLEX + 0xEB, "ë", # ISOlat1: LATIN SMALL LETTER E WITH DIAERESIS + 0xEC, "ì", # ISOlat1: LATIN SMALL LETTER I WITH GRAVE + 0xED, "í", # ISOlat1: LATIN SMALL LETTER I WITH ACUTE + 0xEE, "î", # ISOlat1: LATIN SMALL LETTER I WITH CIRCUMFLEX + 0xEF, "ï", # ISOlat1: LATIN SMALL LETTER I WITH DIAERESIS + 0xF0, "ð", # ISOlat1: LATIN SMALL LETTER ETH (Icelandic) + 0xF1, "ñ", # ISOlat1: LATIN SMALL LETTER N WITH TILDE + 0xF2, "ò", # ISOlat1: LATIN SMALL LETTER O WITH GRAVE + 0xF3, "ó", # ISOlat1: LATIN SMALL LETTER O WITH ACUTE + 0xF4, "ô", # ISOlat1: LATIN SMALL LETTER O WITH CIRCUMFLEX + 0xF5, "õ", # ISOlat1: LATIN SMALL LETTER O WITH TILDE + 0xF6, "ö", # ISOlat1: LATIN SMALL LETTER O WITH DIAERESIS + 0xF7, "÷", # ISOnum : DIVISION SIGN + 0xF8, "ø", # ISOlat1: LATIN SMALL LETTER O WITH STROKE + 0xF9, "ù", # ISOlat1: LATIN SMALL LETTER U WITH GRAVE + 0xFA, "ú", # ISOlat1: LATIN SMALL LETTER U WITH ACUTE + 0xFB, "û", # ISOlat1: LATIN SMALL LETTER U WITH CIRCUMFLEX + 0xFC, "ü", # ISOlat1: LATIN SMALL LETTER U WITH DIAERESIS + 0xFD, "ý", # ISOlat1: LATIN SMALL LETTER Y WITH ACUTE + 0xFE, "þ", # ISOlat1: LATIN SMALL LETTER THORN + # (Icelandic) + 0xFF, "ÿ", # ISOlat1: LATIN SMALL LETTER Y WITH DIAERESIS +); + +##--------------------------------------------------------------------------- +## ISO-8859-2: Latin-2 +##--------------------------------------------------------------------------- + +%ISO_8859_2_To_Ent = ( + #-------------------------------------------------------------------------- + # Hex Code Entity Ref # ISO external entity and description + #-------------------------------------------------------------------------- + 0xA1, "Ą", # ISOlat2: LATIN CAPITAL LETTER A WITH OGONEK + 0xA2, "˘", # ISOdia : BREVE + 0xA3, "Ł", # ISOlat2: LATIN CAPITAL LETTER L WITH STROKE + 0xA4, "¤", # ISOnum : CURRENCY SIGN + 0xA5, "Ľ", # ISOlat2: LATIN CAPITAL LETTER L WITH CARON + 0xA6, "Ś", # ISOlat2: LATIN CAPITAL LETTER S WITH ACUTE + 0xA7, "§", # ISOnum : SECTION SIGN + 0xA8, "¨", # ISOdia : DIAERESIS + 0xA9, "Š", # ISOlat2: LATIN CAPITAL LETTER S WITH CARON + 0xAA, "Ş", # ISOlat2: LATIN CAPITAL LETTER S WITH CEDILLA + 0xAB, "Ť", # ISOlat2: LATIN CAPITAL LETTER T WITH CARON + 0xAC, "Ź", # ISOlat2: LATIN CAPITAL LETTER Z WITH ACUTE + 0xAD, "­", # ISOnum : SOFT HYPHEN + 0xAE, "Ž", # ISOlat2: LATIN CAPITAL LETTER Z WITH CARON + 0xAF, "Ż", # ISOlat2: LATIN CAPITAL LETTER Z WITH DOT + # ABOVE + 0xB0, "°", # ISOnum : DEGREE SIGN + 0xB1, "ą", # ISOlat2: LATIN SMALL LETTER A WITH OGONEK + 0xB2, "˛", # ISOdia : OGONEK + 0xB3, "ł", # ISOlat2: LATIN SMALL LETTER L WITH STROKE + 0xB4, "´", # ISOdia : ACUTE ACCENT + 0xB5, "ľ", # ISOlat2: LATIN SMALL LETTER L WITH CARON + 0xB6, "ś", # ISOlat2: LATIN SMALL LETTER S WITH ACUTE + 0xB7, "ˇ", # ISOdia : CARON + 0xB8, "¸", # ISOdia : CEDILLA + 0xB9, "š", # ISOlat2: LATIN SMALL LETTER S WITH CARON + 0xBA, "ş", # ISOlat2: LATIN SMALL LETTER S WITH CEDILLA + 0xBB, "ť", # ISOlat2: LATIN SMALL LETTER T WITH CARON + 0xBC, "ź", # ISOlat2: LATIN SMALL LETTER Z WITH ACUTE + 0xBD, "˝", # ISOdia : DOUBLE ACUTE ACCENT + 0xBE, "ž", # ISOlat2: LATIN SMALL LETTER Z WITH CARON + 0xBF, "ż", # ISOlat2: LATIN SMALL LETTER Z WITH DOT ABOVE + 0xC0, "Ŕ", # ISOlat2: LATIN CAPITAL LETTER R WITH ACUTE + 0xC1, "Á", # ISOlat1: LATIN CAPITAL LETTER A WITH ACUTE + 0xC2, "Â", # ISOlat1: LATIN CAPITAL LETTER A WITH + # CIRCUMFLEX + 0xC3, "Ă", # ISOlat2: LATIN CAPITAL LETTER A WITH BREVE + 0xC4, "Ä", # ISOlat1: LATIN CAPITAL LETTER A WITH + # DIAERESIS + 0xC5, "Ĺ", # ISOlat2: LATIN CAPITAL LETTER L WITH ACUTE + 0xC6, "Ć", # ISOlat2: LATIN CAPITAL LETTER C WITH ACUTE + 0xC7, "Ç", # ISOlat2: LATIN CAPITAL LETTER C WITH CEDILLA + 0xC8, "Č", # ISOlat2: LATIN CAPITAL LETTER C WITH CARON + 0xC9, "É", # ISOlat1: LATIN CAPITAL LETTER E WITH ACUTE + 0xCA, "Ę", # ISOlat2: LATIN CAPITAL LETTER E WITH OGONEK + 0xCB, "Ë", # ISOlat1: LATIN CAPITAL LETTER E WITH + # DIAERESIS + 0xCC, "Ě", # ISOlat2: LATIN CAPITAL LETTER E WITH CARON + 0xCD, "Í", # ISOlat1: LATIN CAPITAL LETTER I WITH ACUTE + 0xCE, "Î", # ISOlat1: LATIN CAPITAL LETTER I WITH + # CIRCUMFLEX + 0xCF, "Ď", # ISOlat2: LATIN CAPITAL LETTER D WITH CARON + 0xD0, "Đ", # ISOlat2: LATIN CAPITAL LETTER D WITH STROKE + 0xD1, "Ń", # ISOlat2: LATIN CAPITAL LETTER N WITH ACUTE + 0xD2, "Ň", # ISOlat2: LATIN CAPITAL LETTER N WITH CARON + 0xD3, "Ó", # ISOlat1: LATIN CAPITAL LETTER O WITH ACUTE + 0xD4, "Ô", # ISOlat1: LATIN CAPITAL LETTER O WITH + # CIRCUMFLEX + 0xD5, "Ő", # ISOlat2: LATIN CAPITAL LETTER O WITH DOUBLE + # ACUTE + 0xD6, "Ö", # ISOlat1: LATIN CAPITAL LETTER O WITH + # DIAERESIS + 0xD7, "×", # ISOnum : MULTIPLICATION SIGN + 0xD8, "Ř", # ISOlat2: LATIN CAPITAL LETTER R WITH CARON + 0xD9, "Ů", # ISOlat2: LATIN CAPITAL LETTER U WITH RING + # ABOVE + 0xDA, "Ú", # ISOlat1: LATIN CAPITAL LETTER U WITH ACUTE + 0xDB, "Ű", # ISOlat2: LATIN CAPITAL LETTER U WITH DOUBLE + # ACUTE + 0xDC, "Ü", # ISOlat1: LATIN CAPITAL LETTER U WITH + # DIAERESIS + 0xDD, "Ý", # ISOlat2: LATIN CAPITAL LETTER Y WITH ACUTE + 0xDE, "Ţ", # ISOlat2: LATIN CAPITAL LETTER T WITH CEDILLA + 0xDF, "ß", # ISOlat1: LATIN SMALL LETTER SHARP S (German) + 0xE0, "ŕ", # ISOlat2: LATIN SMALL LETTER R WITH ACUTE + 0xE1, "á", # ISOlat1: LATIN SMALL LETTER A WITH ACUTE + 0xE2, "â", # ISOlat1: LATIN SMALL LETTER A WITH CIRCUMFLEX + 0xE3, "ă", # ISOlat2: LATIN SMALL LETTER A WITH BREVE + 0xE4, "ä", # ISOlat1: LATIN SMALL LETTER A WITH DIAERESIS + 0xE5, "ĺ", # ISOlat2: LATIN SMALL LETTER L WITH ACUTE + 0xE6, "ć", # ISOlat2: LATIN SMALL LETTER C WITH ACUTE + 0xE7, "ç", # ISOlat1: LATIN SMALL LETTER C WITH CEDILLA + 0xE8, "č", # ISOlat2: LATIN SMALL LETTER C WITH CARON + 0xE9, "é", # ISOlat1: LATIN SMALL LETTER E WITH ACUTE + 0xEA, "ę", # ISOlat2: LATIN SMALL LETTER E WITH OGONEK + 0xEB, "ë", # ISOlat1: LATIN SMALL LETTER E WITH DIAERESIS + 0xEC, "ě", # ISOlat2: LATIN SMALL LETTER E WITH CARON + 0xED, "í", # ISOlat1: LATIN SMALL LETTER I WITH ACUTE + 0xEE, "î", # ISOlat1: LATIN SMALL LETTER I WITH CIRCUMFLEX + 0xEF, "ď", # ISOlat2: LATIN SMALL LETTER D WITH CARON + 0xF0, "đ", # ISOlat2: LATIN SMALL LETTER D WITH STROKE + 0xF1, "ń", # ISOlat2: LATIN SMALL LETTER N WITH ACUTE + 0xF2, "ň", # ISOlat2: LATIN SMALL LETTER N WITH CARON + 0xF3, "ó", # ISOlat1: LATIN SMALL LETTER O WITH ACUTE + 0xF4, "ô", # ISOlat1: LATIN SMALL LETTER O WITH CIRCUMFLEX + 0xF5, "ő", # ISOlat2: LATIN SMALL LETTER O WITH DOUBLE + # ACUTE + 0xF6, "ö", # ISOlat1: LATIN SMALL LETTER O WITH DIAERESIS + 0xF7, "÷", # ISOnum : DIVISION SIGN + 0xF8, "ř", # ISOlat2: LATIN SMALL LETTER R WITH CARON + 0xF9, "ů", # ISOlat2: LATIN SMALL LETTER U WITH RING ABOVE + 0xFA, "ú", # ISOlat1: LATIN SMALL LETTER U WITH ACUTE + 0xFB, "ű", # ISOlat2: LATIN SMALL LETTER U WITH DOUBLE + # ACUTE + 0xFC, "ü", # ISOlat1: LATIN SMALL LETTER U WITH DIAERESIS + 0xFD, "ý", # ISOlat1: LATIN SMALL LETTER Y WITH ACUTE + 0xFE, "ţ", # ISOlat2: LATIN SMALL LETTER T WITH CEDILLA + 0xFF, "˙", # ISOdia : DOT ABOVE +); + +##--------------------------------------------------------------------------- +## ISO-8859-3: Latin-3 +##--------------------------------------------------------------------------- + +%ISO_8859_3_To_Ent = ( + #-------------------------------------------------------------------------- + # Hex Code Entity Ref # ISO external entity and description + #-------------------------------------------------------------------------- + 0xA1, "Ħ", # ISOlat2: LATIN CAPITAL LETTER H WITH STROKE + 0xA2, "˘", # ISOdia : BREVE + 0xA3, "£", # ISOnum : POUND SIGN + 0xA4, "¤", # ISOnum : CURRENCY SIGN + 0xA6, "Ĥ", # ISOlat2: LATIN CAPITAL LETTER H WITH + # CIRCUMFLEX + 0xA7, "§", # ISOnum : SECTION SIGN + 0xA8, "¨", # ISOdia : DIAERESIS + 0xA9, "İ", # ISOlat2: LATIN CAPITAL LETTER I WITH DOT + # ABOVE + 0xAA, "Ş", # ISOlat2: LATIN CAPITAL LETTER S WITH CEDILLA + 0xAB, "Ğ", # ISOlat2: LATIN CAPITAL LETTER G WITH BREVE + 0xAC, "Ĵ", # ISOlat2: LATIN CAPITAL LETTER J WITH + # CIRCUMFLEX + 0xAD, "­", # ISOnum : SOFT HYPHEN + 0xAF, "Ż", # ISOlat2: LATIN CAPITAL LETTER Z WITH DOT + # ABOVE + 0xB0, "°", # ISOnum : DEGREE SIGN + 0xB1, "ħ", # ISOlat2: LATIN SMALL LETTER H WITH STROKE + 0xB2, "²", # ISOnum : SUPERSCRIPT TWO + 0xB3, "³", # ISOnum : SUPERSCRIPT THREE + 0xB4, "´", # ISOdia : ACUTE ACCENT + 0xB5, "µ", # ISOnum : MICRO SIGN + 0xB6, "ĥ", # ISOlat2: LATIN SMALL LETTER H WITH + # CIRCUMFLEX + 0xB7, "·", # ISOnum : MIDDLE DOT + 0xB8, "¸", # ISOdia : CEDILLA + 0xB9, "ı", # ISOlat2: LATIN SMALL LETTER I DOTLESS + 0xBA, "ş", # ISOlat2: LATIN SMALL LETTER S WITH CEDILLA + 0xBB, "ğ", # ISOlat2: LATIN SMALL LETTER G WITH BREVE + 0xBC, "ĵ", # ISOlat2: LATIN SMALL LETTER J WITH CIRCUMFLEX + 0xBD, "½", # ISOnum : VULGAR FRACTION ONE HALF + 0xBF, "ż", # ISOlat2: LATIN SMALL LETTER Z WITH DOT ABOVE + 0xC0, "À", # ISOlat1: LATIN CAPITAL LETTER A WITH GRAVE + 0xC1, "Á", # ISOlat1: LATIN CAPITAL LETTER A WITH ACUTE + 0xC2, "Â", # ISOlat1: LATIN CAPITAL LETTER A WITH + # CIRCUMFLEX + 0xC4, "Ä", # ISOlat1: LATIN CAPITAL LETTER A WITH + # DIAERESIS + 0xC5, "Ċ", # ISOlat2: LATIN CAPITAL LETTER C WITH DOT + # ABOVE + 0xC6, "Ĉ", # ISOlat2: LATIN CAPITAL LETTER C WITH + # CIRCUMFLEX + 0xC7, "Ç", # ISOlat2: LATIN CAPITAL LETTER C WITH CEDILLA + 0xC8, "È", # ISOlat1: LATIN CAPITAL LETTER E WITH GRAVE + 0xC9, "É", # ISOlat1: LATIN CAPITAL LETTER E WITH ACUTE + 0xCA, "Ê", # ISOlat2: LATIN CAPITAL LETTER E WITH + # CIRCUMFLEX + 0xCB, "Ë", # ISOlat1: LATIN CAPITAL LETTER E WITH + # DIAERESIS + 0xCC, "Ì", # ISOlat1: LATIN CAPITAL LETTER I WITH GRAVE + 0xCD, "Í", # ISOlat1: LATIN CAPITAL LETTER I WITH ACUTE + 0xCE, "Î", # ISOlat1: LATIN CAPITAL LETTER I WITH + # CIRCUMFLEX + 0xCF, "Ï", # ISOlat1: LATIN CAPITAL LETTER I WITH + # DIAERESIS + 0xD1, "Ñ", # ISOlat1: LATIN CAPITAL LETTER N WITH TILDE + 0xD2, "Ò", # ISOlat1: LATIN CAPITAL LETTER O WITH GRAVE + 0xD3, "Ó", # ISOlat1: LATIN CAPITAL LETTER O WITH ACUTE + 0xD4, "Ô", # ISOlat1: LATIN CAPITAL LETTER O WITH + # CIRCUMFLEX + 0xD5, "Ġ", # ISOlat2: LATIN CAPITAL LETTER G WITH DOT + # ABOVE + 0xD6, "Ö", # ISOlat1: LATIN CAPITAL LETTER O WITH + # DIAERESIS + 0xD7, "×", # ISOnum : MULTIPLICATION SIGN + 0xD8, "Ĝ", # ISOlat2: LATIN CAPITAL LETTER G WITH + # CIRCUMFLEX + 0xD9, "Ù", # ISOlat1: LATIN CAPITAL LETTER U WITH GRAVE + # ABOVE + 0xDA, "Ú", # ISOlat1: LATIN CAPITAL LETTER U WITH ACUTE + 0xDB, "Û", # ISOlat1: LATIN CAPITAL LETTER U WITH + # CIRCUMFLEX + 0xDC, "Ü", # ISOlat1: LATIN CAPITAL LETTER U WITH + # DIAERESIS + 0xDD, "Ŭ", # ISOlat2: LATIN CAPITAL LETTER U WITH BREVE + 0xDE, "Ŝ", # ISOlat2: LATIN CAPITAL LETTER S WITH + # CIRCUMFLEX + 0xDF, "ß", # ISOlat1: LATIN SMALL LETTER SHARP S (German) + 0xE0, "à", # ISOlat1: LATIN SMALL LETTER A WITH GRAVE + 0xE1, "á", # ISOlat1: LATIN SMALL LETTER A WITH ACUTE + 0xE2, "â", # ISOlat1: LATIN SMALL LETTER A WITH CIRCUMFLEX + 0xE4, "ä", # ISOlat1: LATIN SMALL LETTER A WITH DIAERESIS + 0xE5, "ċ", # ISOlat2: LATIN SMALL LETTER C WITH DOT ABOVE + 0xE6, "&ccirce;", # ISOlat2: LATIN SMALL LETTER C WITH + # CIRCUMFLEX + 0xE7, "ç", # ISOlat1: LATIN SMALL LETTER C WITH CEDILLA + 0xE8, "è", # ISOlat1: LATIN SMALL LETTER E WITH GRAVE + 0xE9, "é", # ISOlat2: LATIN SMALL LETTER E WITH ACUTE + 0xEA, "ê", # ISOlat2: LATIN SMALL LETTER E WITH + # CIRCUMFLEX + 0xEB, "ë", # ISOlat1: LATIN SMALL LETTER E WITH DIAERESIS + 0xEC, "ì", # ISOlat1: LATIN SMALL LETTER I WITH GRAVE + 0xED, "í", # ISOlat1: LATIN SMALL LETTER I WITH ACUTE + 0xEE, "î", # ISOlat1: LATIN SMALL LETTER I WITH CIRCUMFLEX + 0xEF, "ï", # ISOlat1: LATIN SMALL LETTER I WITH DIAERESIS + 0xF1, "ñ", # ISOlat1: LATIN SMALL LETTER N WITH TILDE + 0xF2, "ò", # ISOlat1: LATIN SMALL LETTER O WITH GRAVE + 0xF3, "ó", # ISOlat1: LATIN SMALL LETTER O WITH ACUTE + 0xF4, "ô", # ISOlat1: LATIN SMALL LETTER O WITH CIRCUMFLEX + 0xF5, "ġ", # ISOlat2: LATIN SMALL LETTER G WITH DOT ABOVE + 0xF6, "ö", # ISOlat1: LATIN SMALL LETTER O WITH DIAERESIS + 0xF7, "÷", # ISOnum : DIVISION SIGN + 0xF8, "ĝ", # ISOlat2: LATIN SMALL LETTER G WITH + # CIRCUMFLEX + 0xF9, "ù", # ISOlat1: LATIN SMALL LETTER U WITH GRAVE + 0xFA, "ú", # ISOlat1: LATIN SMALL LETTER U WITH ACUTE + 0xFB, "û", # ISOlat1: LATIN SMALL LETTER U WITH + # CIRCUMFLEX + 0xFC, "ü", # ISOlat1: LATIN SMALL LETTER U WITH DIAERESIS + 0xFD, "ŭ", # ISOlat2: LATIN SMALL LETTER U WITH BREVE + 0xFE, "ŝ", # ISOlat2: LATIN SMALL LETTER S WITH + # CIRCUMFLEX + 0xFF, "˙", # ISOdia : DOT ABOVE +); + +##--------------------------------------------------------------------------- +## ISO-8859-4: Latin-4 +##--------------------------------------------------------------------------- + +%ISO_8859_4_To_Ent = ( + #-------------------------------------------------------------------------- + # Hex Code Entity Ref # ISO external entity and description + #-------------------------------------------------------------------------- + 0xA1, "Ą", # ISOlat2: LATIN CAPITAL LETTER A WITH OGONEK + 0xA2, "ĸ", # ISOlat2: LATIN SMALL LETTER KRA (Greenlandic) + 0xA3, "Ŗ", # ISOlat2: LATIN CAPITAL LETTER R WITH CEDILLA + 0xA4, "¤", # ISOnum : CURRENCY SIGN + 0xA5, "&Itilde", # ISOlat2: LATIN CAPITAL LETTER I WITH TILDE + 0xA6, "Ļ", # ISOlat2: LATIN CAPITAL LETTER L WITH CEDILLA + 0xA7, "§", # ISOnum : SECTION SIGN + 0xA8, "¨", # ISOdia : DIAERESIS + 0xA9, "Š", # ISOlat2: LATIN CAPITAL LETTER S WITH CARON + 0xAA, "Ē", # ISOlat2: LATIN CAPITAL LETTER E WITH MACRON + 0xAB, "Ģ", # ISOlat2: LATIN CAPITAL LETTER G WITH CEDILLA + 0xAC, "Ŧ", # ISOlat2: LATIN CAPITAL LETTER T WITH STROKE + 0xAD, "­", # ISOnum : SOFT HYPHEN + 0xAE, "&Zcaron", # ISOlat2: LATIN CAPITAL LETTER Z WITH CARON + 0xAF, "¯", # ISOdia : MACRON + 0xB0, "°", # ISOnum : DEGREE SIGN + 0xB1, "ą", # ISOlat2: LATIN SMALL LETTER A WITH OGONEK + 0xB2, "˛", # ISOdia : OGONEK + 0xB3, "ŗ", # ISOlat2: LATIN SMALL LETTER R WITH CEDILLA + 0xB4, "´", # ISOdia : ACUTE ACCENT + 0xB5, "ĩ", # ISOlat2: LATIN SMALL LETTER I WITH TILDE + 0xB6, "ļ", # ISOlat2: LATIN SMALL LETTER L WITH CEDILLA + 0xB7, "ˇ", # ISOdia : CARON + 0xB8, "¸", # ISOdia : CEDILLA + 0xB9, "š", # ISOlat2: LATIN SMALL LETTER S WITH CARON + 0xBA, "ē", # ISOlat2: LATIN SMALL LETTER E WITH MACRON + 0xBB, "&gcedil;", # ISOlat2: LATIN SMALL LETTER G WITH CEDILLA + 0xBC, "ŧ", # ISOlat2: LATIN SMALL LETTER J WITH STROKE + 0xBD, "Ŋ", # ISOlat2: LATIN CAPITAL LETTER ENG (Lappish) + 0xBE, "ž", # ISOlat2: LATIN SMALL LETTER Z WITH CARON + 0xBF, "ŋ", # ISOlat2: LATIN SMALL LETTER ENG (Lappish) + 0xC0, "Ā", # ISOlat1: LATIN CAPITAL LETTER A WITH MACRON + 0xC1, "Á", # ISOlat1: LATIN CAPITAL LETTER A WITH ACUTE + 0xC2, "Â", # ISOlat1: LATIN CAPITAL LETTER A WITH + # CIRCUMFLEX + 0xC3, "Ã", # ISOlat1: LATIN CAPITAL LETTER A WITH TILDE + 0xC4, "Ä", # ISOlat1: LATIN CAPITAL LETTER A WITH + # DIAERESIS + 0xC5, "Å", # ISOlat1: LATIN CAPITAL LETTER A WITH RING + # ABOVE + 0xC6, "Æ", # ISOlat1: LATIN CAPITAL LETTER AE + 0xC7, "Į", # ISOlat2: LATIN CAPITAL LETTER I WITH OGONEK + 0xC8, "Č", # ISOlat2: LATIN CAPITAL LETTER C WITH CARON + 0xC9, "É", # ISOlat1: LATIN CAPITAL LETTER E WITH ACUTE + 0xCA, "Ę", # ISOlat2: LATIN CAPITAL LETTER E WITH OGONEK + 0xCB, "Ë", # ISOlat1: LATIN CAPITAL LETTER E WITH + # DIAERESIS + 0xCC, "Ė", # ISOlat1: LATIN CAPITAL LETTER E WITH DOT + # ABOVE + 0xCD, "Í", # ISOlat1: LATIN CAPITAL LETTER I WITH ACUTE + 0xCE, "Î", # ISOlat1: LATIN CAPITAL LETTER I WITH + # CIRCUMFLEX + 0xCF, "Ī", # ISOlat2: LATIN CAPITAL LETTER I WITH MACRON + 0xD0, "&Dstrok", # ISOlat2: LATIN CAPITAL LETTER D WITH STROKE + 0xD1, "Ņ", # ISOlat2: LATIN CAPITAL LETTER N WITH CEDILLA + 0xD2, "Ō", # ISOlat2: LATIN CAPITAL LETTER O WITH MACRON + 0xD3, "Ķ", # ISOlat2: LATIN CAPITAL LETTER K WITH CEDILLA + 0xD4, "Ô", # ISOlat1: LATIN CAPITAL LETTER O WITH + # CIRCUMFLEX + 0xD5, "Õ", # ISOlat1: LATIN CAPITAL LETTER O WITH TILDE + 0xD6, "Ö", # ISOlat1: LATIN CAPITAL LETTER O WITH + # DIAERESIS + 0xD7, "×", # ISOnum : MULTIPLICATION SIGN + 0xD8, "Ø", # ISOlat1: LATIN CAPITAL LETTER O WITH STROKE + 0xD9, "Ų", # ISOlat2: LATIN CAPITAL LETTER U WITH OGONEK + 0xDA, "Ú", # ISOlat1: LATIN CAPITAL LETTER U WITH ACUTE + 0xDB, "Û", # ISOlat1: LATIN CAPITAL LETTER U WITH + # CIRCUMFLEX + 0xDC, "Ü", # ISOlat1: LATIN CAPITAL LETTER U WITH + # DIAERESIS + 0xDD, "Ũ", # ISOlat2: LATIN CAPITAL LETTER U WITH TILDE + 0xDE, "Ū", # ISOlat2: LATIN CAPITAL LETTER U WITH MACRON + 0xDF, "ß", # ISOlat1: LATIN SMALL LETTER SHARP S (German) + 0xE0, "ā", # ISOlat1: LATIN SMALL LETTER A WITH MACRON + 0xE1, "á", # ISOlat1: LATIN SMALL LETTER A WITH ACUTE + 0xE2, "â", # ISOlat1: LATIN SMALL LETTER A WITH CIRCUMFLEX + 0xE3, "ã", # ISOlat1: LATIN SMALL LETTER A WITH TILDE + 0xE4, "ä", # ISOlat1: LATIN SMALL LETTER A WITH DIAERESIS + 0xE5, "å", # ISOlat1: LATIN SMALL LETTER A WITH RING ABOVE + 0xE6, "æ", # ISOlat1: LATIN SMALL LETTER AE + 0xE7, "į", # ISOlat2: LATIN SMALL LETTER I WITH OGONEK + 0xE8, "č", # ISOlat2: LATIN SMALL LETTER C WITH CARON + 0xE9, "é", # ISOlat2: LATIN SMALL LETTER E WITH ACUTE + 0xEA, "ę", # ISOlat2: LATIN SMALL LETTER E WITH OGONEK + 0xEB, "ë", # ISOlat1: LATIN SMALL LETTER E WITH DIAERESIS + 0xEC, "ė", # ISOlat2: LATIN SMALL LETTER E WITH DOT ABOVE + 0xED, "í", # ISOlat1: LATIN SMALL LETTER I WITH ACUTE + 0xEE, "î", # ISOlat1: LATIN SMALL LETTER I WITH CIRCUMFLEX + 0xEF, "ī", # ISOlat2: LATIN SMALL LETTER I WITH MACRON + 0xF0, "đ", # ISOlat2: LATIN SMALL LETTER D WITH STROKE + 0xF1, "ņ", # ISOlat2: LATIN SMALL LETTER N WITH CEDILLA + 0xF2, "ō", # ISOlat2: LATIN SMALL LETTER O WITH MACRON + 0xF3, "ķ", # ISOlat2: LATIN SMALL LETTER K WITH CEDILLA + 0xF4, "ô", # ISOlat1: LATIN SMALL LETTER O WITH CIRCUMFLEX + 0xF5, "õ", # ISOlat1: LATIN SMALL LETTER O WITH TILDE + 0xF6, "ö", # ISOlat1: LATIN SMALL LETTER O WITH DIAERESIS + 0xF7, "÷", # ISOnum : DIVISION SIGN + 0xF8, "ø", # ISOlat1: LATIN SMALL LETTER O WITH STROKE + 0xF9, "ų", # ISOlat2: LATIN SMALL LETTER U WITH OGONEK + 0xFA, "ú", # ISOlat1: LATIN SMALL LETTER U WITH ACUTE + 0xFB, "û", # ISOlat1: LATIN SMALL LETTER U WITH + # CIRCUMFLEX + 0xFC, "ü", # ISOlat1: LATIN SMALL LETTER U WITH DIAERESIS + 0xFD, "ũ", # ISOlat2: LATIN SMALL LETTER U WITH TILDE + 0xFE, "ū", # ISOlat2: LATIN SMALL LETTER U WITH MACRON + 0xFF, "˙", # ISOdia : DOT ABOVE +); + +##--------------------------------------------------------------------------- +## ISO-8859-5: Cyrillic +##--------------------------------------------------------------------------- + +%ISO_8859_5_To_Ent = ( + #-------------------------------------------------------------------------- + # Hex Code Entity Ref # ISO external entity and description + #-------------------------------------------------------------------------- + 0xA1, "Ё", # ISOcyr1: CYRILLIC CAPITAL LETTER IO + 0xA2, "Ђ", # ISOcyr2: CYRILLIC CAPITAL LETTER DJE + # (Serbocroatian) + 0xA3, "Ѓ", # ISOcyr2: CYRILLIC CAPITAL LETTER GJE + # (Macedonian) + 0xA4, "Е", # ISOcyr1: CYRILLIC CAPITAL LETTER UKRAINIAN IE + 0xA5, "Ѕ", # ISOcyr2: CYRILLIC CAPITAL LETTER DZE + # (Macedonian) + 0xA6, "І", # ISOcyr2: CYRILLIC CAPITAL LETTER + # BYELORUSSIAN-UKRAINIAN I + 0xA7, "Ї", # ISOcyr2: CYRILLIC CAPITAL LETTER YI + # (Ukrainian) + 0xA8, "Є", # ISOcyr2: CYRILLIC CAPITAL LETTER JE + 0xA9, "Љ", # ISOcyr2: CYRILLIC CAPITAL LETTER LJE + 0xAA, "Њ", # ISOcyr2: CYRILLIC CAPITAL LETTER NJE + 0xAB, "Ћ", # ISOcyr2: CYRILLIC CAPITAL LETTER TSHE + # (Serbocroatian) + 0xAC, "Ќ", # ISOcyr2: CYRILLIC CAPITAL LETTER KJE + # (Macedonian) + 0xAD, "­", # ISOnum : SOFT HYPHEN + 0xAE, "Ў", # ISOcyr2: CYRILLIC CAPITAL LETTER SHORT U + # (Byelorussian) + 0xAF, "Џ", # ISOcyr2: CYRILLIC CAPITAL LETTER DZHE + 0xB0, "А", # ISOcyr1: CYRILLIC CAPITAL LETTER A + 0xB1, "Б", # ISOcyr1: CYRILLIC CAPITAL LETTER BE + 0xB2, "В", # ISOcyr1: CYRILLIC CAPITAL LETTER VE + 0xB3, "Г", # ISOcyr1: CYRILLIC CAPITAL LETTER GHE + 0xB4, "Д", # ISOcyr1: CYRILLIC CAPITAL LETTER DE + 0xB5, "Е", # ISOcyr1: CYRILLIC CAPITAL LETTER IE + 0xB6, "Ж", # ISOcyr1: CYRILLIC CAPITAL LETTER ZHE + 0xB7, "З", # ISOcyr1: CYRILLIC CAPITAL LETTER ZE + 0xB8, "И", # ISOcyr1: CYRILLIC CAPITAL LETTER I + 0xB9, "Й", # ISOcyr1: CYRILLIC CAPITAL LETTER SHORT I + 0xBA, "К", # ISOcyr1: CYRILLIC CAPITAL LETTER KA + 0xBB, "Л", # ISOcyr1: CYRILLIC CAPITAL LETTER EL + 0xBC, "М", # ISOcyr1: CYRILLIC CAPITAL LETTER EM + 0xBD, "Н", # ISOcyr1: CYRILLIC CAPITAL LETTER EN + 0xBE, "О", # ISOcyr1: CYRILLIC CAPITAL LETTER O + 0xBF, "П", # ISOcyr1: CYRILLIC CAPITAL LETTER PE + 0xC0, "Р", # ISOcyr1: CYRILLIC CAPITAL LETTER ER + 0xC1, "С", # ISOcyr1: CYRILLIC CAPITAL LETTER ES + 0xC2, "Т", # ISOcyr1: CYRILLIC CAPITAL LETTER TE + 0xC3, "У", # ISOcyr1: CYRILLIC CAPITAL LETTER U + 0xC4, "Ф", # ISOcyr1: CYRILLIC CAPITAL LETTER EF + 0xC5, "Х", # ISOcyr1: CYRILLIC CAPITAL LETTER HA + 0xC6, "Ц", # ISOcyr1: CYRILLIC CAPITAL LETTER TSE + 0xC7, "Ч", # ISOcyr1: CYRILLIC CAPITAL LETTER CHE + 0xC8, "Ш", # ISOcyr1: CYRILLIC CAPITAL LETTER SHA + 0xC9, "Щ", # ISOcyr1: CYRILLIC CAPITAL LETTER SHCHA + 0xCA, "Ъ", # ISOcyr1: CYRILLIC CAPITAL LETTER HARD SIGN + 0xCB, "Ы", # ISOcyr1: CYRILLIC CAPITAL LETTER YERU + 0xCC, "Ь", # ISOcyr1: CYRILLIC CAPITAL LETTER SOFT SIGN + 0xCD, "Э", # ISOcyr1: CYRILLIC CAPITAL LETTER E + 0xCE, "Ю", # ISOcyr1: CYRILLIC CAPITAL LETTER YU + 0xCF, "Я", # ISOcyr1: CYRILLIC CAPITAL LETTER YA + 0xD0, "а", # ISOcyr1: CYRILLIC SMALL LETTER A + 0xD1, "б", # ISOcyr1: CYRILLIC SMALL LETTER BE + 0xD2, "в", # ISOcyr1: CYRILLIC SMALL LETTER VE + 0xD3, "г", # ISOcyr1: CYRILLIC SMALL LETTER GHE + 0xD4, "д", # ISOcyr1: CYRILLIC SMALL LETTER DE + 0xD5, "е", # ISOcyr1: CYRILLIC SMALL LETTER IE + 0xD6, "ж", # ISOcyr1: CYRILLIC SMALL LETTER ZHE + 0xD7, "з", # ISOcyr1: CYRILLIC SMALL LETTER ZE + 0xD8, "и", # ISOcyr1: CYRILLIC SMALL LETTER I + 0xD9, "й", # ISOcyr1: CYRILLIC SMALL LETTER SHORT I + 0xDA, "к", # ISOcyr1: CYRILLIC SMALL LETTER KA + 0xDB, "л", # ISOcyr1: CYRILLIC SMALL LETTER EL + 0xDC, "м", # ISOcyr1: CYRILLIC SMALL LETTER EM + 0xDD, "н", # ISOcyr1: CYRILLIC SMALL LETTER EN + 0xDE, "о", # ISOcyr1: CYRILLIC SMALL LETTER O + 0xDF, "п", # ISOcyr1: CYRILLIC SMALL LETTER PE + 0xE0, "р", # ISOcyr1: CYRILLIC SMALL LETTER ER + 0xE1, "с", # ISOcyr1: CYRILLIC SMALL LETTER ES + 0xE2, "т", # ISOcyr1: CYRILLIC SMALL LETTER TE + 0xE3, "у", # ISOcyr1: CYRILLIC SMALL LETTER U + 0xE4, "ф", # ISOcyr1: CYRILLIC SMALL LETTER EF + 0xE5, "х", # ISOcyr1: CYRILLIC SMALL LETTER HA + 0xE6, "ц", # ISOcyr1: CYRILLIC SMALL LETTER TSE + 0xE7, "ч", # ISOcyr1: CYRILLIC SMALL LETTER CHE + 0xE8, "ш", # ISOcyr1: CYRILLIC SMALL LETTER SHA + 0xE9, "щ", # ISOcyr1: CYRILLIC SMALL LETTER SHCHA + 0xEA, "ъ", # ISOcyr1: CYRILLIC SMALL LETTER HARD SIGN + 0xEB, "ы", # ISOcyr1: CYRILLIC SMALL LETTER YERU + 0xEC, "ь", # ISOcyr1: CYRILLIC SMALL LETTER SOFT SIGN + 0xED, "э", # ISOcyr1: CYRILLIC SMALL LETTER E + 0xEE, "ю", # ISOcyr1: CYRILLIC SMALL LETTER YU + 0xEF, "я", # ISOcyr1: CYRILLIC SMALL LETTER YA + 0xF0, "№", # ISOcyr1: NUMERO SIGN + 0xF1, "ё", # ISOcyr1: CYRILLIC SMALL LETTER IO + 0xF2, "ђ", # ISOcyr2: CYRILLIC SMALL LETTER DJE + # (Serbocroatian) + 0xF3, "ѓ", # ISOcyr2: CYRILLIC SMALL LETTER GJE + # (Macedonian) + 0xF4, "е", # ISOcyr1: CYRILLIC SMALL LETTER UKRAINIAN IE + 0xF5, "ѕ", # ISOcyr2: CYRILLIC SMALL LETTER DZE + # (Macedonian) + 0xF6, "і", # ISOcyr2: CYRILLIC SMALL LETTER + # BYELORUSSIAN-UKRAINIAN I + 0xF7, "ї", # ISOcyr2: CYRILLIC SMALL LETTER YI + # (Ukrainian) + 0xF8, "ј", # ISOcyr2: CYRILLIC SMALL LETTER JE + 0xF9, "љ", # ISOcyr2: CYRILLIC SMALL LETTER LJE + 0xFA, "њ", # ISOcyr2: CYRILLIC SMALL LETTER NJE + 0xFB, "ћ", # ISOcyr2: CYRILLIC SMALL LETTER TSHE + # (Serbocroatian) + 0xFC, "ќ", # ISOcyr2: CYRILLIC SMALL LETTER KJE + # (Macedonian) + 0xFD, "§", # ISOnum : SECTION SIGN + 0xFE, "ў", # ISOcyr2: CYRILLIC SMALL LETTER SHORT U + # (Byelorussian) + 0xFF, "џ", # ISOcyr2: CYRILLIC SMALL LETTER DZHE +); + +##--------------------------------------------------------------------------- +## ISO-8859-6: Arabic +##--------------------------------------------------------------------------- +## Note: There is no ISO entities for arabic characters. Some of +## the following are non-standard entity references. "ISOarbc" +## is used as the entity defining the Arabic entities in +## anticipation that ISO will define such an entity. + +%ISO_8859_6_To_Ent = ( + #-------------------------------------------------------------------------- + # Hex Code Entity Ref # ISO external entity and description + #-------------------------------------------------------------------------- + 0xA4, "¤", # ISOnum : CURRENCY SIGN + 0xAC, "&arcomma;", # ISOarbc: ARABIC COMMA + 0xAD, "­", # ISOnum : SOFT HYPHEN + 0xBB, "&arsemi;", # ISOarbc: ARABIC SEMICOLON + 0xBF, "&arquest;", # ISOarbc: ARABIC QUESTION MARK + 0xC1, "&hamz;", # ISOarbc: ARABIC LETTER HAMZA + 0xC2, "&alefmadd;", # ISOarbc: ARABIC LETTER ALEF WITH MADDA ABOVE + 0xC3, "&alefhamz;", # ISOarbc: ARABIC LETTER ALEF WITH HAMZA ABOVE + 0xC4, "&wawhamz;", # ISOarbc: ARABIC LETTER WAW WITH HAMZA ABOVE + 0xC5, "&alefhamz;", # ISOarbc: ARABIC LETTER ALEF WITH HAMZA BELOW + 0xC6, "&yehhamz;", # ISOarbc: ARABIC LETTER YEH WITH HAMZA ABOVE + 0xC7, "&alef;", # ISOarbc: ARABIC LETTER ALEF + 0xC8, "&beh;", # ISOarbc: ARABIC LETTER BEH + 0xC9, "&tehmarb;", # ISOarbc: ARABIC LETTER TEH MARBUTA + 0xCA, "&teh;", # ISOarbc: ARABIC LETTER TEH + 0xCB, "&theh;", # ISOarbc: ARABIC LETTER THEH + 0xCC, "&jeem;", # ISOarbc: ARABIC LETTER JEEM + 0xCD, "&hah;", # ISOarbc: ARABIC LETTER HAH + 0xCE, "&khah;", # ISOarbc: ARABIC LETTER KHAH + 0xCF, "&dal;", # ISOarbc: ARABIC LETTER DAL + 0xD0, "&thal;", # ISOarbc: ARABIC LETTER THAL + 0xD1, "&reh;", # ISOarbc: ARABIC LETTER REH + 0xD2, "&zain;", # ISOarbc: ARABIC LETTER ZAIN + 0xD3, "&seen;", # ISOarbc: ARABIC LETTER SEEN + 0xD4, "&sheen;", # ISOarbc: ARABIC LETTER SHEEN + 0xD5, "&sad;", # ISOarbc: ARABIC LETTER SAD + 0xD6, "&dad;", # ISOarbc: ARABIC LETTER DAD + 0xD7, "&tah;", # ISOarbc: ARABIC LETTER TAH + 0xD8, "&zah;", # ISOarbc: ARABIC LETTER ZAH + 0xD9, "&ain;", # ISOarbc: ARABIC LETTER AIN + 0xDA, "&ghain;", # ISOarbc: ARABIC LETTER GHAIN + 0xE0, "&tatweel;", # ISOarbc: ARABIC TATWEEL + 0xE1, "&feh;", # ISOarbc: ARABIC LETTER FEH + 0xE2, "&qaf;", # ISOarbc: ARABIC LETTER QAF + 0xE3, "&kaf;", # ISOarbc: ARABIC LETTER KAF + 0xE4, "&lam;", # ISOarbc: ARABIC LETTER LAM + 0xE5, "&meem;", # ISOarbc: ARABIC LETTER MEEM + 0xE6, "&noon;", # ISOarbc: ARABIC LETTER NOON + 0xE7, "&heh;", # ISOarbc: ARABIC LETTER HEH + 0xE8, "&waw;", # ISOarbc: ARABIC LETTER WAW + 0xE9, "&alefmaks;", # ISOarbc: ARABIC LETTER ALEF MAKSURA + 0xEA, "&yeh;", # ISOarbc: ARABIC LETTER YEH + 0xEB, "&fathatan;", # ISOarbc: ARABIC FATHATAN + 0xEC, "&dammatan;", # ISOarbc: ARABIC DAMMATAN + 0xED, "&kasratan;", # ISOarbc: ARABIC KASRATAN + 0xEE, "&fatha;", # ISOarbc: ARABIC FATHA + 0xEF, "&damma;", # ISOarbc: ARABIC DAMMA + 0xF0, "&kasra;", # ISOarbc: ARABIC KASRA + 0xF1, "&shadda;", # ISOarbc: ARABIC SHADDA + 0xF2, "&sukun;", # ISOarbc: ARABIC SUKUN +); + +##--------------------------------------------------------------------------- +## ISO-8859-7: Greek +##--------------------------------------------------------------------------- + +%ISO_8859_7_To_Ent = ( + #-------------------------------------------------------------------------- + # Hex Code Entity Ref # ISO external entity and description + #-------------------------------------------------------------------------- + 0xA1, "‘", # ISOnum : SINGLE HIGH-REVERSED-9 QUOTATION + # MARK + 0xA2, "’", # ISOnum : RIGHT SINGLE QUOTATION MARK + 0xA3, "£", # ISOnum : POUND SIGN + 0xA6, "¦", # ISOnum : BROKEN BAR + 0xA7, "§", # ISOnum : SECTION SIGN + 0xA8, "¨", # ISOdia : DIAERESIS + 0xA9, "©", # ISOnum : COPYRIGHT SIGN + 0xAB, "«", # ISOnum : LEFT-POINTING DOUBLE ANGLE + # QUOTATION MARK + 0xAC, "¬", # ISOnum : NOT SIGN + 0xAD, "­", # ISOnum : SOFT HYPHEN + 0xAF, "—", # ISOpub : EM DASH + 0xB0, "°", # ISOnum : DEGREE SIGN + 0xB1, "±", # ISOnum : PLUS-MINUS SIGN + 0xB2, "²", # ISOnum : SUPERSCRIPT TWO + 0xB3, "³", # ISOnum : SUPERSCRIPT THREE + 0xB4, "´", # ISOdia : ACUTE ACCENT + 0xB5, "&diagr;", # ISOgrk?: ACUTE ACCENT AND DIAERESIS + # (Tonos and Dialytika) + 0xB6, "&Aacgr;", # ISOgrk2: GREEK CAPITAL LETTER ALPHA WITH + # ACUTE + 0xB7, "·", # ISOnum : MIDDLE DOT + 0xB8, "&Eacgr;", # ISOgrk2: GREEK CAPITAL LETTER EPSILON WITH + # ACUTE + 0xB9, "&EEacgr;", # ISOgrk2: GREEK CAPITAL LETTER ETA WITH ACUTE + 0xBA, "&Iacgr;", # ISOgrk2: GREEK CAPITAL LETTER IOTA WITH ACUTE + 0xBB, "»", # ISOnum : RIGHT-POINTING DOUBLE ANGLE + # QUOTATION MARK + 0xBC, "&Oacgr;", # ISOgrk2: GREEK CAPITAL LETTER OMICRON WITH + # ACUTE + 0xBD, "½", # ISOnum : VULGAR FRACTION ONE HALF + 0xBE, "&Uacgr;", # ISOgrk2: GREEK CAPITAL LETTER UPSILON WITH + # ACUTE + 0xBF, "&OHacgr;", # ISOgrk2: GREEK CAPITAL LETTER OMEGA WITH + # ACUTE + 0xC0, "&idiagr;", # ISOgrk2: GREEK SMALL LETTER IOTA WITH ACUTE + # AND DIAERESIS + 0xC1, "&Agr;", # ISOgrk1: GREEK CAPITAL LETTER ALPHA + 0xC2, "&Bgr;", # ISOgrk1: GREEK CAPITAL LETTER BETA + 0xC3, "&Ggr;", # ISOgrk1: GREEK CAPITAL LETTER GAMMA + 0xC4, "&Dgr;", # ISOgrk1: GREEK CAPITAL LETTER DELTA + 0xC5, "&Egr;", # ISOgrk1: GREEK CAPITAL LETTER EPSILON + 0xC6, "&Zgr;", # ISOgrk1: GREEK CAPITAL LETTER ZETA + 0xC7, "&EEgr;", # ISOgrk1: GREEK CAPITAL LETTER ETA + 0xC8, "&THgr;", # ISOgrk1: GREEK CAPITAL LETTER THETA + 0xC9, "&Igr;", # ISOgrk1: GREEK CAPITAL LETTER IOTA + 0xCA, "&Kgr;", # ISOgrk1: GREEK CAPITAL LETTER KAPPA + 0xCB, "&Lgr;", # ISOgrk1: GREEK CAPITAL LETTER LAMDA + 0xCC, "&Mgr;", # ISOgrk1: GREEK CAPITAL LETTER MU + 0xCD, "&Ngr;", # ISOgrk1: GREEK CAPITAL LETTER NU + 0xCE, "&Xgr;", # ISOgrk1: GREEK CAPITAL LETTER XI + 0xCF, "&Ogr;", # ISOgrk1: GREEK CAPITAL LETTER OMICRON + 0xD0, "&Pgr;", # ISOgrk1: GREEK CAPITAL LETTER PI + 0xD1, "&Rgr;", # ISOgrk1: GREEK CAPITAL LETTER RHO + 0xD3, "&Sgr;", # ISOgrk1: GREEK CAPITAL LETTER SIGMA + 0xD4, "&Tgr;", # ISOgrk1: GREEK CAPITAL LETTER TAU + 0xD5, "&Ugr;", # ISOgrk1: GREEK CAPITAL LETTER UPSILON + 0xD6, "&PHgr;", # ISOgrk1: GREEK CAPITAL LETTER PHI + 0xD7, "&KHgr;", # ISOgrk1: GREEK CAPITAL LETTER CHI + 0xD8, "&PSgr;", # ISOgrk1: GREEK CAPITAL LETTER PSI + 0xD9, "&OHgr;", # ISOgrk1: GREEK CAPITAL LETTER OMEGA + 0xDA, "&Idigr;", # ISOgrk2: GREEK CAPITAL LETTER IOTA WITH + # DIAERESIS + 0xDB, "&Udigr;", # ISOgrk2: GREEK CAPITAL LETTER UPSILON WITH + # DIAERESIS + 0xDC, "&aacgr;", # ISOgrk2: GREEK SMALL LETTER ALPHA WITH ACUTE + 0xDD, "&eacgr;", # ISOgrk2: GREEK SMALL LETTER EPSILON WITH + # ACUTE + 0xDE, "&eeacgr;", # ISOgrk2: GREEK SMALL LETTER ETA WITH ACUTE + 0xDF, "&iacgr;", # ISOgrk2: GREEK SMALL LETTER IOTA WITH ACUTE + 0xE0, "&udiagr;", # ISOgrk2: GREEK SMALL LETTER UPSILON WITH + # ACUTE AND DIAERESIS + 0xE1, "&agr;", # ISOgrk1: GREEK SMALL LETTER ALPHA + 0xE2, "&bgr;", # ISOgrk1: GREEK SMALL LETTER BETA + 0xE3, "&ggr;", # ISOgrk1: GREEK SMALL LETTER GAMMA + 0xE4, "&dgr;", # ISOgrk1: GREEK SMALL LETTER DELTA + 0xE5, "&egr;", # ISOgrk1: GREEK SMALL LETTER EPSILON + 0xE6, "&zgr;", # ISOgrk1: GREEK SMALL LETTER ZETA + 0xE7, "&eegr;", # ISOgrk1: GREEK SMALL LETTER ETA + 0xE8, "&thgr;", # ISOgrk1: GREEK SMALL LETTER THETA + 0xE9, "&igr;", # ISOgrk1: GREEK SMALL LETTER IOTA + 0xEA, "&kgr;", # ISOgrk1: GREEK SMALL LETTER KAPPA + 0xEB, "&lgr;", # ISOgrk1: GREEK SMALL LETTER LAMDA + 0xEC, "&mgr;", # ISOgrk1: GREEK SMALL LETTER MU + 0xED, "&ngr;", # ISOgrk1: GREEK SMALL LETTER NU + 0xEE, "&xgr;", # ISOgrk1: GREEK SMALL LETTER XI + 0xEF, "&ogr;", # ISOgrk1: GREEK SMALL LETTER OMICRON + 0xF0, "&pgr;", # ISOgrk1: GREEK SMALL LETTER PI + 0xF1, "&rgr;", # ISOgrk1: GREEK SMALL LETTER RHO + 0xF2, "&sfgr;", # ISOgrk1: GREEK SMALL LETTER FINAL SIGMA + 0xF3, "&sgr;", # ISOgrk1: GREEK SMALL LETTER SIGMA + 0xF4, "&tgr;", # ISOgrk1: GREEK SMALL LETTER TAU + 0xF5, "&ugr;", # ISOgrk1: GREEK SMALL LETTER UPSILON + 0xF6, "&phgr;", # ISOgrk1: GREEK SMALL LETTER PHI + 0xF7, "&khgr;", # ISOgrk1: GREEK SMALL LETTER CHI + 0xF8, "&psgr;", # ISOgrk1: GREEK SMALL LETTER PSI + 0xF9, "&ohgr;", # ISOgrk1: GREEK SMALL LETTER OMEGA + 0xFA, "&idigr;", # ISOgrk2: GREEK SMALL LETTER IOTA WITH + # DIAERESIS + 0xFB, "&udigr;", # ISOgrk2: GREEK SMALL LETTER UPSILON WITH + # DIAERESIS + 0xFC, "&oacgr;", # ISOgrk2: GREEK SMALL LETTER OMICRON WITH + # ACUTE + 0xFD, "&uacgr;", # ISOgrk2: GREEK SMALL LETTER UPSILON WITH + # ACUTE + 0xFE, "&ohacgr;", # ISOgrk2: GREEK SMALL LETTER OMEGA WITH ACUTE +); + +##--------------------------------------------------------------------------- +## ISO-8859-8: Hebrew +##--------------------------------------------------------------------------- +## Note: There is no ISO entities for hebrew characters. ISOamso +## defines a few characters, but they are for math purposes. +## Some of the following are non-standard entity references. +## "ISOhbrw" is used as the entity defining the Hebrew entities +## in anticipation that ISO will define such an entity. + +%ISO_8859_8_To_Ent = ( + #-------------------------------------------------------------------------- + # Hex Code Entity Ref # ISO external entity and description + #-------------------------------------------------------------------------- + 0xA2, "¢", # ISOnum : CENT SIGN + 0xA3, "£", # ISOnum : POUND SIGN + 0xA4, "¤", # ISOnum : CURRENCY SIGN + 0xA5, "¥", # ISOnum : YEN SIGN + 0xA6, "¦", # ISOnum : BROKEN BAR + 0xA7, "§", # ISOnum : SECTION SIGN + 0xA8, "¨", # ISOdia : DIAERESIS + 0xA9, "©", # ISOnum : COPYRIGHT SIGN + 0xAA, "×", # ISOnum : MULTIPLICATION SIGN + 0xAB, "«", # ISOnum : LEFT-POINTING DOUBLE ANGLE + # QUOTATION MARK + 0xAC, "¬", # ISOnum : NOT SIGN + 0xAD, "­", # ISOnum : SOFT HYPHEN + 0xAE, "®", # ISOnum : REGISTERED SIGN + 0xAF, "¯", # ISOdia : OVERLINE (MACRON) + 0xB0, "°", # ISOnum : DEGREE SIGN + 0xB1, "±", # ISOnum : PLUS-MINUS SIGN + 0xB2, "²", # ISOnum : SUPERSCRIPT TWO + 0xB3, "³", # ISOnum : SUPERSCRIPT THREE + 0xB4, "´", # ISOdia : ACUTE ACCENT + 0xB5, "µ", # ISOnum : MICRO SIGN + 0xB6, "¶", # ISOnum : PILCROW SIGN + 0xB7, "·", # ISOnum : MIDDLE DOT + 0xB8, "¸", # ISOdia : CEDILLA + 0xB9, "¹", # ISOnum : SUPERSCRIPT ONE + 0xBA, "÷", # ISOlat1: DIVISION SIGN + 0xBB, "»", # ISOnum : RIGHT-POINTING DOUBLE ANGLE + # QUOTATION MARK + 0xBC, "¼", # ISOnum : VULGAR FRACTION ONE QUARTER + 0xBD, "½", # ISOnum : VULGAR FRACTION ONE HALF + 0xBE, "¾", # ISOnum : VULGAR FRACTION THREE QUARTERS + 0xDF, "&dlowbar;", # ISOnum?: DOUBLE LOW LINE + 0xE0, "&alef;", # ISOhbrw: HEBREW LETTER ALEF + 0xE1, "&bet;", # ISOhbrw: HEBREW LETTER BET + 0xE2, "ℷ", # ISOhbrw: HEBREW LETTER GIMEL + 0xE3, "&dalet;", # ISOhbrw: HEBREW LETTER DALET + 0xE4, "&he;", # ISOhbrw: HEBREW LETTER HE + 0xE5, "&vav;", # ISOhbrw: HEBREW LETTER VAV + 0xE6, "&zayin;", # ISOhbrw: HEBREW LETTER ZAYIN + 0xE7, "&het;", # ISOhbrw: HEBREW LETTER HET + 0xE8, "&tet;", # ISOhbrw: HEBREW LETTER TET + 0xE9, "&yod;", # ISOhbrw: HEBREW LETTER YOD + 0xEA, "&fkaf;", # ISOhbrw: HEBREW LETTER FINAL KAF + 0xEB, "&kaf;", # ISOhbrw: HEBREW LETTER KAF + 0xEC, "&lamed;", # ISOhbrw: HEBREW LETTER LAMED + 0xED, "&fmem;", # ISOhbrw: HEBREW LETTER FINAL MEM + 0xEE, "&mem;", # ISOhbrw: HEBREW LETTER MEM + 0xEF, "&fnun;", # ISOhbrw: HEBREW LETTER FINAL NUN + 0xF0, "&nun;", # ISOhbrw: HEBREW LETTER NUN + 0xF1, "&samekh;", # ISOhbrw: HEBREW LETTER SAMEKH + 0xF2, "&ayin;", # ISOhbrw: HEBREW LETTER AYIN + 0xF3, "&fpe;", # ISOhbrw: HEBREW LETTER FINAL PE + 0xF4, "&pe;", # ISOhbrw: HEBREW LETTER PE + 0xF5, "&ftsadi;", # ISOhbrw: HEBREW LETTER FINAL TSADI + 0xF6, "&tsadi;", # ISOhbrw: HEBREW LETTER TSADI + 0xF7, "&qof;", # ISOhbrw: HEBREW LETTER QOF + 0xF8, "&resh;", # ISOhbrw: HEBREW LETTER RESH + 0xF9, "&shin;", # ISOhbrw: HEBREW LETTER SHIN + 0xFA, "&tav;", # ISOhbrw: HEBREW LETTER TAV +); + +##--------------------------------------------------------------------------- +## ISO-8859-9: Latin-5 +##--------------------------------------------------------------------------- + +%ISO_8859_9_To_Ent = ( + #-------------------------------------------------------------------------- + # Hex Code Entity Ref # ISO external entity and description + #-------------------------------------------------------------------------- + 0xA1, "¡", # ISOnum : INVERTED EXCLAMATION MARK + 0xA2, "¢", # ISOnum : CENT SIGN + 0xA3, "£", # ISOnum : POUND SIGN + 0xA4, "¤", # ISOnum : CURRENCY SIGN + 0xA5, "¥", # ISOnum : YEN SIGN + 0xA6, "¦", # ISOnum : BROKEN BAR + 0xA7, "§", # ISOnum : SECTION SIGN + 0xA8, "¨", # ISOdia : DIAERESIS + 0xA9, "©", # ISOnum : COPYRIGHT SIGN + 0xAA, "ª", # ISOnum : FEMININE ORDINAL INDICATOR + 0xAB, "«", # ISOnum : LEFT-POINTING DOUBLE ANGLE + # QUOTATION MARK + 0xAC, "¬", # ISOnum : NOT SIGN + 0xAD, "­", # ISOnum : SOFT HYPHEN + 0xAE, "®", # ISOnum : REGISTERED SIGN + 0xAF, "¯", # ISOdia : OVERLINE (MACRON) + 0xB0, "°", # ISOnum : DEGREE SIGN + 0xB1, "±", # ISOnum : PLUS-MINUS SIGN + 0xB2, "²", # ISOnum : SUPERSCRIPT TWO + 0xB3, "³", # ISOnum : SUPERSCRIPT THREE + 0xB4, "´", # ISOdia : ACUTE ACCENT + 0xB5, "µ", # ISOnum : MICRO SIGN + 0xB6, "¶", # ISOnum : PILCROW SIGN + 0xB7, "·", # ISOnum : MIDDLE DOT + 0xB8, "¸", # ISOdia : CEDILLA + 0xB9, "¹", # ISOnum : SUPERSCRIPT ONE + 0xBA, "º", # ISOnum : MASCULINE ORDINAL INDICATOR + 0xBB, "»", # ISOnum : RIGHT-POINTING DOUBLE ANGLE + # QUOTATION MARK + 0xBC, "¼", # ISOnum : VULGAR FRACTION ONE QUARTER + 0xBD, "½", # ISOnum : VULGAR FRACTION ONE HALF + 0xBE, "¾", # ISOnum : VULGAR FRACTION THREE QUARTERS + 0xBF, "¿", # ISOnum : INVERTED QUESTION MARK + 0xC0, "À", # ISOlat1: LATIN CAPITAL LETTER A WITH GRAVE + 0xC1, "Á", # ISOlat1: LATIN CAPITAL LETTER A WITH ACUTE + 0xC2, "Â", # ISOlat1: LATIN CAPITAL LETTER A WITH + # CIRCUMFLEX + 0xC3, "Ã", # ISOlat1: LATIN CAPITAL LETTER A WITH TILDE + 0xC4, "Ä", # ISOlat1: LATIN CAPITAL LETTER A WITH + # DIAERESIS + 0xC5, "Å", # ISOlat1: LATIN CAPITAL LETTER A WITH RING + # ABOVE + 0xC6, "Æ", # ISOlat1: LATIN CAPITAL LETTER AE + 0xC7, "Ç", # ISOlat1: LATIN CAPITAL LETTER C WITH CEDILLA + 0xC8, "È", # ISOlat1: LATIN CAPITAL LETTER E WITH GRAVE + 0xC9, "É", # ISOlat1: LATIN CAPITAL LETTER E WITH ACUTE + 0xCA, "Ê", # ISOlat1: LATIN CAPITAL LETTER E WITH + # CIRCUMFLEX + 0xCB, "Ë", # ISOlat1: LATIN CAPITAL LETTER E WITH + # DIAERESIS + 0xCC, "Ì", # ISOlat1: LATIN CAPITAL LETTER I WITH GRAVE + 0xCD, "Í", # ISOlat1: LATIN CAPITAL LETTER I WITH ACUTE + 0xCE, "Î", # ISOlat1: LATIN CAPITAL LETTER I WITH + # CIRCUMFLEX + 0xCF, "Ï", # ISOlat1: LATIN CAPITAL LETTER I WITH + # DIAERESIS + 0xD0, "Ğ", # ISOlat2: LATIN CAPITAL LETTER G WITH BREVE + 0xD1, "Ñ", # ISOlat1: LATIN CAPITAL LETTER N WITH TILDE + 0xD2, "Ò", # ISOlat1: LATIN CAPITAL LETTER O WITH GRAVE + 0xD3, "Ó", # ISOlat1: LATIN CAPITAL LETTER O WITH ACUTE + 0xD4, "Ô", # ISOlat1: LATIN CAPITAL LETTER O WITH + # CIRCUMFLEX + 0xD5, "Õ", # ISOlat1: LATIN CAPITAL LETTER O WITH TILDE + 0xD6, "Ö", # ISOlat1: LATIN CAPITAL LETTER O WITH + # DIAERESIS + 0xD7, "×", # ISOnum : MULTIPLICATION SIGN + 0xD8, "Ø", # ISOlat1: LATIN CAPITAL LETTER O WITH STROKE + 0xD9, "Ù", # ISOlat1: LATIN CAPITAL LETTER U WITH GRAVE + 0xDA, "Ú", # ISOlat1: LATIN CAPITAL LETTER U WITH ACUTE + 0xDB, "Û", # ISOlat1: LATIN CAPITAL LETTER U WITH + # CIRCUMFLEX + 0xDC, "Ü", # ISOlat1: LATIN CAPITAL LETTER U WITH + # DIAERESIS + 0xDD, "İ", # ISOlat2: LATIN CAPITAL LETTER I WITH DOT + # ABOVE + 0xDE, "Ş", # ISOlat2: LATIN CAPITAL LETTER S WITH CEDILLA + 0xDF, "ß", # ISOlat1: LATIN SMALL LETTER SHARP S (German) + 0xE0, "à", # ISOlat1: LATIN SMALL LETTER A WITH GRAVE + 0xE1, "á", # ISOlat1: LATIN SMALL LETTER A WITH ACUTE + 0xE2, "â", # ISOlat1: LATIN SMALL LETTER A WITH CIRCUMFLEX + 0xE3, "ã", # ISOlat1: LATIN SMALL LETTER A WITH TILDE + 0xE4, "ä", # ISOlat1: LATIN SMALL LETTER A WITH DIAERESIS + 0xE5, "å", # ISOlat1: LATIN SMALL LETTER A WITH RING ABOVE + 0xE6, "æ", # ISOlat1: LATIN SMALL LETTER AE + 0xE7, "ç", # ISOlat1: LATIN SMALL LETTER C WITH CEDILLA + 0xE8, "è", # ISOlat1: LATIN SMALL LETTER E WITH GRAVE + 0xE9, "é", # ISOlat1: LATIN SMALL LETTER E WITH ACUTE + 0xEA, "ę", # ISOlat2: LATIN SMALL LETTER E WITH OGONEK + 0xEB, "ë", # ISOlat1: LATIN SMALL LETTER E WITH DIAERESIS + 0xEC, "ė", # ISOlat2: LATIN SMALL LETTER E WITH DOT ABOVE + 0xED, "í", # ISOlat1: LATIN SMALL LETTER I WITH ACUTE + 0xEE, "î", # ISOlat1: LATIN SMALL LETTER I WITH CIRCUMFLEX + 0xEF, "ī", # ISOlat2: LATIN SMALL LETTER I WITH MACRON + 0xF0, "ğ", # ISOlat2: LATIN SMALL LETTER G WITH BREVE + 0xF1, "ñ", # ISOlat1: LATIN SMALL LETTER N WITH TILDE + 0xF2, "ò", # ISOlat1: LATIN SMALL LETTER O WITH GRAVE + 0xF3, "ó", # ISOlat1: LATIN SMALL LETTER O WITH ACUTE + 0xF4, "ô", # ISOlat1: LATIN SMALL LETTER O WITH CIRCUMFLEX + 0xF5, "õ", # ISOlat1: LATIN SMALL LETTER O WITH TILDE + 0xF6, "ö", # ISOlat1: LATIN SMALL LETTER O WITH DIAERESIS + 0xF7, "÷", # ISOlat1: DIVISION SIGN + 0xF8, "ø", # ISOlat1: LATIN SMALL LETTER O WITH STROKE + 0xF9, "ù", # ISOlat1: LATIN SMALL LETTER U WITH GRAVE + 0xFA, "ú", # ISOlat1: LATIN SMALL LETTER U WITH ACUTE + 0xFB, "û", # ISOlat1: LATIN SMALL LETTER U WITH CIRCUMFLEX + 0xFC, "ü", # ISOlat1: LATIN SMALL LETTER U WITH DIAERESIS + 0xFD, "ı", # ISOlat2: LATIN SMALL LETTER I DOTLESS + 0xFE, "ş", # ISOlat2: LATIN SMALL LETTER S WITH CEDILLA + 0xFF, "ÿ", # ISOlat1: LATIN SMALL LETTER Y WITH DIAERESIS +); + +##--------------------------------------------------------------------------- +## ISO-8859-10: Latin-6 +##--------------------------------------------------------------------------- + +%ISO_8859_10_To_Ent = ( + #-------------------------------------------------------------------------- + # Hex Code Entity Ref # ISO external entity and description + #-------------------------------------------------------------------------- + 0xA1, "Ą", # ISOlat1: LATIN CAPITAL LETTER A WITH OGONEK + 0xA2, "Ē", # ISOlat2: LATIN CAPITAL LETTER E WITH MACRON + 0xA3, "Ģ", # ISOlat2: LATIN CAPITAL LETTER G WITH CEDILLA + 0xA4, "Ī", # ISOlat2: LATIN CAPITAL LETTER I WITH MACRON + 0xA5, "Ĩ", # ISOlat2: LATIN CAPITAL LETTER I WITH TILDE + 0xA6, "Ķ", # ISOlat2: LATIN CAPITAL LETTER K WITH CEDILLA + 0xA7, "Ļ", # ISOlat2: LATIN CAPITAL LETTER L WITH CEDILLA + 0xA8, "Ń", # ISOlat2: LATIN CAPITAL LETTER N WITH ACUTE + 0xA9, "Ŗ", # ISOlat2: LATIN CAPITAL LETTER R WITH CEDILLA + 0xAA, "Š", # ISOlat2: LATIN CAPITAL LETTER S WITH CARON + 0xAB, "Ŧ", # ISOlat2: LATIN CAPITAL LETTER T WITH STROKE + 0xAC, "Ž", # ISOlat2: LATIN CAPITAL LETTER Z WITH CARON + 0xAD, "­", # ISOnum : SOFT HYPHEN + 0xAE, "ĸ", # ISOlat2: LATIN SMALL LETTER KRA (Greenlandic) + 0xAF, "&end;", # ISOlat?: LATIN SMALL LETTER END (Lappish) + 0xB0, "đ", # ISOlat2: LATIN SMALL LETTER d WITH STROKE + 0xB1, "ą", # ISOlat2: LATIN SMALL LETTER a WITH OGONEK + 0xB2, "ē", # ISOlat2: LATIN SMALL LETTER e WITH MACRON + 0xB3, "&gcedil;", # ISOlat2: LATIN SMALL LETTER g WITH CEDILLA + 0xB4, "ī", # ISOlat2: LATIN SMALL LETTER i WITH MACRON + 0xB5, "ĩ", # ISOlat2: LATIN SMALL LETTER i WITH TILDE + 0xB6, "ķ", # ISOlat2: LATIN SMALL LETTER k WITH CEDILLA + 0xB7, "ļ", # ISOlat2: LATIN SMALL LETTER l WITH CEDILLA + 0xB8, "ń", # ISOlat2: LATIN SMALL LETTER n WITH ACUTE + 0xB9, "ŗ", # ISOlat2: LATIN SMALL LETTER r WITH CEDILLA + 0xBA, "š", # ISOlat2: LATIN SMALL LETTER s WITH CARON + 0xBB, "ŧ", # ISOlat2: LATIN SMALL LETTER t WITH STROKE + 0xBC, "ž", # ISOlat2: LATIN SMALL LETTER z WITH CARON + 0xBD, "§", # ISOnum : SECTION SIGN + 0xBE, "ß", # ISOlat1: LATIN SMALL LETTER SHARP s (German) + 0xBF, "ŋ", # ISOlat2: LATIN SMALL LETTER ENG (Lappish) + 0xC0, "Ā", # ISOlat2: LATIN CAPITAL LETTER A WITH MACRON + 0xC1, "Á", # ISOlat1: LATIN CAPITAL LETTER A WITH ACUTE + 0xC2, "Â", # ISOlat1: LATIN CAPITAL LETTER A WITH + # CIRCUMFLEX + 0xC3, "Ã", # ISOlat1: LATIN CAPITAL LETTER A WITH TILDE + 0xC4, "Ä", # ISOlat1: LATIN CAPITAL LETTER A WITH + # DIAERESIS + 0xC5, "Å", # ISOlat1: LATIN CAPITAL LETTER A WITH RING + # ABOVE + 0xC6, "Æ", # ISOlat1: LATIN CAPITAL LETTER AE + 0xC7, "Į", # ISOlat2: LATIN CAPITAL LETTER I WITH OGONEK + 0xC8, "Č", # ISOlat2: LATIN CAPITAL LETTER C WITH CARON + 0xC9, "É", # ISOlat1: LATIN CAPITAL LETTER E WITH ACUTE + 0xCA, "Ę", # ISOlat2: LATIN CAPITAL LETTER E WITH OGONEK + 0xCB, "Ë", # ISOlat1: LATIN CAPITAL LETTER E WITH + # DIAERESIS + 0xCC, "Ė", # ISOlat2: LATIN CAPITAL LETTER E WITH + # DOT ABOVE + 0xCD, "Í", # ISOlat1: LATIN CAPITAL LETTER I WITH ACUTE + 0xCE, "Î", # ISOlat1: LATIN CAPITAL LETTER I WITH + # CIRCUMFLEX + 0xCF, "Ï", # ISOlat1: LATIN CAPITAL LETTER I WITH + # DIAERESIS + 0xD0, "Đ", # ISOlat2: LATIN CAPITAL LETTER D WITH STROKE + 0xD1, "Ņ", # ISOlat2: LATIN CAPITAL LETTER N WITH CEDILLA + 0xD2, "Ō", # ISOlat2: LATIN CAPITAL LETTER O WITH MACRON + 0xD3, "Ó", # ISOlat1: LATIN CAPITAL LETTER O WITH ACUTE + 0xD4, "Ô", # ISOlat1: LATIN CAPITAL LETTER O WITH + # CIRCUMFLEX + 0xD5, "Õ", # ISOlat1: LATIN CAPITAL LETTER O WITH TILDE + 0xD6, "Ö", # ISOlat1: LATIN CAPITAL LETTER O WITH + # DIAERESIS + 0xD7, "Ũ", # ISOlat2: LATIN CAPITAL LETTER U WITH TILDE + 0xD8, "Ø", # ISOlat1: LATIN CAPITAL LETTER O WITH STROKE + 0xD9, "Ų", # ISOlat2: LATIN CAPITAL LETTER U WITH OGONEK + 0xDA, "Ú", # ISOlat1: LATIN CAPITAL LETTER U WITH ACUTE + 0xDB, "Û", # ISOlat1: LATIN CAPITAL LETTER U WITH + # CIRCUMFLEX + 0xDC, "Ü", # ISOlat1: LATIN CAPITAL LETTER U WITH + # DIAERESIS + 0xDD, "Ý", # ISOlat1: LATIN CAPITAL LETTER Y WITH ACUTE + 0xDE, "Þ", # ISOlat1: LATIN CAPITAL LETTER THORN + # (Icelandic) + 0xDF, "Ū", # ISOlat2: LATIN CAPITAL LETTER U WITH MACRON + 0xE0, "ā", # ISOlat2: LATIN SMALL LETTER a WITH MACRON + 0xE1, "á", # ISOlat1: LATIN SMALL LETTER a WITH ACUTE + 0xE2, "â", # ISOlat1: LATIN SMALL LETTER a WITH CIRCUMFLEX + 0xE3, "ã", # ISOlat1: LATIN SMALL LETTER a WITH TILDE + 0xE4, "ä", # ISOlat1: LATIN SMALL LETTER a WITH DIAERESIS + 0xE5, "å", # ISOlat1: LATIN SMALL LETTER a WITH RING ABOVE + 0xE6, "æ", # ISOlat1: LATIN SMALL LETTER ae + 0xE7, "į", # ISOlat2: LATIN SMALL LETTER i WITH OGONEK + 0xE8, "č", # ISOlat2: LATIN SMALL LETTER c WITH CARON + 0xE9, "é", # ISOlat1: LATIN SMALL LETTER e WITH ACUTE + 0xEA, "ę", # ISOlat2: LATIN SMALL LETTER e WITH OGONEK + 0xEB, "ë", # ISOlat1: LATIN SMALL LETTER e WITH DIAERESIS + 0xEC, "ė", # ISOlat2: LATIN SMALL LETTER e WITH DOT ABOVE + 0xED, "í", # ISOlat1: LATIN SMALL LETTER i WITH ACUTE + 0xEE, "î", # ISOlat1: LATIN SMALL LETTER i WITH CIRCUMFLEX + 0xEF, "ï", # ISOlat1: LATIN SMALL LETTER i WITH DIAERESIS + 0xF0, "ð", # ISOlat1: LATIN SMALL LETTER ETH (Icelandic) + 0xF1, "ņ", # ISOlat2: LATIN SMALL LETTER n WITH CEDILLA + 0xF2, "ō", # ISOlat2: LATIN SMALL LETTER o WITH MACRON + 0xF3, "ó", # ISOlat1: LATIN SMALL LETTER o WITH ACUTE + 0xF4, "ô", # ISOlat1: LATIN SMALL LETTER o WITH CIRCUMFLEX + 0xF5, "õ", # ISOlat1: LATIN SMALL LETTER o WITH TILDE + 0xF6, "ö", # ISOlat1: LATIN SMALL LETTER o WITH DIAERESIS + 0xF7, "ũ", # ISOlat2: LATIN SMALL LETTER u WITH TILDE + 0xF8, "ø", # ISOlat1: LATIN SMALL LETTER o WITH STROKE + 0xF9, "ų", # ISOlat2: LATIN SMALL LETTER u WITH OGONEK + 0xFA, "ú", # ISOlat1: LATIN SMALL LETTER u WITH ACUTE + 0xFB, "û", # ISOlat1: LATIN SMALL LETTER u WITH CIRCUMFLEX + 0xFC, "ü", # ISOlat1: LATIN SMALL LETTER u WITH DIAERESIS + 0xFD, "ý", # ISOlat1: LATIN SMALL LETTER y WITH ACUTE + 0xFE, "þ", # ISOlat1: LATIN SMALL LETTER THORN (Icelandic) + 0xFF, "ū", # ISOlat2: LATIN SMALL LETTER u WITH MACRON +); + +############################################################################### +## Routines +############################################################################### + +##---------------------------------------------------------------------------## +## str2sgml converts a string encoded by $charset to an sgml +## string where special characters are converted to entity +## references. +## +## $return_data = iso_8859'str2sgml($data, $charset); +## +sub str2sgml { + local($data, $charset) = ($_[0], $_[1]); + local($ret, $offset, $len) = ('', 0, 0); + + # Get mapping (this method works for Perl 4 and 5) + $charset =~ tr/a-z/A-Z/; + $charset =~ tr/-/_/; + local(*map) = ("${charset}_To_Ent"); + + # Convert string + $len = length($data); + while ($offset < $len) { + $char = unpack("C", substr($data, $offset++, 1)); + $ret .= ($map{$char} || $US_ASCII_To_Ent{$char} || pack("C", $char)); + } + $ret; +} +##---------------------------------------------------------------------------## + +1; diff --git a/lib/mhdb.pl b/lib/mhdb.pl index ffa3d3b..2681b2e 100644 --- a/lib/mhdb.pl +++ b/lib/mhdb.pl @@ -1,15 +1,13 @@ ##---------------------------------------------------------------------------## ## File: -## mhdb.pl +## @(#) mhdb.pl 1.10 97/05/13 11:00:54 @(#) ## Author: -## Earl Hood ehood@isogen.com +## Earl Hood ehood@medusa.acs.uci.edu ## Description: ## MHonArc library defining routines for outputing database. -## Date: -## Tue Mar 12 13:07:30 CST 1996 ##---------------------------------------------------------------------------## ## MHonArc -- Internet mail-to-HTML converter -## Copyright (C) 1995 Earl Hood, ehood@isogen.com +## Copyright (C) 1995-1997 Earl Hood, ehood@medusa.acs.uci.edu ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -26,28 +24,25 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ##---------------------------------------------------------------------------## -package main; - ##--------------------------------------------------------------------------- ## output_db() spits out the state of mhonarc to a file. This ## (database) file contains information to update mail threading ## when incremental adding is done. The actual database file ## is a Perl program defining all the internal data structures. All -## mhonarc does is 'require' it when updating. This is really +## mhonarc does is 'require' it when updating. This is ## fast and avoids storing mail threading info in the HTML message ## files -- which would require opening every file to perform ## updates. ## sub output_db { - if (open(DB, "> ${OUTDIR}${DIRSEP}${DBFILE}")) { + local($pathname) = shift; + if (open(DB, "> $pathname")) { - print DB "## MHonArc ($VERSION) database/state information\n", - "## This file is needed to perform updates to the archive\n", - "## DO NOT MODIFY.\n", - "##\n"; + print DB "## MHonArcDB\n"; &print_var(DB, 'DbVERSION', *VERSION); &print_assoc(DB, 'ContentType', *ContentType); + &print_assoc(DB, 'CustomRcVars', *CustomRcVars); &print_assoc(DB, 'Date', *Date); &print_assoc(DB, 'Derived', *Derived); &print_assoc(DB, 'FieldODefs', *FieldODefs); @@ -58,76 +53,226 @@ sub output_db { &print_assoc(DB, 'HeadHeads', *HeadHeads); &print_assoc(DB, 'Icons', *Icons); &print_assoc(DB, 'IndexNum', *IndexNum); - &print_assoc(DB, 'MIMEFilters', *MIMEFilters); - &print_assoc(DB, 'MIMEFiltersArgs', *MIMEFiltersArgs); + &print_assoc(DB, "main'MIMECharSetConverters", + *main'MIMECharSetConverters); + &print_assoc(DB, "main'MIMEFilters", *main'MIMEFilters); + &print_assoc(DB, "main'MIMEFiltersArgs", *main'MIMEFiltersArgs); &print_assoc(DB, 'MsgId', *MsgId); &print_assoc(DB, 'Refs', *Refs); &print_assoc(DB, 'Subject', *Subject); + &print_assoc(DB, 'UDerivedFile', *UDerivedFile); + &print_assoc(DB, 'Zone', *Zone); + &print_array(DB, 'CharSetRequires', *CharSetRequires); &print_array(DB, 'FieldOrder', *FieldOrder); + &print_array(DB, 'Months', *Months); + &print_array(DB, 'months', *months); &print_array(DB, 'OtherIdxs', *OtherIdxs); &print_array(DB, 'PerlINC', *PerlINC); &print_array(DB, 'Requires', *Requires); + &print_array(DB, 'TListOrder', *TListOrder); + &print_array(DB, 'Weekdays', *Weekdays); + &print_array(DB, 'weekdays', *weekdays); + + ## I should use a hash for this stuff instead of + ## individual variables - &print_var(DB, 'BOTLINKS', *BOTLINKS); &print_var(DB, 'DOCURL', *DOCURL); + &print_var(DB, 'DecodeHeads', *DecodeHeads); + &print_var(DB, 'DoFolRefs', *DoFolRefs); + &print_var(DB, 'ExpireDate', *ExpireDate); + &print_var(DB, 'ExpireTime', *ExpireTime); &print_var(DB, 'FROM', *FROM); - &print_var(DB, 'IDXNAME', *IDXNAME); - &print_var(DB, 'IDXPGBEG', *IDXPGBEG); - &print_var(DB, 'IDXPGEND', *IDXPGEND); + &print_var(DB, 'GMTDateFmt', *GMTDateFmt); &print_var(DB, 'IDXSIZE', *IDXSIZE); - &print_var(DB, 'LIBEG', *LIBEG); - &print_var(DB, 'LIEND', *LIEND); - &print_var(DB, 'LITMPL', *LITMPL); + &print_var(DB, 'LocalDateFmt', *LocalDateFmt); &print_var(DB, 'MAILTOURL', *MAILTOURL); + &print_var(DB, 'MAIN', *MAIN); &print_var(DB, 'MAXSIZE', *MAXSIZE); + &print_var(DB, 'MHPATTERN', *MHPATTERN); + &print_var(DB, 'MODTIME', *MODTIME); &print_var(DB, 'MSGFOOT', *MSGFOOT); + &print_var(DB, 'MsgGMTDateFmt', *MsgGMTDateFmt); &print_var(DB, 'MSGHEAD', *MSGHEAD); - &print_var(DB, 'MSGPGBEG', *MSGPGBEG); - &print_var(DB, 'MSGPGEND', *MSGPGEND); - &print_var(DB, 'NEXTBL', *NEXTBL); - &print_var(DB, 'NEXTBUTTON', *NEXTBUTTON); - &print_var(DB, 'NEXTBUTTONIA', *NEXTBUTTONIA); - &print_var(DB, 'NEXTFL', *NEXTFL); - &print_var(DB, 'NEXTLINK', *NEXTLINK); - &print_var(DB, 'NEXTLINKIA', *NEXTLINKIA); + &print_var(DB, 'MsgLocalDateFmt', *MsgLocalDateFmt); + &print_var(DB, 'MULTIIDX', *MULTIIDX); &print_var(DB, 'NOMAILTO', *NOMAILTO); &print_var(DB, 'NONEWS', *NONEWS); &print_var(DB, 'NOSORT', *NOSORT); &print_var(DB, 'NOURL', *NOURL); &print_var(DB, 'NumOfMsgs', *NumOfMsgs); - &print_var(DB, 'PREVBUTTON', *PREVBUTTON); - &print_var(DB, 'PREVBUTTONIA', *PREVBUTTONIA); - &print_var(DB, 'PREVLINK', *PREVLINK); - &print_var(DB, 'PREVLINKIA', *PREVLINKIA); - &print_var(DB, 'REVSORT', *REVSORT); - &print_var(DB, 'SUBSORT', *SUBSORT); - &print_var(DB, 'TFOOT', *TFOOT); - &print_var(DB, 'THEAD', *THEAD); + &print_var(DB, 'NumOfPages', *NumOfPages); &print_var(DB, 'THREAD', *THREAD); - &print_var(DB, 'TIDXNAME', *TIDXNAME); - &print_var(DB, 'TIDXPGBEG', *TIDXPGBEG); - &print_var(DB, 'TIDXPGEND', *TIDXPGEND); - &print_var(DB, 'TITLE', *TITLE); - &print_var(DB, 'TLEVELS', *TLEVELS); - &print_var(DB, 'TLITXT', *TLITXT); - &print_var(DB, 'TOPLINKS', *TOPLINKS); - &print_var(DB, 'TREVERSE', *TREVERSE); - &print_var(DB, 'TTITLE', *TTITLE); + + # Main index resources + if ($MAIN) { + &print_var(DB, 'AUTHSORT', *AUTHSORT); + &print_var(DB, 'IDXNAME', *IDXNAME); + &print_var(DB, 'IDXPREFIX', *IDXPREFIX); + &print_var(DB, 'REVSORT', *REVSORT); + &print_var(DB, 'SUBSORT', *SUBSORT); + &print_var(DB, 'TITLE', *TITLE); + + &print_var(DB, 'AUTHBEG', *AUTHBEG) + unless $IsDefault{'AUTHBEG'}; + &print_var(DB, 'AUTHEND', *AUTHEND) + unless $IsDefault{'AUTHEND'}; + &print_var(DB, 'DAYBEG', *DAYBEG) + unless $IsDefault{'DAYBEG'}; + &print_var(DB, 'DAYEND', *DAYEND) + unless $IsDefault{'DAYEND'}; + &print_var(DB, 'IDXLABEL', *IDXLABEL) + unless $IsDefault{'IDXLABEL'}; + &print_var(DB, 'IDXPGBEG', *IDXPGBEG) + unless $IsDefault{'IDXPGBEG'}; + &print_var(DB, 'IDXPGEND', *IDXPGEND) + unless $IsDefault{'IDXPGEND'}; + &print_var(DB, 'LIBEG', *LIBEG) + unless $IsDefault{'LIBEG'}; + &print_var(DB, 'LIEND', *LIEND) + unless $IsDefault{'LIEND'}; + &print_var(DB, 'LITMPL', *LITMPL) + unless $IsDefault{'LITMPL'}; + &print_var(DB, 'NEXTPGLINK', *NEXTPGLINK) + unless $IsDefault{'NEXTPGLINK'}; + &print_var(DB, 'NEXTPGLINKIA', *NEXTPGLINKIA) + unless $IsDefault{'NEXTPGLINKIA'}; + &print_var(DB, 'PREVPGLINK', *PREVPGLINK) + unless $IsDefault{'PREVPGLINK'}; + &print_var(DB, 'PREVPGLINKIA', *PREVPGLINKIA) + unless $IsDefault{'PREVPGLINKIA'}; + &print_var(DB, 'SUBJECTBEG', *SUBJECTBEG) + unless $IsDefault{'SUBJECTBEG'}; + &print_var(DB, 'SUBJECTEND', *SUBJECTEND) + unless $IsDefault{'SUBJECTEND'}; + } + + # Thread index resources + if ($THREAD) { + &print_var(DB, 'TIDXNAME', *TIDXNAME); + &print_var(DB, 'TIDXPREFIX', *TIDXPREFIX); + &print_var(DB, 'TLEVELS', *TLEVELS); + &print_var(DB, 'TREVERSE', *TREVERSE); + &print_var(DB, 'TTITLE', *TTITLE); + + &print_var(DB, 'TCONTBEG', *TCONTBEG) + unless $IsDefault{'TCONTBEG'}; + &print_var(DB, 'TCONTEND', *TCONTEND) + unless $IsDefault{'TCONTEND'}; + &print_var(DB, 'TFOOT', *TFOOT) + unless $IsDefault{'TFOOT'}; + &print_var(DB, 'THEAD', *THEAD) + unless $IsDefault{'THEAD'}; + &print_var(DB, 'TIDXLABEL', *TIDXLABEL) + unless $IsDefault{'TIDXLABEL'}; + &print_var(DB, 'TIDXPGBEG', *TIDXPGBEG) + unless $IsDefault{'TIDXPGBEG'}; + &print_var(DB, 'TIDXPGEND', *TIDXPGEND) + unless $IsDefault{'TIDXPGEND'}; + &print_var(DB, 'TINDENTBEG', *TINDENTBEG) + unless $IsDefault{'TINDENTBEG'}; + &print_var(DB, 'TINDENTEND', *TINDENTEND) + unless $IsDefault{'TINDENTEND'}; + &print_var(DB, 'TLIEND', *TLIEND) + unless $IsDefault{'TLIEND'}; + &print_var(DB, 'TLINONE', *TLINONE) + unless $IsDefault{'TLINONE'}; + &print_var(DB, 'TLINONEEND', *TLINONEEND) + unless $IsDefault{'TLINONEEND'}; + &print_var(DB, 'TLITXT', *TLITXT) + unless $IsDefault{'TLITXT'}; + &print_var(DB, 'TNEXTPGLINK', *TNEXTPGLINK) + unless $IsDefault{'TNEXTPGLINK'}; + &print_var(DB, 'TNEXTPGLINKIA', *TNEXTPGLINKIA) + unless $IsDefault{'TNEXTPGLINKIA'}; + &print_var(DB, 'TPREVPGLINK', *TPREVPGLINK) + unless $IsDefault{'TPREVPGLINK'}; + &print_var(DB, 'TPREVPGLINKIA', *TPREVPGLINKIA) + unless $IsDefault{'TPREVPGLINKIA'}; + &print_var(DB, 'TSINGLETXT', *TSINGLETXT) + unless $IsDefault{'TSINGLETXT'}; + &print_var(DB, 'TSUBJECTBEG', *TSUBJECTBEG) + unless $IsDefault{'TSUBJECTBEG'}; + &print_var(DB, 'TSUBJECTEND', *TSUBJECTEND) + unless $IsDefault{'TSUBJECTEND'}; + &print_var(DB, 'TSUBLISTBEG', *TSUBLISTBEG) + unless $IsDefault{'TSUBLISTBEG'}; + &print_var(DB, 'TSUBLISTEND', *TSUBLISTEND) + unless $IsDefault{'TSUBLISTEND'}; + &print_var(DB, 'TTOPBEG', *TTOPBEG) + unless $IsDefault{'TTOPBEG'}; + &print_var(DB, 'TTOPEND', *TTOPEND) + unless $IsDefault{'TTOPEND'}; + } + + &print_var(DB, 'BOTLINKS', *BOTLINKS) + unless $IsDefault{'BOTLINKS'}; + &print_var(DB, 'FIELDSBEG', *FIELDSBEG) + unless $IsDefault{'FIELDSBEG'}; + &print_var(DB, 'FIELDSEND', *FIELDSEND) + unless $IsDefault{'FIELDSEND'}; + &print_var(DB, 'FLDBEG', *FLDBEG) + unless $IsDefault{'FLDBEG'}; + &print_var(DB, 'FLDEND', *FLDEND) + unless $IsDefault{'FLDEND'}; + &print_var(DB, 'HEADBODYSEP ', *HEADBODYSEP) + unless $IsDefault{'HEADBODYSEP'}; + &print_var(DB, 'LABELBEG', *LABELBEG) + unless $IsDefault{'LABELBEG'}; + &print_var(DB, 'LABELEND', *LABELEND) + unless $IsDefault{'LABELEND'}; + &print_var(DB, 'MSGPGBEG', *MSGPGBEG) + unless $IsDefault{'MSGPGBEG'}; + &print_var(DB, 'MSGPGEND', *MSGPGEND) + unless $IsDefault{'MSGPGEND'}; + &print_var(DB, 'NEXTBUTTON', *NEXTBUTTON) + unless $IsDefault{'NEXTBUTTON'}; + &print_var(DB, 'NEXTBUTTONIA', *NEXTBUTTONIA) + unless $IsDefault{'NEXTBUTTONIA'}; + &print_var(DB, 'NEXTLINK', *NEXTLINK) + unless $IsDefault{'NEXTLINK'}; + &print_var(DB, 'NEXTLINKIA', *NEXTLINKIA) + unless $IsDefault{'NEXTLINKIA'}; + &print_var(DB, 'PREVBUTTON', *PREVBUTTON) + unless $IsDefault{'PREVBUTTON'}; + &print_var(DB, 'PREVBUTTONIA', *PREVBUTTONIA) + unless $IsDefault{'PREVBUTTONIA'}; + &print_var(DB, 'PREVLINK', *PREVLINK) + unless $IsDefault{'PREVLINK'}; + &print_var(DB, 'PREVLINKIA', *PREVLINKIA) + unless $IsDefault{'PREVLINKIA'}; + &print_var(DB, 'TNEXTBUTTON', *TNEXTBUTTON) + unless $IsDefault{'TNEXTBUTTON'}; + &print_var(DB, 'TNEXTBUTTONIA', *TNEXTBUTTONIA) + unless $IsDefault{'TNEXTBUTTONIA'}; + &print_var(DB, 'TNEXTLINK', *TNEXTLINK) + unless $IsDefault{'TNEXTLINK'}; + &print_var(DB, 'TNEXTLINKIA', *TNEXTLINKIA) + unless $IsDefault{'TNEXTLINKIA'}; + &print_var(DB, 'TOPLINKS', *TOPLINKS) + unless $IsDefault{'TOPLINKS'}; + &print_var(DB, 'TPREVBUTTON', *TPREVBUTTON) + unless $IsDefault{'TPREVBUTTON'}; + &print_var(DB, 'TPREVBUTTONIA', *TPREVBUTTONIA) + unless $IsDefault{'TPREVBUTTONIA'}; + &print_var(DB, 'TPREVLINK', *TPREVLINK) + unless $IsDefault{'TPREVLINK'}; + &print_var(DB, 'TPREVLINKIA', *TPREVLINKIA) + unless $IsDefault{'TPREVLINKIA'}; &print_var(DB, 'UMASK', *UMASK); - print DB "1;\n"; + print DB "1;\n"; # for require } else { - warn "Warning: Unable to create ${OUTDIR}${DIRSEP}${DBFILE}\n"; + warn "Warning: Unable to create database, $pathname\n"; } } ##--------------------------------------------------------------------------- sub print_assoc { local($handle, $name, *assoc) = @_; - print $handle "%$name = (\n"; + print $handle "%$name=(\n"; foreach (keys %assoc) { - print $handle qq{'}, &escape_str($_), qq{', '}, + print $handle qq{'}, &escape_str($_), qq{','}, &escape_str($assoc{$_}), qq{',\n}; } print $handle ");\n"; @@ -136,7 +281,7 @@ sub print_assoc { sub print_array { local($handle, $name, *array) = @_; - print $handle "\@$name = (\n"; + print $handle "\@$name=(\n"; foreach (@array) { print $handle qq{'}, &escape_str($_), qq{',\n}; } @@ -146,8 +291,8 @@ sub print_array { sub print_var { local($handle, $name, *var, $d) = @_; - print $handle qq{\$$name = '}, &escape_str($var), qq{'}; - print $handle qq{ unless defined(\$$name)} if $d; + print $handle qq{\$$name='}, &escape_str($var), qq{'}; + print $handle qq{ unless defined(\$$name)} if $d; print $handle qq{;\n}; } ##--------------------------------------------------------------------------- diff --git a/lib/mhdysub.pl b/lib/mhdysub.pl new file mode 100644 index 0000000..976f211 --- /dev/null +++ b/lib/mhdysub.pl @@ -0,0 +1,69 @@ +##---------------------------------------------------------------------------## +## File: +## @(#) mhdysub.pl 1.2 97/02/17 @(#) +## Author: +## Earl Hood ehood@medusa.acs.uci.edu +## Description: +## Definition of create_routines() that creates routines are +## runtime. +##---------------------------------------------------------------------------## +## MHonArc -- Internet mail-to-HTML converter +## Copyright (C) 1996 Earl Hood, ehood@medusa.acs.uci.edu +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +##---------------------------------------------------------------------------## + +##--------------------------------------------------------------------------- +## create_routines is used to dynamically create routines that +## would benefit from being create at run-time. Routines +## that have to check against several regular expressions +## are candidates. +## +sub create_routines { + local($sub) = ''; + + ##----------------------------------------------------------------------- + ## exclude_field: Used to determine if field should be excluded from + ## message header + ## + $sub =<<'EndOfRoutine'; + sub exclude_field { + local($f) = shift; + local($pat, $ret); + $ret = 0; + EXC_FIELD_SW: { +EndOfRoutine + + # Create switch block for checking field against regular + # expressions (a large || statement could also work). + foreach $pat (keys %HFieldsExc) { + $sub .= join('', + 'if ($f =~ /^', + $pat, + '/i) { $ret = 1; last EXC_FIELD_SW; }', + "\n"); + } + + $sub .=<<'EndOfRoutine'; + } + $ret; + } +EndOfRoutine + + eval $sub; + die("ERROR: Unable to create exclude_field routine:\n$@\n") if $@; +} +##---------------------------------------------------------------------------## +1; diff --git a/lib/mhexternal.pl b/lib/mhexternal.pl index a7157d1..5a4b516 100644 --- a/lib/mhexternal.pl +++ b/lib/mhexternal.pl @@ -1,10 +1,8 @@ ##---------------------------------------------------------------------------## ## File: -## mhexternal.pl +## @(#) mhexternal.pl 1.11 97/05/13 11:23:46 @(#) ## Author: -## Earl Hood ehood@isogen.com -## Date: -## Fri Jul 12 08:34:55 CDT 1996 +## Earl Hood ehood@medusa.acs.uci.edu ## Description: ## Library defines a routine for MHonArc to filter content-types ## that cannot be directly filtered into HTML, but a linked to an @@ -17,11 +15,11 @@ ## ## ## Where '*/*' represents various content-types. See code below for -## all subtypes. +## all types supported. ## ##---------------------------------------------------------------------------## ## MHonArc -- Internet mail-to-HTML converter -## Copyright (C) 1995 Earl Hood, ehood@isogen.com +## Copyright (C) 1995-1997 Earl Hood, ehood@medusa.acs.uci.edu ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -40,150 +38,144 @@ package m2h_external; -##--------------------------------------------------------------------------- -## Global variables - -$pre = ''; # Prefix to generated files -$ext = ''; # Extension for files -$ctype = ''; # Content-type of data -$TYPE = ''; # English name for data type %ExtCnt = (); # Array of filename counters for generated files -$inline = 0; # Can be changed by filter argument - -##--------------------------------------------------------------------------- -## All that should be required is to add to, or edit, the %AppExt and -## %AppType arrays for new, or changed, application suptypes. - -$UnknownExt = 'xxx'; +$UnknownExt = 'bin'; $UnknownType = 'Unrecognized Data'; +$SubDir = 0; %CTExt = ( -## Content-Type Filename extension -##--------------------------------------------------------- - 'application/mac-binhex40', 'hqx', - 'application/octet-stream', 'bin', - 'application/oda', 'oda', - 'application/pdf', 'pdf', - 'application/postscript', 'ps', - 'application/rtf', 'rtf', - 'application/x-bcpio', 'bcpio', - 'application/x-cpio', 'cpio', - 'application/x-csh', 'csh', - 'application/x-dvi', 'dvi', - 'application/x-gtar', 'gtar', - 'application/x-hdf', 'hdf', - 'application/x-latex', 'latex', - 'application/x-mif', 'mif', - 'application/x-netcdf', 'cdf', - 'application/x-sh', 'sh', - 'application/x-shar', 'shar', - 'application/x-sv4cpio', 'sv4cpio', - 'application/x-sv4crc', 'sv4crc', - 'application/x-tar', 'tar', - 'application/x-tcl', 'tcl', - 'application/x-tex', 'tex', - 'application/x-texinfo', 'texinfo', - 'application/x-troff', 'roff', - 'application/x-troff-man', 'man', - 'application/x-troff-me', 'me', - 'application/x-troff-ms', 'ms', - 'application/x-ustar', 'ustar', - 'application/x-wais-source', 'src', - 'application/zip', 'zip', - 'audio/basic', 'snd', - 'audio/x-aiff', 'aif', - 'audio/x-wav', 'wav', - 'image/gif', 'gif', - 'image/ief', 'ief', - 'image/jpeg', 'jpg', - 'image/tiff', 'tif', - 'image/x-bmp', 'bmp', - 'image/x-cmu-raster', 'ras', - 'image/x-pict', 'pict', - 'image/x-portable-anymap', 'pnm', - 'image/x-pnm', 'pnm', - 'image/x-portable-bitmap', 'pbm', - 'image/x-pbm', 'pbm', - 'image/x-portable-graymap', 'pgm', - 'image/x-pcx', 'pcx', - 'image/x-pgm', 'pgm', - 'image/x-portable-pixmap', 'ppm', - 'image/x-ppm', 'ppm', - 'image/x-rgb', 'rgb', - 'image/x-xbitmap', 'xbm', - 'image/x-xbm', 'xbm', - 'image/x-xpixmap', 'xpm', - 'image/x-xpm', 'xpm', - 'image/x-xwindowdump', 'xwd', - 'image/x-xwd', 'xwd', - 'video/mpeg', 'mpg', - 'video/quicktime', 'mov', - 'video/x-msvideo', 'avi', - 'video/x-sgi-movie', 'movie', -); -%CTType = ( -## Content-Type English name -##--------------------------------------------------------- - 'application/mac-binhex40', 'Mac BinHex file', - 'application/octet-stream', 'Binary data', - 'application/oda', 'ODA file', - 'application/pdf', 'PDF file', - 'application/postscript', 'PostScript file', - 'application/rtf', 'RTF file', - 'application/x-bcpio', 'BCPIO file', - 'application/x-cpio', 'CPIO file', - 'application/x-csh', 'Csh script', - 'application/x-dvi', 'TeX dvi file', - 'application/x-gtar', 'Gtar file', - 'application/x-hdf', 'HDF file', - 'application/x-latex', 'LaTex document', - 'application/x-mif', 'Frame MIF', - 'application/x-netcdf', 'Cdf file', - 'application/x-sh', 'Sh script', - 'application/x-shar', 'Shar file', - 'application/x-sv4cpio', 'SV4Cpio file', - 'application/x-sv4crc', 'SV4Crc file', - 'application/x-tar', 'Tar file', - 'application/x-tcl', 'Tcl script', - 'application/x-tex', 'TeX document', - 'application/x-texinfo', 'TeXInfo file', - 'application/x-troff', 'Troff', - 'application/x-troff-man', 'Troff Man', - 'application/x-troff-me', 'Troff ME', - 'application/x-troff-ms', 'Troff MS', - 'application/x-ustar', 'UStar file', - 'application/x-wais-source', 'WAIS Source', - 'application/zip', 'Zip file', - 'audio/basic', 'Basic audio', - 'audio/x-aiff', 'AIF audio', - 'audio/x-wav', 'WAV audio', - 'image/gif', 'GIF image', - 'image/ief', 'IEF image', - 'image/jpeg', 'JPEG image', - 'image/tiff', 'TIFF image', - 'image/x-bmp', 'Windows bitmap', - 'image/x-cmu-raster', 'CMU raster', - 'image/x-pict', 'Mac PICT image', - 'image/x-portable-anymap', 'Portable anymap', - 'image/x-pnm', 'Portable anymap', - 'image/x-portable-bitmap', 'Portable bitmap', - 'image/x-pbm', 'Portable bitmap', - 'image/x-portable-graymap', 'Portable graymap', - 'image/x-pcx', 'PCX image', - 'image/x-pgm', 'Portable graymap', - 'image/x-portable-pixmap', 'Portable pixmap', - 'image/x-ppm', 'Portable pixmap', - 'image/x-rgb', 'RGB image', - 'image/x-xbitmap', 'X bitmap', - 'image/x-xbm', 'X bitmap', - 'image/x-xpixmap', 'X pixmap', - 'image/x-xpm', 'X pixmap', - 'image/x-xwindowdump', 'X window dump', - 'image/x-xwd', 'X window dump', - 'video/mpeg', 'MPEG movie', - 'video/quicktime', 'QuickTime movie', - 'video/x-msvideo', 'MS video', - 'video/x-sgi-movie', 'SGI Movie', +##----------------------------------------------------------------------- +## Content-Type Extension:Description +##----------------------------------------------------------------------- + 'application/astound', 'asd:Astound presentation', + 'application/fastman', 'lcc:fastman file', + 'application/mac-binhex40', 'hqx:Mac BinHex file', + 'application/mbedlet', 'mbd:mbedlet file', + 'application/msword', 'doc:MS-Word document', + 'application/octet-stream', 'bin:Binary data', + 'application/oda', 'oda:ODA file', + 'application/pdf', 'pdf:PDF file', + 'application/pgp', 'pgp:PGP message', + 'application/pgp-signature', 'pgp:PGP signature', + 'application/postscript', 'ps:PostScript document', + 'application/rtf', 'rtf:RTF file', + 'application/sgml', 'sgml:SGML document', + 'application/studiom', 'smp:Studio M file', + 'application/timbuktu', 'tbt:timbuktu file', + 'application/vnd.ms-excel', 'xls:MS-Excel file', + 'application/vnd.ms-powerpoint', 'ppt:MS-Powerpoint file', + 'application/vnd.ms-project', 'mpp:MS-Project file', + 'application/winhlp', 'hlp:WinHelp document', + 'application/wordperfect5.1', 'hlp:WordPerfect 5.1 document', + 'application/x-NET-Install', 'ins:Net Install file', + 'application/x-asap', 'asp:asap file', + 'application/x-bcpio', 'bcpio:BCPIO file', + 'application/x-cpio', 'cpio:CPIO file', + 'application/x-csh', 'csh:C-Shell script', + 'application/x-dot', 'dot:dot file', + 'application/x-dvi', 'dvi:TeX dvi file', + 'application/x-earthtime', 'etc:Earthtime file', + 'application/x-envoy', 'evy:Envoy file', + 'application/x-excel', 'xls:MS-Excel Spreadsheet', + 'application/x-gtar', 'gtar:GNU tar file', + 'application/x-hdf', 'hdf:HDF file', + 'application/x-javascript', 'js:JavaScript source', + 'application/x-ksh', 'ksh:Korn Shell script', + 'application/x-latex', 'latex:LaTex document', + 'application/x-maker', 'fm:FrameMake document', + 'application/x-mif', 'mif:Frame MIF document', + 'application/x-mocha', 'moc:mocha file', + 'application/x-msaccess', 'mdb:MS-Access database', + 'application/x-mscardfile', 'crd:MS-CardFile', + 'application/x-msclip', 'clp:MS-Clip file', + 'application/x-msmediaview', 'm14:MS-Media View file', + 'application/x-msmetafile', 'wmf:MS-Metafile', + 'application/x-msmoney', 'mny:MS-Money file', + 'application/x-mspublisher', 'pub:MS-Publisher document', + 'application/x-msschedule', 'scd:MS-Schedule file', + 'application/x-msterminal', 'trm:MS-Terminal', + 'application/x-mswrite', 'wri:MS-Write document', + 'application/x-netcdf', 'cdf:Cdf file', + 'application/x-ns-proxy-autoconfig','proxy:Netscape Proxy Auto Config', + 'application/x-patch', 'patch:Patch file', + 'application/x-perl', 'pl:Perl source', + 'application/x-pointplus', 'css:pointplus file', + 'application/x-salsa', 'slc:salsa file', + 'application/x-script', 'script:A script file', + 'application/x-sh', 'sh:Bourne shell script', + 'application/x-shar', 'shar:Shar file', + 'application/x-sprite', 'spr:sprite file', + 'application/x-sv4cpio', 'sv4cpio:SV4Cpio file', + 'application/x-sv4crc', 'sv4crc:SV4Crc file', + 'application/x-tar', 'tar:Tar file', + 'application/x-tcl', 'tcl:Tcl script', + 'application/x-tex', 'tex:TeX document', + 'application/x-texinfo', 'texinfo:TeXInfo document', + 'application/x-timbuktu', 'tbp:timbuktu file', + 'application/x-tkined', 'tki:tkined file', + 'application/x-troff', 'roff:Troff document', + 'application/x-troff-man', 'man:Troff manpage', + 'application/x-troff-me', 'me:Troff ME', + 'application/x-troff-ms', 'ms:Troff MS', + 'application/x-ustar', 'ustar:UStar file', + 'application/x-wais-source', 'src:WAIS Source', + 'application/zip', 'zip:Zip archive', + 'audio/basic', 'snd:Basic audio', + 'audio/echospeech', 'es:Echospeech audio', + 'audio/midi', 'midi:MIDI audio', + 'audio/x-aiff', 'aif:AIF audio', + 'audio/x-epac', 'pae:epac audio', + 'audio/x-midi', 'midi:MIDI audio', + 'audio/x-pac', 'pac:pac audio', + 'audio/x-pn-realaudio', 'ra:PN Realaudio', + 'audio/x-wav', 'wav:Wave audio', + 'image/bmp', 'bmp:Window bitmap', + 'image/cgm', 'cgm:Computer Graphics Metafile', + 'image/fif', 'fif:FIF image', + 'image/gif', 'gif:GIF image', + 'image/ief', 'ief:IEF image', + 'image/ifs', 'ifs:IFS image', + 'image/jpeg', 'jpg:JPEG image', + 'image/png', 'png:PNG image', + 'image/tiff', 'tif:TIFF image', + 'image/vnd', 'dwg:VND image', + 'image/wavelet', 'wi:Wavelet image', + 'image/x-bmp', 'bmp:Windows bitmap', + 'image/x-cmu-raster', 'ras:CMU raster', + 'image/x-pbm', 'pbm:Portable bitmap', + 'image/x-pcx', 'pcx:PCX image', + 'image/x-pgm', 'pgm:Portable graymap', + 'image/x-pict', 'pict:Mac PICT image', + 'image/x-pnm', 'pnm:Portable anymap', + 'image/x-portable-anymap', 'pnm:Portable anymap', + 'image/x-portable-bitmap', 'pbm:Portable bitmap', + 'image/x-portable-graymap', 'pgm:Portable graymap', + 'image/x-portable-pixmap', 'ppm:Portable pixmap', + 'image/x-ppm', 'ppm:Portable pixmap', + 'image/x-rgb', 'rgb:RGB image', + 'image/x-xbitmap', 'xbm:X bitmap', + 'image/x-xbm', 'xbm:X bitmap', + 'image/x-xpixmap', 'xpm:X pixmap', + 'image/x-xpm', 'xpm:X pixmap', + 'image/x-xwd', 'xwd:X window dump', + 'image/x-xwindowdump', 'xwd:X window dump', + 'text/html', 'html:HTML document', + 'text/plain', 'txt:Text document', + 'text/richtext', 'rtx:Richtext document', + 'text/setext', 'stx:Setext document', + 'text/sgml', 'sgml:SGML document', + 'text/x-html', 'html:HTML document', + 'text/x-setext', 'stx:Setext document', + 'text/x-speech', 'talk:Speech document', + 'video/isivideo', 'fvi:isi video', + 'video/mpeg', 'mpg:MPEG movie', + 'video/msvideo', 'avi:MS Video', + 'video/quicktime', 'mov:QuickTime movie', + 'video/vivo', 'viv:vivo video', + 'video/wavelet', 'wv:Wavelet video', + 'video/x-msvideo', 'avi:MS video', + 'video/x-sgi-movie', 'movie:SGI movie', + ); ##--------------------------------------------------------------------------- @@ -192,82 +184,126 @@ package m2h_external; ## Argument string may contain the following values. Each value ## should be separated by a space: ## -## inline => Inline image data with IMG element. -## usename => Use name attribute for determining name -## of derived file. Use this option with caution -## since it can lead to filename conflicts and -## security problems. +## inline Inline image data by default if +## content-disposition not defined. +## +## usename Use (file)name attribute for determining name +## of derived file. Use this option with caution +## since it can lead to filename conflicts and +## security problems. +## +## ext=ext Use `ext' as the filename extension. +## +## type="description" +## Use "description" as type description of the +## data. The double quotes are required. +## +## subdir Place derived files in a subdirectory ## sub filter { local($header, *fields, *data, $isdecode, $args) = @_; - local($ret, $filename, $nameparm); + local($ret, + $filename, + $name, + $nameparm, + $path, + $disp, + $ctype, + $type, + $ext, + $inline, + $inext, + $intype); ## Init variables - $name = ''; - $ctype = ''; - $TYPE = ''; - $ext = ''; - $inline = 0; + $name = ''; + $ctype = ''; + $type = ''; + $ext = ''; + $inline = 0; + $inext = ''; + $intype = ''; ## Get content-type - ($ctype) = $fields{'content-type'} =~ m%^\s*([\w-/]+)%; + ($ctype) = $fields{'content-type'} =~ m%^\s*([\w-\./]+)%; $ctype =~ tr/A-Z/a-z/; - ## See if name argument is to be used - ($nameparm) = $fields{'content-type'} =~ /name=(\S+)/i; - $nameparm =~ s/['";]//g; - $nameparm =~ s/.*[\/\\:]//; # Remove path component + ## Get disposition + ($disp, $nameparm) = &'MAILhead_get_disposition(*fields); + + ## Check if using name if ($args =~ /usename/i) { $name = $nameparm; + } else { + $name = ''; } - ## Check if image inlining - $inline = ($args =~ /inline/i); + ## Chech if file goes in a subdirectory + if ($args =~ /subdir/i) { + $path = join('', 'msg', $'MHAmsgnum, '.dir'); + } else { + $path = ''; + } - ## Determine filename extension - $pre = $ext = $CTExt{$ctype}; $TYPE = $CTType{$ctype}; + ## Check if inlining (images only) + if ($disp) { + $inline = ($disp =~ /inline/i); + } else { + $inline = ($args =~ /inline/i); + } + + ## Check if extension and type description passed in + if ($args =~ /ext=(\S+)/i) { $inext = $1; } + if ($args =~ /type="([^"]+)"/i) { $intype = $1; } + + ## Determine default filename extension + ($ext, $type) = split(/:/, $CTExt{$ctype}, 2); + $ext = $inext if $inext; + $type = $intype if $intype; if (!$ext) { $ext = $UnknownExt; - $TYPE = $UnknownType; + $type = "$UnknownType: $ctype"; } + $pre = $ext; + substr($pre, 3) = "" if length($pre) > 3; # Prune prefix to 3 chars ## Write file - $filename = &write_file(*data); + $filename = &write_file(*data, $path, $name, $pre, $ext); ## Create HTML markup if ($inline && ($ctype =~ /image/i)) { - $ret = join('', "

    ", - &htmlize($fields{'content-description'}), - "\n

    \n", - qq|\n|, - "

    \n"); + $ret = "

    " . &htmlize($fields{'content-description'}) . "

    \n" + if ($fields{'content-description'}); + $ret .= qq{

    \n}; + } else { - $ret = join('', "

    \n", - qq||, - &htmlize($fields{'content-description'}) || - $nameparm || $TYPE, - "

    \n"); + $ret = qq{

    } . + (&htmlize($fields{'content-description'}) || + $nameparm || $type) . + qq{

    \n}; } - ($ret, $filename); + ($ret, $path || $filename); } sub write_file { - local(*stuff) = shift; - local($fname, $tmp, $cnt) = ('', ''); + local(*stuff, $path, $fname, $pre, $ext) = @_; + local($tmp, $cnt) = ('', ''); - if ($name) { - $fname = $name; - } else { - if (!$ExtCnt{$ext}) { &set_cnt(); } + $tmp = $'OUTDIR; + if ($path) { + $tmp .= $'DIRSEP . $path; + mkdir($tmp, 0777); + } + + if (!$fname) { + if (!$ExtCnt{$ext}) { &set_cnt($tmp); } $cnt = $ExtCnt{$ext}++; $fname = $pre . sprintf("%05d.",$cnt) . $ext; + $ExtCnt{$ext} = 0 if $path; } - $tmp = $'OUTDIR . $'DIRSEP . $fname; + $tmp .= $'DIRSEP . $fname; - ## $'OUTDIR is set by MHonArc that specifies destination path - ## of filtered mail. - ## if (open(OUTFILE, "> $tmp")) { binmode(OUTFILE); # For MS-DOS print OUTFILE $stuff; @@ -275,17 +311,20 @@ sub write_file { } else { warn "Warning: Unable to create $tmp\n"; } - $fname; + $path ? $path.$'DIRSEP.$fname : $fname; } sub set_cnt { local(@files) = (); - opendir(DIR, $'OUTDIR); - @files = sort numerically grep(/^$pre\d+\.$ext$/i, readdir(DIR)); - close(DIR); - if (@files) { - ($ExtCnt{$ext}) = $files[$#files] =~ /(\d+)/; - $ExtCnt{$ext}++; + if (opendir(DIR, $_[0])) { + @files = sort numerically grep(/^$pre\d+\.$ext$/i, readdir(DIR)); + close(DIR); + if (@files) { + ($ExtCnt{$ext}) = $files[$#files] =~ /(\d+)/; + $ExtCnt{$ext}++; + } else { + $ExtCnt{$ext} = 0; + } } else { $ExtCnt{$ext} = 0; } @@ -305,4 +344,10 @@ sub htmlize { $txt; } +sub dump_ctext_hash { + foreach (sort keys %CTExt) { + print STDERR $_,":",$CTExt{$_},"\n"; + } +} + 1; diff --git a/lib/mhidxrc.pl b/lib/mhidxrc.pl new file mode 100644 index 0000000..ca57ae1 --- /dev/null +++ b/lib/mhidxrc.pl @@ -0,0 +1,430 @@ +##---------------------------------------------------------------------------## +## File: +## @(#) mhidxrc.pl 1.5 97/05/13 11:24:35 @(#) +## Author: +## Earl Hood ehood@medusa.acs.uci.edu +## Description: +## MHonArc library defining values for various index resources +##---------------------------------------------------------------------------## +## MHonArc -- Internet mail-to-HTML converter +## Copyright (C) 1996,1997 Earl Hood, ehood@medusa.acs.uci.edu +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +##---------------------------------------------------------------------------## + +##-----------------## +## Index resources ## +##-----------------## + +$IdxTypeStr = $NOSORT ? 'Message' : + $SUBSORT ? 'Subject' : + $AUTHSORT ? 'Author' : + 'Date'; +if ($MAIN) { + + ## Label for main index + unless ($IDXLABEL) { + $IDXLABEL = $IdxTypeStr . ' Index'; + $IsDefault{'IDXLABEL'} = 1; + } + + ## Beginning of main index page + unless ($IDXPGBEG) { + $IDXPGBEG =<<'EndOfStr'; + + + +$IDXTITLE$ + + +

    $IDXTITLE$

    +EndOfStr + $IsDefault{'IDXPGBEG'} = 1; + } + + ## End of main index page + unless ($IDXPGEND) { + $IDXPGEND = "\n\n"; + $IsDefault{'IDXPGEND'} = 1; + } + + ## Beginning of main index list + unless ($LIBEG) { + $LIBEG = ''; + $LIBEG .= "\n" if $THREAD; + $LIBEG .= '$PREVPGLINK$$NEXTPGLINK$' . "\n" if $MULTIIDX; + $LIBEG .= "
    \n
      \n"; + $IsDefault{'LIBEG'} = 1; + } + + ## End of main index list + unless ($LIEND) { + $LIEND = "
    \n"; + $IsDefault{'LIEND'} = 1; + } + + ## Main index entry (start, content, and end) + unless ($LITMPL) { + $LITMPL =<<'EndOfStr'; +
  • $SUBJECT$ +
    • From: $FROM$
    +
  • +EndOfStr + $IsDefault{'LITMPL'} = 1; + } + + ## Main list group resources + unless ($AUTHBEG) { + $AUTHBEG = ''; $IsDefault{'AUTHBEG'} = 1; + } + unless ($AUTHEND) { + $AUTHEND = ''; $IsDefault{'AUTHEND'} = 1; + } + unless ($DAYBEG) { + $DAYBEG = ''; $IsDefault{'DAYBEG'} = 1; + } + unless ($DAYEND) { + $DAYEND = ''; $IsDefault{'DAYEND'} = 1; + } + unless ($SUBJECTBEG) { + $SUBJECTBEG = ''; $IsDefault{'SUBJECTBEG'} = 1; + } + unless ($SUBJECTEND) { + $SUBJECTEND = ''; $IsDefault{'SUBJECTEND'} = 1; + } +} + +if ($THREAD) { + + ## Label for thread index + unless ($TIDXLABEL) { + $TIDXLABEL = 'Thread Index'; + $IsDefault{'TIDXLABEL'} = 1; + } + + ## Beginning of thread index page + unless ($TIDXPGBEG) { + $TIDXPGBEG =<<'EndOfStr'; + + + +$TIDXTITLE$ + + +

    $TIDXTITLE$

    +EndOfStr + $IsDefault{'TIDXPGBEG'} = 1; + } + ## End of thread index page + unless ($TIDXPGEND) { + $TIDXPGEND = "\n\n"; + $IsDefault{'TIDXPGEND'} = 1; + } + + ## Head of thread index page (also contains list start markup) + unless ($THEAD) { + $THEAD = ''; + $THEAD .= "\n" if $MAIN; + $THEAD .= '$TPREVPGLINK$$TNEXTPGLINK$' . "\n" if $MULTIIDX; + $THEAD .= "
    \n
      \n"; + $IsDefault{'THEAD'} = 1; + } + ## Foot of thread index page (also contains list end markup) + unless ($TFOOT) { + $TFOOT = "
    \n"; + $IsDefault{'TFOOT'} = 1; + } + + ## Template for thread entry with no follow-ups + unless ($TSINGLETXT) { + $TSINGLETXT =<<'EndOfStr'; +
  • $SUBJECT$, +$FROMNAME$
  • +EndOfStr + $IsDefault{'TSINGLETXT'} = 1; + } + + ## Template for thread entry that is the start of a thread + unless ($TTOPBEG) { + $TTOPBEG =<<'EndOfStr'; +
  • $SUBJECT$, +$FROMNAME$ +EndOfStr + $IsDefault{'TTOPBEG'} = 1; + } + ## Template for end of a thread + unless ($TTOPEND) { + $TTOPEND = "
  • \n"; + $IsDefault{'TTOPEND'} = 1; + } + + ## Template for the start of a sub-thread + unless ($TSUBLISTBEG) { + $TSUBLISTBEG = "
      \n"; + $IsDefault{'TSUBLISTBEG'} = 1; + } + ## Template for the end of a sub-thread + unless ($TSUBLISTEND) { + $TSUBLISTEND = "
    \n"; + $IsDefault{'TSUBLISTEND'} = 1; + } + + ## Template for the start and content of a regular thread entry + unless ($TLITXT) { + $TLITXT =<<'EndOfStr'; +
  • $SUBJECT$, +$FROMNAME$ +EndOfStr + $IsDefault{'TLITXT'} = 1; + } + ## Template for end of a regular thread entry + unless ($TLIEND) { + $TLIEND = "
  • \n"; + $IsDefault{'TLIEND'} = 1; + } + + ## Template for the start of subject based section + unless ($TSUBJECTBEG) { + $TSUBJECTBEG = "<Possible follow-up(s)>
    \n"; + $IsDefault{'TSUBJECTBEG'} = 1; + } + ## Template for the end of subject based section + unless ($TSUBJECTEND) { + $TSUBJECTEND = ""; + $IsDefault{'TSUBJECTEND'} = 1; + } + + ## Template for start and content of missing message in thread + unless ($TLINONE) { + $TLINONE = "
  • Message not available"; + $IsDefault{'TLINONE'} = 1; + } + ## Template for end of missing message in thread + unless ($TLINONEEND) { + $TLINONEEND = "
  • \n"; + $IsDefault{'TLINONEEND'} = 1; + } + + ## Template for opening an indent (for cross-page threads) + unless ($TINDENTBEG) { + $TINDENTBEG = "
      \n"; + $IsDefault{'TINDENTBEG'} = 1; + } + ## Template for closing an indent (for cross-page threads) + unless ($TINDENTEND) { + $TINDENTEND = "
    \n"; + $IsDefault{'TINDENTEND'} = 1; + } + + ## Template for start of a continued thread (for cross-page threads) + unless ($TCONTBEG) { + $TCONTBEG = '
  • $SUBJECTNA$, ' . + "(continued)\n"; + $IsDefault{'TCONTBEG'} = 1; + } + ## Template for end of a continued thread (for cross-page threads) + unless ($TCONTEND) { + $TCONTEND = "
  • \n"; + $IsDefault{'TCONTEND'} = 1; + } + + $DoMissingMsgs = $TLINONE =~ /\S/; + +} + +##-------------------## +## Message resources ## +##-------------------## + +## Beginning of message page +unless ($MSGPGBEG) { + $MSGPGBEG =<<'EndOfStr'; + + + +$SUBJECTNA:72$ + + + +EndOfStr + $IsDefault{'MSGPGBEG'} = 1; +} + +## End of message page +unless ($MSGPGEND) { + $MSGPGEND = "\n\n"; + $IsDefault{'MSGPGEND'} = 1; +} + +## Subject header +unless ($SUBJECTHEADER) { + $SUBJECTHEADER = '

    $SUBJECTNA$

    ' . "\n
    \n"; + $IsDefault{'SUBJECTHEADER'} = 1; +} + +## Separator between message data head and message data body +unless ($HEADBODYSEP) { + $HEADBODYSEP = "
    \n"; + $IsDefault{'HEADBODYSEP'} = 1; +} + +##---------------------------------## +## Mail header formating resources ## +##---------------------------------## + +$FIELDSBEG = "
      \n", $IsDefault{'FIELDSBEG'} = 1 unless $FIELDSBEG; +$FIELDSEND = "
    \n", $IsDefault{'FIELDSEND'} = 1 unless $FIELDSEND; +$LABELBEG = "
  • ", $IsDefault{'LABELBEG'} = 1 unless $LABELBEG; +$LABELEND = ":", $IsDefault{'LABELEND'} = 1 unless $LABELEND; +$FLDBEG = " ", $IsDefault{'FLDBEG'} = 1 unless $FLDBEG; +$FLDEND = "
  • ", $IsDefault{'FLDEND'} = 1 unless $FLDEND; + +##-----------------------------------## +## Next/prev message link resources ## +##-----------------------------------## + +## Next/prev buttons +$NEXTBUTTON = '['.$IdxTypeStr.' Next]', + $IsDefault{'NEXTBUTTON'} = 1 unless $NEXTBUTTON; +$PREVBUTTON = '['.$IdxTypeStr.' Prev]', + $IsDefault{'PREVBUTTON'} = 1 unless $PREVBUTTON; +$NEXTBUTTONIA = "[$IdxTypeStr Next]", + $IsDefault{'NEXTBUTTONIA'} = 1 unless $NEXTBUTTONIA; +$PREVBUTTONIA = "[$IdxTypeStr Prev]", + $IsDefault{'PREVBUTTONIA'} = 1 unless $PREVBUTTONIA; + +## Next message link +unless ($NEXTLINK) { + $NEXTLINK =<Next by $IdxTypeStr: +\$NEXTSUBJECT\$ + +EndOfStr + $IsDefault{'NEXTLINK'} = 1; +} + +## Inactive next message link +$NEXTLINKIA = '', $IsDefault{'NEXTLINKIA'} = 1 unless $NEXTLINKIA; + +## Previous message link +unless ($PREVLINK) { + $PREVLINK =<Prev by $IdxTypeStr: +\$PREVSUBJECT\$ + +EndOfStr + $IsDefault{'PREVLINK'} = 1; +} + +## Inactive previous message link +$PREVLINKIA = '', $IsDefault{'PREVLINKIA'} = 1 unless $PREVLINKIA; + +## Thread next/previous buttons +$TNEXTBUTTON = '[Thread Next]', + $IsDefault{'TNEXTBUTTON'} = 1 unless $TNEXTBUTTON; +$TPREVBUTTON = '[Thread Prev]', + $IsDefault{'TPREVBUTTON'} = 1 unless $TPREVBUTTON; +$TNEXTBUTTONIA = '[Thread Next]', + $IsDefault{'TNEXTBUTTONIA'} = 1 unless $TNEXTBUTTONIA; +$TPREVBUTTONIA = '[Thread Prev]', + $IsDefault{'TPREVBUTTONIA'} = 1 unless $TPREVBUTTONIA; + +## Next message in thread link +unless ($TNEXTLINK) { + $TNEXTLINK =<<'EndOfStr'; +
  • Next by thread: +$TNEXTSUBJECT$ +
  • +EndOfStr + $IsDefault{'TNEXTLINK'} = 1; +} + +## Inactive next message in thread link +$TNEXTLINKIA = '', $IsDefault{'TNEXTLINKIA'} = 1 unless $TNEXTLINKIA; + +## Previous message in thread link +unless ($TPREVLINK) { + $TPREVLINK =<<'EndOfStr'; +
  • Prev by thread: +$TPREVSUBJECT$ +
  • +EndOfStr + $IsDefault{'TPREVLINK'} = 1; +} + +## Inactive previous message in thread link +$TPREVLINKIA = '', $IsDefault{'TPREVLINKIA'} = 1 unless $TPREVLINKIA; + +## Top links in message +if (!$TOPLINKS) { + $TOPLINKS = "
    \n"; + $TOPLINKS .= '$PREVBUTTON$$NEXTBUTTON$' + if $MAIN; + $TOPLINKS .= '$TPREVBUTTON$$TNEXTBUTTON$' + if $THREAD; + $TOPLINKS .= '[$IDXLABEL$]' + if $MAIN; + $TOPLINKS .= '[$TIDXLABEL$]' + if $THREAD; + $IsDefault{'TOPLINKS'} = 1; +} + +## Bottom links in message +if (!$BOTLINKS) { + $BOTLINKS = "
    \n
      \n"; + $BOTLINKS .= '$PREVLINK$$NEXTLINK$' if $MAIN; + $BOTLINKS .= '$TPREVLINK$$TNEXTLINK$' if $THREAD; + if ($MAIN || $THREAD) { + $BOTLINKS .= "
    • Index(es):\n\n
    • \n
    \n"; + $IsDefault{'BOTLINKS'} = 1; +} + +##--------------------------------------------## +## Next/previous main/thread index page links ## +##--------------------------------------------## + +$NEXTPGLINK = '[Next Page]', + $IsDefault{'NEXTPGLINK'} = 1 unless $NEXTPGLINK; +$PREVPGLINK = '[Prev Page]', + $IsDefault{'PREVPGLINK'} = 1 unless $PREVPGLINK; +$TNEXTPGLINK = '[Next Page]', + $IsDefault{'TNEXTPGLINK'} = 1 unless $TNEXTPGLINK; +$TPREVPGLINK = '[Prev Page]', + $IsDefault{'TPREVPGLINK'} = 1 unless $TPREVPGLINK; + +$NEXTPGLINKIA = '[Next Page]', + $IsDefault{'NEXTPGLINKIA'} = 1 unless $NEXTPGLINKIA; +$PREVPGLINKIA = '[Prev Page]', + $IsDefault{'PREVPGLINKIA'} = 1 unless $PREVPGLINKIA; +$TNEXTPGLINKIA = '[Next Page]', + $IsDefault{'TNEXTPGLINKIA'} = 1 unless $TNEXTPGLINKIA; +$TPREVPGLINKIA = '[Prev Page]', + $IsDefault{'TPREVPGLINKIA'} = 1 unless $TPREVPGLINKIA; + +## Set unknown icon +$Icons{'unknown'} = $Icons{'text/plain'} unless $Icons{'unknown'}; + +##---------------------------------------------------------------------------## +1; diff --git a/lib/mhinit.pl b/lib/mhinit.pl index 7655e2f..a6ffd8c 100644 --- a/lib/mhinit.pl +++ b/lib/mhinit.pl @@ -1,15 +1,13 @@ ##---------------------------------------------------------------------------## ## File: -## mhinit.pl +## @(#) mhinit.pl 1.18 97/05/13 11:25:03 @(#) ## Author: -## Earl Hood ehood@isogen.com -## Date: -## Fri Jul 12 08:13:02 CDT 1996 +## Earl Hood ehood@medusa.acs.uci.edu ## Description: ## Initialization stuff for MHonArc. ##---------------------------------------------------------------------------## ## MHonArc -- Internet mail-to-HTML converter -## Copyright (C) 1995,1996 Earl Hood, ehood@isogen.com +## Copyright (C) 1995-1997 Earl Hood, ehood@medusa.acs.uci.edu ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -26,12 +24,13 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ##---------------------------------------------------------------------------## -package main; - ##---------------------------------------------------------------------------## + ## The %Zone array should be augmented to contain all timezone ## specifications with the positive/negative hour offset from UTC ## (GMT). (There has got to be a better way to handle timezones) +## Array can be augmented/overridden via the resource file. + %Zone = ( "UTC", 0, # Universal Coordinated Time "GMT", 0, # Greenwich Mean Time @@ -46,76 +45,110 @@ package main; "PST", 8, # Pacific Standard Time "PDT", 7, # Pacific Daylight Time ); + ## Assoc array listing mail header fields to exclude in output. ## Each key is treated as a regular expression with '^' prepended ## to it. + %HFieldsExc = ( 'content-', 1, # Mime headers 'errors-to', 1, 'forward', 1, # Forward lines (MH may add these) 'lines', 1, 'message-id', 1, - 'mime-', 1, # Mime headers + 'mime-', 1, # Mime headers 'nntp-', 1, 'originator', 1, 'path', 1, 'precedence', 1, 'received', 1, # MTA added headers - 'replied', 1, - 'return-path', 1, # MH creates this during inc + 'replied', 1, # Replied lines (MH may add these) + 'return-path', 1, # MH/MTA header 'status', 1, 'via', 1, - 'x-', 1, # Non-standard headers + 'x-', 1, # Non-standard headers ); + ## Asocc arrays defining HTML formats to apply to header fields + %HeadFields = ( - "-default-", "", + "-default-", "", # Nothing ); %HeadHeads = ( - "-default-", "em", + "-default-", "em", # Empasize field labels ); -@FieldOrder = ( +@FieldOrder = ( # Order fields are listed 'to', 'subject', 'from', 'date', '-extra-', ); -%FieldODefs = ( +%FieldODefs = ( # Fields not to slurp up in "-extra-" 'to', 1, 'subject', 1, 'from', 1, 'date', 1, ); + +## Message information variables + $NumOfMsgs = 0; # Total number of messages $LastMsgNum = -1; # Message number of last message -%Message = (); # Message bodies -%MsgHead = (); # Message heads +%Message = (); # Message indexes to bodies +%MsgHead = (); # Message indexes to heads %MsgHtml = (); # Flag if message is html -%Subject = (); # Message subjects -%From = (); # Message froms -%Date = (); # Message dates -%MsgId = (); # Message Ids to indexes +%Subject = (); # Message indexes to subjects +%From = (); # Message indexes to froms +%Date = (); # Message indexes to dates +%MsgId = (); # Message ids to indexes +%NewMsgId = (); # New message ids to indexes %IndexNum = (); # Index key to message number -%Derived = (); # Derived files for messages -%Refs = (); # Message references -%Follow = (); # Message follow-ups -%FolCnt = (); # Number of follow-ups -%ContentType = (); # Base content-type of messages -%Icons = (); # Icon URLs for content-types +%Derived = (); # Index key to derived files for message +%Refs = (); # Index key to message references +%Follow = (); # Index key to follow-ups +%FolCnt = (); # Index key to number of follow-ups +%ContentType = (); # Index key to base content-type of message +%Icons = (); # Index key to icon URL for content-type %AddIndex = (); # Flags for messages that must be written -$bs = "\b"; -$Url = '(http://|ftp://|afs://|wais://|telnet://|gopher://|' . - 'news:|nntp:|mid:|cid:|mailto:|prospero:)'; -$MLCP = 0; -$ISLOCK = 0; -$SLOW = 0; -## Get date -$curdate = &getdate(0); -$locdate = &getdate(1); +@MListOrder = (); # List of indexes in order printed on main index +@TListOrder = (); # List of indexes in order printed on thread index +%Index2Tloc = (); # Map index to position in thread index +%Index2Mloc = (); # Map index to position in main index + +%UDerivedFile = (); # Key = filename template. Value = content template + +## Following variables used in thread computation + +@ThreadList = (); # List of messages visible in thread index +@NotIdxThreadList + = (); # List of messages not visible in index +%HasRef = (); # Flags if message has references (Keys = indexes) + # (Values = reference message indexes) +%HasRefDepth = (); # Depth of reference from HasRef value +%Replies = (); # Msg-ids of explicit replies (Keys = indexes) +%SReplies = (); # Msg-ids of subject-based replies (Keys = indexes) +%TVisible = (); # Message visible in thread index (Keys = indexes) +$DoMissingMsgs = 0; # Flag is missing messages should be noted in index + +## Some miscellaneous variables + +%IsDefault = (); # Flags if certain resources are the default + +$bs = "\b"; # Used as a separator +$Url = '(http://|https://|ftp://|afs://|wais://|telnet://|' . + 'gopher://|news:|nntp:|mid:|cid:|mailto:|prospero:)'; +$MLCP = 0; # Main index contains included files flag +$SLOW = 0; # Save memory flag +$NumOfPages = 0; # Number of index pages +$IdxMinPg = -1; # Starting page of index for updating +$TIdxMinPg = -1; # Starting page of thread index for updating +$DBPathName = ''; # Full pathname of database file +$DefRcName = ($MSDOS ? "mhonarc.rc" : ".mhonarc.rc"); ## Set default filter libraries + @Requires = ( "mhexternal.pl", @@ -125,66 +158,22 @@ package main; ); +@CharSetRequires = ( + + "iso8859.pl", + +); + +##---------------------------------------------------------------------- +## BEGIN readmail.pl variable settings +##---------------------------------------------------------------------- ## Default filters -%MIMEFilters = ( - - "application/mac-binhex40", "m2h_external'filter", - "application/octet-stream", "m2h_external'filter", - "application/oda", "m2h_external'filter", - "application/pdf", "m2h_external'filter", - "application/postscript", "m2h_external'filter", - "application/rtf", "m2h_external'filter", - "application/x-bcpio", "m2h_external'filter", - "application/x-cpio", "m2h_external'filter", - "application/x-csh", "m2h_external'filter", - "application/x-dvi", "m2h_external'filter", - "application/x-gtar", "m2h_external'filter", - "application/x-hdf", "m2h_external'filter", - "application/x-latex", "m2h_external'filter", - "application/x-mif", "m2h_external'filter", - "application/x-netcdf", "m2h_external'filter", +## +%main'MIMEFilters = ( + + # Content-type Filter + #------------------------------------------------------------------- "application/x-patch", "m2h_text_plain'filter", - "application/x-sh", "m2h_external'filter", - "application/x-shar", "m2h_external'filter", - "application/x-sv4cpio", "m2h_external'filter", - "application/x-sv4crc", "m2h_external'filter", - "application/x-tar", "m2h_external'filter", - "application/x-tcl", "m2h_external'filter", - "application/x-tex", "m2h_external'filter", - "application/x-texinfo", "m2h_external'filter", - "application/x-troff", "m2h_external'filter", - "application/x-troff-man", "m2h_external'filter", - "application/x-troff-me", "m2h_external'filter", - "application/x-troff-ms", "m2h_external'filter", - "application/x-ustar", "m2h_external'filter", - "application/x-wais-source", "m2h_external'filter", - "application/zip", "m2h_external'filter", - "audio/basic", "m2h_external'filter", - "audio/x-aiff", "m2h_external'filter", - "audio/x-wav", "m2h_external'filter", - "image/gif", "m2h_external'filter", - "image/ief", "m2h_external'filter", - "image/jpeg", "m2h_external'filter", - "image/tiff", "m2h_external'filter", - "image/x-bmp", "m2h_external'filter", - "image/x-cmu-raster", "m2h_external'filter", - "image/x-pbm", "m2h_external'filter", - "image/x-pcx", "m2h_external'filter", - "image/x-pgm", "m2h_external'filter", - "image/x-pict", "m2h_external'filter", - "image/x-pnm", "m2h_external'filter", - "image/x-portable-anymap", "m2h_external'filter", - "image/x-portable-bitmap", "m2h_external'filter", - "image/x-portable-graymap", "m2h_external'filter", - "image/x-portable-pixmap", "m2h_external'filter", - "image/x-ppm", "m2h_external'filter", - "image/x-rgb", "m2h_external'filter", - "image/x-xbitmap", "m2h_external'filter", - "image/x-xbm", "m2h_external'filter", - "image/x-xpixmap", "m2h_external'filter", - "image/x-xpm", "m2h_external'filter", - "image/x-xwd", "m2h_external'filter", - "image/x-xwindowdump", "m2h_external'filter", "message/partial", "m2h_text_plain'filter", "text/html", "m2h_text_html'filter", "text/plain", "m2h_text_plain'filter", @@ -193,60 +182,188 @@ package main; "text/tab-separated-values", "m2h_text_plain'filter", "text/x-html", "m2h_text_html'filter", "text/x-setext", "m2h_text_setext'filter", - "video/mpeg", "m2h_external'filter", - "video/quicktime", "m2h_external'filter", - "video/x-msvideo", "m2h_external'filter", - "video/x-sgi-movie", "m2h_external'filter", + + "application/*", "m2h_external'filter", + "audio/*", "m2h_external'filter", + "image/*", "m2h_external'filter", + "text/*", "m2h_text_plain'filter", + "video/*", "m2h_external'filter", + + # Nead to add to list if more base types are registered. ); ## Default filter arguments -%MIMEFiltersArgs = ( +## +%main'MIMEFiltersArgs = ( + + # Content-type Arguments + #------------------------------------------------------------------- + "image/gif", "inline", + "image/jpeg", "inline", + "image/x-xbitmap", "inline", + "image/x-xbm", "inline", - "image/gif", "inline", - "image/x-xbitmap", "inline", - "image/x-xbm", "inline", ); +## Charset filters +## +%main'MIMECharSetConverters = ( + + # Character set Converter Function + #------------------------------------------------------------------- + "plain", "main'convert_line", + "us-ascii", "main'convert_line", + "iso-8859-1", "iso_8859'str2sgml", + "iso-8859-2", "iso_8859'str2sgml", + "iso-8859-3", "iso_8859'str2sgml", + "iso-8859-4", "iso_8859'str2sgml", + "iso-8859-5", "iso_8859'str2sgml", + "iso-8859-6", "iso_8859'str2sgml", + "iso-8859-7", "iso_8859'str2sgml", + "iso-8859-8", "iso_8859'str2sgml", + "iso-8859-9", "iso_8859'str2sgml", + "iso-8859-10", "iso_8859'str2sgml", + + "default", "-ignore-", + +); +##------------------------------------------------------------------------ +## END readmail.pl variable settings +##------------------------------------------------------------------------ + +## Variable to hold function for converting message header text. +$MHeadCnvFunc = "convert_line"; + +## Regexp for variable detection +$VarExp = '\$([^\$]*)\$'; + +## Regexp for address/msg-id detection +$AddrExp = q%[^()<>@,;:\/\s"'&|]+@[^()<>@,;:\/\s"'&|]+%; + ## Grab environment variable settings ## -$DBFILE = ($ENV{'M2H_DBFILE'} ? $ENV{'M2H_DBFILE'} : - ($MSDOS ? "mhonarc.db" : ".mhonarc.db")); -$DOCURL = ($ENV{'M2H_DOCURL'} ? $ENV{'M2H_DOCURL'} : - 'http://www.oac.uci.edu/indiv/ehood/mhonarc.html'); -$FOOTER = ($ENV{'M2H_FOOTER'} ? $ENV{'M2H_FOOTER'} : ""); -$HEADER = ($ENV{'M2H_HEADER'} ? $ENV{'M2H_HEADER'} : ""); -$IDXNAME = ($ENV{'M2H_IDXFNAME'} ? $ENV{'M2H_IDXFNAME'} : - "maillist.html"); -$IDXSIZE = ($ENV{'M2H_IDXSIZE'} ? $ENV{'M2H_IDXSIZE'} : ""); -$TIDXNAME = ($ENV{'M2H_TIDXFNAME'} ? $ENV{'M2H_TIDXFNAME'} : - "threads.html"); -$OUTDIR = ($ENV{'M2H_OUTDIR'} ? $ENV{'M2H_OUTDIR'} : $CURDIR); -$FMTFILE = ($ENV{'M2H_RCFILE'} ? $ENV{'M2H_RCFILE'} : ""); -$TTITLE = ($ENV{'M2H_TTITLE'} ? $ENV{'M2H_TTITLE'} : - "Mail Thread Index"); -$TITLE = ($ENV{'M2H_TITLE'} ? $ENV{'M2H_TITLE'} : "Mail Index"); -$MAILTOURL = ($ENV{'M2H_MAILTOURL'} ? $ENV{'M2H_MAILTOURL'} : ""); -$FROM = ($ENV{'M2H_MSGSEP'} ? $ENV{'M2H_MSGSEP'} : '^From '); -$LOCKFILE = ($ENV{'M2H_LOCKFILE'} ? $ENV{'M2H_LOCKFILE'} : - ($MSDOS ? "mhonarc.lck" : ".mhonarc.lck")); -$LOCKTRIES = ($ENV{'M2H_LOCKTRIES'} ? $ENV{'M2H_LOCKTRIES'} : 10); -$LOCKDELAY = ($ENV{'M2H_LOCKDELAY'} ? $ENV{'M2H_LOCKDELAY'} : 3); -$MAXSIZE = ($ENV{'M2H_MAXSIZE'} ? $ENV{'M2H_MAXSIZE'} : ""); -$THREAD = (defined($ENV{'M2H_THREAD'}) ? $ENV{'M2H_THREAD'} : 1); -$TLEVELS = ($ENV{'M2H_TLEVELS'} ? $ENV{'M2H_TLEVELS'} : 3); +$DBFILE = $ENV{'M2H_DBFILE'} || ($MSDOS? "mhonarc.db": ".mhonarc.db"); +$DOCURL = $ENV{'M2H_DOCURL'} || + 'http://www.oac.uci.edu/indiv/ehood/mhonarc.html'; +$FOOTER = $ENV{'M2H_FOOTER'} || ""; +$HEADER = $ENV{'M2H_HEADER'} || ""; +$IDXNAME = $ENV{'M2H_IDXFNAME'} || "maillist.html"; +$IDXPREFIX = $ENV{'M2H_IDXPREFIX'} || "mail"; +$TIDXPREFIX= $ENV{'M2H_TIDXPREFIX'} || "thrd"; +$IDXSIZE = $ENV{'M2H_IDXSIZE'} || ""; +$TIDXNAME = $ENV{'M2H_TIDXFNAME'} || "threads.html"; +$OUTDIR = $ENV{'M2H_OUTDIR'} || $CURDIR; +$FMTFILE = $ENV{'M2H_RCFILE'} || ""; +$TTITLE = $ENV{'M2H_TTITLE'} || "Mail Thread Index"; +$TITLE = $ENV{'M2H_TITLE'} || "Mail Index"; +$MAILTOURL = $ENV{'M2H_MAILTOURL'} || ""; +$FROM = $ENV{'M2H_MSGSEP'} || '^From '; +$LOCKFILE = $ENV{'M2H_LOCKFILE'} || ($MSDOS? "mhonarc.lck": ".mhonarc.lck"); +$LOCKTRIES = $ENV{'M2H_LOCKTRIES'} || 10; +$LOCKDELAY = $ENV{'M2H_LOCKDELAY'} || 3; +$MAXSIZE = $ENV{'M2H_MAXSIZE'} || ""; +$TLEVELS = $ENV{'M2H_TLEVELS'} || 3; +$MHPATTERN = $ENV{'M2H_MHPATTERN'} || '^\d+$'; +$DefRcFile = $ENV{'M2H_DEFRCFILE'} || ''; + +$GMTDateFmt = $ENV{'M2H_GMTDATEFMT'} || ''; +$LocalDateFmt = $ENV{'M2H_LOCALDATEFMT'} || ''; +$ExpireDate = $ENV{'M2H_EXPIREDATE'} || ''; + $ExpireDateTime = 0; +$ExpireTime = $ENV{'M2H_EXPIREAGE'} || 0; + +$MsgGMTDateFmt = $ENV{'M2H_MSGGMTDATEFMT'} || ''; +$MsgLocalDateFmt= $ENV{'M2H_MSGLOCALDATEFMT'} || ''; + +$CONLEN = defined($ENV{'M2H_CONLEN'}) ? $ENV{'M2H_CONLEN'} : 0; +$MAIN = defined($ENV{'M2H_MAIN'}) ? $ENV{'M2H_MAIN'} : 1; +$MULTIIDX = defined($ENV{'M2H_MULTIPG'}) ? $ENV{'M2H_MULTIPG'} : 0; +$MODTIME = defined($ENV{'M2H_MODTIME'}) ? $ENV{'M2H_MODTIME'} : 0; +$NODOC = defined($ENV{'M2H_DOC'}) ? !$ENV{'M2H_DOC'} : 0; +$NOMAILTO = defined($ENV{'M2H_MAILTO'}) ? !$ENV{'M2H_MAILTO'} : 0; +$NONEWS = defined($ENV{'M2H_NEWS'}) ? !$ENV{'M2H_NEWS'} : 0; +$NOSORT = defined($ENV{'M2H_SORT'}) ? !$ENV{'M2H_SORT'} : 0; +$NOURL = defined($ENV{'M2H_URL'}) ? !$ENV{'M2H_SORT'} : 0; +$REVSORT = defined($ENV{'M2H_REVSORT'}) ? $ENV{'M2H_REVSORT'} : 0; +$SUBSORT = defined($ENV{'M2H_SUBSORT'}) ? $ENV{'M2H_SUBSORT'} : 0; +$AUTHSORT = defined($ENV{'M2H_AUTHSORT'}) ? $ENV{'M2H_AUTHSORT'} : 0; +$THREAD = defined($ENV{'M2H_THREAD'}) ? $ENV{'M2H_THREAD'} : 1; +$TREVERSE = defined($ENV{'M2H_TREVERSE'}) ? $ENV{'M2H_TREVERSE'} : 0; + +if ($UNIX) { + eval q/ + $UMASK = defined($ENV{'M2H_UMASK'}) ? + $ENV{'M2H_UMASK'} : sprintf("%o",umask); + /; +} +$DecodeHeads = defined($ENV{'M2H_DECODEHEADS'}) ? $ENV{'M2H_DECODEHEADS'} : 0; +$DoFolRefs = defined($ENV{'M2H_FOLREFS'}) ? $ENV{'M2H_FOLREFS'} : 1; + +@OtherIdxs = defined($ENV{'M2H_OTHERINDEXES'}) ? + split(/:/, $ENV{'M2H_OTHERINDEXES'}) : (); +@PerlINC = defined($ENV{'M2H_PERLINC'}) ? + split(/:/, $ENV{'M2H_PERLINC'}) : (); + +## Arrays for months and weekdays. If empty, the default settings +## in mhtime.pl are used. + +@Months = $ENV{'M2H_MONTHS'} ? split(/:/, $ENV{'M2H_MONTHS'}) : (); +@months = $ENV{'M2H_MONTHSABR'} ? split(/:/, $ENV{'M2H_MONTHSABR'}) : (); +@Weekdays = $ENV{'M2H_WEEKDAYS'} ? split(/:/, $ENV{'M2H_WEEKDAYS'}) : (); +@weekdays = $ENV{'M2H_WEEKDAYSABR'} ? split(/:/, $ENV{'M2H_WEEKDAYSABR'}) : (); + +## Many of the following are set during runtime after the +## database has been read. The variables are listed here +## as a quick reference. +## +$IDXLABEL = ''; # Label for main index $LIBEG = ''; # List open template for main index $LIEND = ''; # List close template for main index $LITMPL = ''; # List item template -$TFOOT = ''; # Thread index footer +$AUTHBEG = ''; # Begin of author group +$AUTHEND = ''; # End of author group +$DAYBEG = ''; # Begin of a day group +$DAYEND = ''; # End of a day group +$SUBJECTBEG = ''; # Begin of subject group +$SUBJECTEND = ''; # End of subject group + +$TIDXLABEL = ''; # Label for thread index $THEAD = ''; # Thread index header -$TLITXT = ''; # Thread index list item template +$TFOOT = ''; # Thread index footer +$TLISTBEG = ''; # Thread list open +$TLISTEND = ''; # Thread list close +$TSINGLETXT = ''; # Single/lone thread entry template +$TTOPBEG = ''; # Top of a thread begin template +$TTOPEND = ''; # Top of a thread end template +$TSUBLISTBEG = ''; # Sub-thread list open +$TSUBLISTEND = ''; # Sub-thread list close +$TLITXT = ''; # Thread list item text +$TLIEND = ''; # Thread list item end +$TLINONE = ''; # List item for missing message in thread +$TLINONEEND = ''; # List item end for missing message in thread +$TSUBJECTBEG = ''; # Pre-text for subject-based items +$TSUBJECTEND = ''; # Post-text for subject-based items +$TINDENTBEG = ''; # Thread indent open +$TINDENTEND = ''; # Thread indent close +$TCONTBEG = ''; # Thread continue open +$TCONTEND = ''; # Thread continue close $MSGFOOT = ''; # Message footer $MSGHEAD = ''; # Message header $TOPLINKS = ''; # Message links at top of message $BOTLINKS = ''; # Message links at bottom of message +$SUBJECTHEADER = ''; # Markup for message main subject line +$HEADBODYSEP = ''; # Markup between mail header and body + +$FIELDSBEG = ''; # Beginning markup for mail header +$FIELDSEND = ''; # End markup for mail header +$FLDBEG = ''; # Beginning markup for field text +$FLDEND = ''; # End markup for field text +$LABELBEG = ''; # Beginning markup for field label +$LABELEND = ''; # End markup for field label + $NEXTBUTTON = ''; # Next button template $NEXTBUTTONIA = ''; # Next inactive button template $PREVBUTTON = ''; # Previous button template @@ -256,6 +373,15 @@ package main; $PREVLINK = ''; # Previous link template $PREVLINKIA = ''; # Previous inactive link template +$TNEXTBUTTON = ''; # Thread Next button template +$TNEXTBUTTONIA = ''; # Thread Next inactive button template +$TPREVBUTTON = ''; # Thread Previous button template +$TPREVBUTTONIA = ''; # Thread Previous inactive button template +$TNEXTLINK = ''; # Thread Next link template +$TNEXTLINKIA = ''; # Thread Next inactive link template +$TPREVLINK = ''; # Thread Previous link template +$TPREVLINKIA = ''; # Thread Previous inactive link template + $IDXPGBEG = ''; # Beginning of main index page $IDXPGEND = ''; # Ending of main index page $TIDXPGBEG = ''; # Beginning of thread index page @@ -264,27 +390,24 @@ package main; $MSGPGBEG = ''; # Beginning of message page $MSGPGEND = ''; # Ending of message page -# $PREVBL = '[Prev]'; # No longer used -# $NEXTBL = '[Next]'; # No longer used -# $IDXBL = '[Index]'; # No longer used -# $TIDXBL = '[Thread]'; # No longer used +$NEXTPGLINK = ''; # Next page link template +$NEXTPGLINKIA = ''; # Next page inactive link template +$PREVPGLINK = ''; # Previous page link template +$PREVPGLINKIA = ''; # Previous page inactive link template -# $PREVFL = 'Prev'; # No longer used -# $NEXTFL = 'Next'; # No longer used -# $IDXFL = 'Index'; # No longer used -# $TIDXFL = 'Thread'; # No longer used +$TNEXTPGLINK = ''; # Thread next page link template +$TNEXTPGLINKIA = ''; # Thread next page inactive link template +$TPREVPGLINK = ''; # Thread previous page link template +$TPREVPGLINKIA = ''; # Thread previous page inactive link template -## Init some flags -## -$NOSORT = 0; $REVSORT = 0; $NONEWS = 0; $TREVERSE = 0; -$NOMAILTO = 0; $NOURL = 0; $SUBSORT = 0; $NODOC = 0; -$TSUBSORT = 0; -$UMASK = sprintf("%o",umask) if $UNIX; +## The following associative array if for defining custom +## resource variables +%CustomRcVars = (); $X = "\034"; # Value separator (should equal $;) # NOTE: Older versions used this variable for # the multiple field separator in parsed - # message headers. $'FieldSep should + # message headers. $readmail'FieldSep should # now be used (readmail.pl). ##---------------------------------------------------------------------------## diff --git a/lib/mhrcfile.pl b/lib/mhrcfile.pl new file mode 100644 index 0000000..2e48811 --- /dev/null +++ b/lib/mhrcfile.pl @@ -0,0 +1,817 @@ +##---------------------------------------------------------------------------## +## File: +## @(#) mhrcfile.pl 1.12 97/05/13 11:25:35 @(#) +## Author: +## Earl Hood ehood@medusa.acs.uci.edu +## Description: +## Routines for parsing resource files +##---------------------------------------------------------------------------## +## MHonArc -- Internet mail-to-HTML converter +## Copyright (C) 1996 Earl Hood, ehood@medusa.acs.uci.edu +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +##---------------------------------------------------------------------------## + +$RcFileHandleCnt = 0; + +##--------------------------------------------------------------------------- +## read_fmt_file() parses the resource file. The name is misleading. +## (The code for this routine could probably be simplified). +## +sub read_fmt_file { + local($file) = shift; + local($line, $tag, $label, $acro, $hr, $type, $routine, $plfile, + $url, $arg, $tmp, @a); + local($elem, $attr, $override, $handle, $pathhead, $chop); + + $handle = 'FMT' . $RcFileHandleCnt++; + if (!open($handle, $file)) { + warn "Warning: Unable to open resource file: $file\n"; + return 0; + } + if ($file =~ m%(.*[$'DIRSEPREX])%o) { + $pathhead = $1; + } else { + $pathhead = ''; + } + + print STDOUT "Reading resource file: $file ...\n" unless $QUIET; + while ($line = <$handle>) { + next unless $line =~ /^\s*<([^>]+)>/; + ($elem, $attr) = split(' ', $1, 2); + $elem =~ tr/A-Z/a-z/; + $override = ($attr =~ /override/i); + $chop = ($attr =~ /chop/i); + + FMTSW: { + if ($elem eq "authorbegin") { # Begin for author group + $AUTHBEG = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "authorend") { # End for author group + $AUTHEND = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "authsort") { # Sort msgs by author + $AUTHSORT = 1; + $NOSORT = 0; $SUBSORT = 0; + last FMTSW; + } + if ($elem eq "botlinks") { # Bottom links in message + $BOTLINKS = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "charsetconverters") { # Charset filters + @CharSetRequires = (), %'MIMECharSetConverters = () + if $override; + while ($line = <$handle>) { + last if $line =~ /^\s*<\/charsetconverters\s*>/i; + next if $line =~ /^\s*$/; + $line =~ s/\s//g; + ($type,$routine,$plfile) = split(/:/,$line,3); + $type =~ tr/A-Z/a-z/; + $'MIMECharSetConverters{$type} = $routine; + push(@CharSetRequires, $plfile) if $plfile =~ /\S/; + } + last FMTSW; + } + if ($elem eq "conlen") { + $CONLEN = 1; last FMTSW; + } + if ($elem eq "daybegin") { # Begin for day group + $DAYBEG = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "dayend") { # End for day group + $DAYEND = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "decodeheads") { + $DecodeHeads = 1; last FMTSW; + } + if ($elem eq "definederived") { # Custom derived file + %UDerivedFile = () if $override; + $line = <$handle>; + last FMTSW if $line =~ /^\s*<\/definederived\s*>/i; + $line =~ s/\s//g; + $UDerivedFile{$line} = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "definevar") { # Custom resource variable + @CustomRcVars = () if $override; + $line = <$handle>; + last FMTSW if $line =~ /^\s*<\/definevar\s*>/i; + $line =~ s/\s//g; + $CustomRcVars{$line} = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "doc") { # Link to documentation + $NODOC = 0; last FMTSW; + } + if ($elem eq "docurl") { # Doc URL + if ($line = &get_elem_last_line($handle, $elem)) { + $DOCURL = $line; + } + last FMTSW; + } + if ($elem eq "dbfile") { # Database file + if ($line = &get_elem_last_line($handle, $elem)) { + $line =~ s/\s//g; + $DBFILE = $line; + } + last FMTSW; + } + if ($elem eq "excs") { # Exclude header fields + %HFieldsExc = () if $override; + while ($line = <$handle>) { + last if $line =~ /^\s*<\/excs\s*>/i; + $line =~ s/\s//g; $line =~ tr/A-Z/a-z/; + $HFieldsExc{$line} = 1 if $line; + } + last FMTSW; + } + if ($elem eq "expireage") { # Time in seconds until expire + if (($tmp = &get_elem_int($handle, $elem, 1)) ne '') { + $ExpireTime = $tmp; + } + last FMTSW; + } + if ($elem eq "expiredate") { # Expiration date + if ($line = &get_elem_last_line($handle, $elem)) { + $ExpireDate = $line; + } + last FMTSW; + } + if ($elem eq "fieldstyles") { # Field text style + while ($line = <$handle>) { + last if $line =~ /^\s*<\/fieldstyles\s*>/i; + next if $line =~ /^\s*$/; + $line =~ s/\s//g; $line =~ tr/A-Z/a-z/; + ($label, $tag) = split(/:/,$line); + $HeadFields{$label} = $tag; + } + last FMTSW; + } + if ($elem eq "fieldorder") { # Field order + @FieldOrder = (); %FieldODefs = (); + while ($line = <$handle>) { + last if $line =~ /^\s*<\/fieldorder\s*>/i; + next if $line =~ /^\s*$/; + $line =~ s/\s//g; $line =~ tr/A-Z/a-z/; + push(@FieldOrder, $line); + $FieldODefs{$line} = 1; + } + # push(@FieldOrder,'-extra-') if (!$FieldODefs{'-extra-'}); + last FMTSW; + } + if ($elem eq "fieldsbeg") { # Begin markup of mail head + $FIELDSBEG = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "fieldsend") { # End markup of mail head + $FIELDSEND = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "fldbeg") { # Begin markup of field text + $FLDBEG = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "fldend") { # End markup of field text + $FLDEND = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "folrefs") { + $DoFolRefs = 1; last FMTSW; + } + if ($elem eq "footer") { # Footer file + if ($line = &get_elem_last_line($handle, $elem)) { + $line =~ s/\s//g; + $FOOTER = $line; + } + last FMTSW; + } + if ($elem eq "gmtdatefmt") { # GMT date format + if ($line = &get_elem_last_line($handle, $elem)) { + $GMTDateFmt = $line; + } + last FMTSW; + } + if ($elem eq "headbodysep") { + $HEADBODYSEP = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "header") { # Header file + if ($line = &get_elem_last_line($handle, $elem)) { + $line =~ s/\s//g; + $HEADER = $line; + } + last FMTSW; + } + if ($elem eq "icons") { # Icons + %Icons = () if $override; + while ($line = <$handle>) { + last if $line =~ /^\s*<\/icons\s*>/i; + next if $line =~ /^\s*$/; + $line =~ s/\s//g; + ($type, $url) = split(/:/,$line,2); + $type =~ tr/A-Z/a-z/; + $Icons{$type} = $url; + } + last FMTSW; + } + if ($elem eq "idxfname") { # Index filename + if ($line = &get_elem_last_line($handle, $elem)) { + $line =~ s/\s//g; + $IDXNAME = $line; + } + last FMTSW; + } + if ($elem eq "idxlabel") { # Index label + $IDXLABEL = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "idxpgbegin") { # Opening markup of index + $IDXPGBEG = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "idxpgend") { # Closing markup of index + $IDXPGEND = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "idxprefix") { # Prefix for main idx pages + if ($line = &get_elem_last_line($handle, $elem)) { + $line =~ s/\s//g; + $IDXPREFIX = $line; + } + last FMTSW; + } + if ($elem eq "idxsize") { # Size of index + if (($tmp = &get_elem_int($handle, $elem, 1)) ne '') { + $IDXSIZE = $tmp; + } + last FMTSW; + } + if ($elem eq "include") { # Include other rc files + while ($line = <$handle>) { + last if $line =~ /^\s*<\/include\s*>/i; + next if $line =~ /^\s*$/; + $line =~ s/\s+$//; + $line = $pathhead . $line if ($line !~ /$'DIRSEPREX/o); + &read_fmt_file($line); + } + last FMTSW; + } + if ($elem eq "labelbeg") { # Begin markup of label + $LABELBEG = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "labelend") { # End markup of label + $LABELEND = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "labelstyles") { # Field label style + while ($line = <$handle>) { + last if $line =~ /^\s*<\/labelstyles\s*>/i; + next if $line =~ /^\s*$/; + $line =~ s/\s//g; $line =~ tr/A-Z/a-z/; + ($label, $tag) = split(/:/,$line); + $HeadHeads{$label} = $tag; + } + last FMTSW; + } + if ($elem eq "listbegin") { # List begin + $LIBEG = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "listend") { # List end + $LIEND = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "litemplate") { # List item template + $LITMPL = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "localdatefmt") { # Local date format + if ($line = &get_elem_last_line($handle, $elem)) { + $LocalDateFmt = $line; + } + last FMTSW; + } + if ($elem eq "mailto") { # Convert e-mail addrs + $NOMAILTO = 0; last FMTSW; + } + if ($elem eq "mailtourl") { # mailto URL + while ($line = <$handle>) { + last if $line =~ /^\s*<\/mailtourl\s*>/i; + next if $line =~ /^\s*$/; + $line =~ s/\s//g; + $MAILTOURL = $line; + } + last FMTSW; + } + if ($elem eq "main") { + $MAIN = 1; last FMTSW; + } + if ($elem eq "maxsize") { # Size of archive + if (($tmp = &get_elem_int($handle, $elem, 1)) ne '') { + $MAXSIZE = $tmp; + } + last FMTSW; + } + if ($elem eq "mhpattern") { # File pattern MH-like dirs + if ($line = &get_elem_last_line($handle, $elem)) { + $MHPATTERN = $line; + } + last FMTSW; + } + if ($elem eq "mimefilters") { # Mime filters + @Requires = (), %'MIMEFilters = () if $override; + while ($line = <$handle>) { + last if $line =~ /^\s*<\/mimefilters\s*>/i; + next if $line =~ /^\s*$/; + $line =~ s/\s//g; + ($type,$routine,$plfile) = split(/:/,$line,3); + $type =~ tr/A-Z/a-z/; + $'MIMEFilters{$type} = $routine; + push(@Requires, $plfile) if $plfile =~ /\S/; + } + last FMTSW; + } + if ($elem eq "mimeargs") { # Mime arguments + %'MIMEFiltersArgs = () if $override; + while ($line = <$handle>) { + last if $line =~ /^\s*<\/mimeargs\s*>/i; + next if $line =~ /^\s*$/; + ($type,$arg) = split(/:/,$line,2); + $type =~ tr/A-Z/a-z/ if $type =~ m%/%; + $'MIMEFiltersArgs{$type} = $arg; + } + last FMTSW; + } + if ($elem eq "months") { # Full month names + @a = &get_list_content($handle, $elem); + if (scalar(@a)) { + @Months = @a; + } + last FMTSW; + } + if ($elem eq "monthsabr") { # Abbreviated month names + @a = &get_list_content($handle, $elem); + if (scalar(@a)) { + @months = @a; + } + last FMTSW; + } + if ($elem eq "modtime") { # Mod time same as msg date + $MODTIME = 1; last FMTSW; + } + if ($elem eq "msgfoot") { # Message footer text + $MSGFOOT = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "msggmtdatefmt") { # Message GMT date format + if ($line = &get_elem_last_line($handle, $elem)) { + $MsgGMTDateFmt = $line; + } + last FMTSW; + } + if ($elem eq "msghead") { # Message header text + $MSGHEAD = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "msglocaldatefmt") { # Message local date format + if ($line = &get_elem_last_line($handle, $elem)) { + $MsgLocalDateFmt = $line; + } + last FMTSW; + } + if ($elem eq "msgpgbegin") { # Opening markup of message + $MSGPGBEG = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "msgpgend") { # Closing markup of message + $MSGPGEND = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "msgsep") { # Message separator + if ($line = &get_elem_last_line($handle, $elem)) { + $FROM = $line; + } + last FMTSW; + } + if ($elem eq "multipg") { + $MULTIIDX = 1; last FMTSW; + } + if ($elem eq "nextbutton") { # Next button link in message + $NEXTBUTTON = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "nextbuttonia") { + $NEXTBUTTONIA = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "nextlink") { # Next link in message + $NEXTLINK = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "nextlinkia") { + $NEXTLINKIA = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "nextpglink") { # Next page link in index + $NEXTPGLINK = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "nextpglinkia") { + $NEXTPGLINKIA = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "news") { # News for linking + $NONEWS = 0; last FMTSW; + } + if ($elem eq "noauthsort") { # Do not sort msgs by author + $AUTHSORT = 0; + last FMTSW; + } + if ($elem eq "noconlen") { # Ignore content-length + $CONLEN = 0; last FMTSW; + } + if ($elem eq "nodecodeheads") { + $DecodeHeads = 0; last FMTSW; + } + if ($elem eq "nodoc") { # Do not link to docs + $NODOC = 1; last FMTSW; + } + if ($elem eq "nofolrefs") { + $DoFolRefs = 0; last FMTSW; + } + if ($elem eq "nomailto") { # Do not convert e-mail addrs + $NOMAILTO = 1; last FMTSW; + } + if ($elem eq "nomain") { # No main index + $MAIN = 0; last FMTSW; + } + if ($elem eq "nomodtime") { # Do not change mod times + $MODTIME = 0; last FMTSW; + } + if ($elem eq "nomultipg") { # Single page index + $MULTIIDX = 0; last FMTSW; + } + if ($elem eq "nonews") { # Ignore news for linking + $NONEWS = 1; last FMTSW; + } + if ($elem eq "noreverse") { # Sort in normal order + $REVSORT = 0; last FMTSW; + } + if ($elem eq "nosort") { # Do not sort messages + $NOSORT = 1; + last FMTSW; + } + if ($elem eq "nosubsort") { # Do not sort msgs by subject + $SUBSORT = 0; + last FMTSW; + } + if ($elem eq "nothread") { # No thread index + $THREAD = 0; last FMTSW; + } + if ($elem eq "notreverse") { # Thread sort in normal order + $TREVERSE = 0; last FMTSW; + } + if ($elem eq "nourl") { # Ignore URLs + $NOURL = 1; last FMTSW; + } + if ($elem eq "otherindexes") { # Other indexes + @OtherIdxs = () if $override; + unshift(@OtherIdxs, &get_list_content($handle, $elem, $'PATHSEP)); + last FMTSW; + } + if ($elem eq "perlinc") { # Define perl search paths + @PerlINC = () if $override; + unshift(@PerlINC, &get_list_content($handle, $elem, $'PATHSEP)); + last FMTSW; + } + if ($elem eq "prevbutton") { # Prev button link in message + $PREVBUTTON = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "prevbuttonia") { + $PREVBUTTONIA = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "prevlink") { # Prev link in message + $PREVLINK = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "prevlinkia") { + $PREVLINKIA = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "prevpglink") { # Prev page link for index + $PREVPGLINK = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "prevpglinkia") { + $PREVPGLINKIA = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "reverse") { # Reverse sort + $REVSORT = 1; + last FMTSW; + } + if ($elem eq "sort") { # Sort messages by date + $NOSORT = 0; + $AUTHSORT = 0; $SUBSORT = 0; + last FMTSW; + } + if ($elem eq "subsort") { # Sort messages by subject + $SUBSORT = 1; + $AUTHSORT = 0; $NOSORT = 0; + last FMTSW; + } + if ($elem eq "subjectbegin") { # Begin for subject group + $SUBJECTBEG = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "subjectend") { # End for subject group + $SUBJECTEND = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "subjectheader") { + $SUBJECTHEADER = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tcontbegin") { # Thread cont. start + $TCONTBEG = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tcontend") { # Thread cont. end + $TCONTEND = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "thead") { # Thread idx head + $THEAD = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tfoot") { # Thread idx foot + $TFOOT = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tidxfname") { # Threaded idx filename + if ($line = &get_elem_last_line($handle, $elem)) { + $line =~ s/\s//g; + $TIDXNAME = $line; + } + last FMTSW; + } + if ($elem eq "tidxlabel") { # Thread index label + $TIDXLABEL = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tidxpgbegin") { # Opening markup of thread idx + $TIDXPGBEG = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tidxpgend") { # Closing markup of thread idx + $TIDXPGEND = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tidxprefix") { # Prefix for thread idx pages + if ($line = &get_elem_last_line($handle, $elem)) { + $line =~ s/\s//g; + $TIDXPREFIX = $line; + } + last FMTSW; + } + if ($elem eq "timezones") { # Time zones + %Zone = () if $override; + while ($line = <$handle>) { + last if $line =~ /^\s*<\/timezones\s*>/i; + $line =~ s/\s//g; $line =~ tr/a-z/A-Z/; + ($acro,$hr) = split(/:/,$line); + $Zone{$acro} = $hr; + } + last FMTSW; + } + if ($elem eq "tindentbegin") { # Thread indent start + $TINDENTBEG = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tindentend") { # Thread indent end + $TINDENTEND = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "title") { # Title of index page + $TITLE = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tlevels") { # Level of threading + if (($tmp = &get_elem_int($handle, $elem, 1)) ne '') { + $TLEVELS = $tmp; + } + last FMTSW; + } + if ($elem eq "tsublistbeg") { # List begin in sub-thread + $TSUBLISTBEG = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tsublistend") { # List end in sub-thread + $TSUBLISTEND = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tsubjectbeg") { # Begin markup for sub thread + $TSUBJECTBEG = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tsubjectend") { # End markup for sub thread + $TSUBJECTEND = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tsingletxt") { # Markup for single msg + $TSINGLETXT = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "ttopbegin") { # Begin for top of a thread + $TTOPBEG = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "ttopend") { # End for a thread + $TTOPEND = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tlinone") { # Markup for missing message + $TLINONE = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tlinoneend") { # End markup for missing msg + $TLINONEEND = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tlitxt") { # Thread idx list item + $TLITXT = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tliend") { # Thread idx list item end + $TLIEND = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "toplinks") { # Top links in message + $TOPLINKS = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "ttitle") { # Title of threaded idx + $TTITLE = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "thread") { # Create thread index + $THREAD = 1; last FMTSW; + } + if ($elem eq "treverse") { # Reverse order of threads + $TREVERSE = 1; last FMTSW; + } + if ($elem eq "tnextbutton") { # Thread Next button link + $TNEXTBUTTON = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tnextbuttonia") { + $TNEXTBUTTONIA = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tnextlink") { # Thread Next link + $TNEXTLINK = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tnextlinkia") { + $TNEXTLINKIA = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tnextpglink") { # Thread next page link + $TNEXTPGLINK = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tnextpglinkia") { + $TNEXTPGLINKIA = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tprevbutton") { # Thread Prev button link + $TPREVBUTTON = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tprevbuttonia") { + $TPREVBUTTONIA = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tprevlink") { # Thread Prev link in message + $TPREVLINK = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tprevlinkia") { + $TPREVLINKIA = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tprevpglink") { # Thread previous page link + $TPREVPGLINK = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "tprevpglinkia") { + $TPREVPGLINKIA = &get_elem_content($handle, $elem, $chop); + last FMTSW; + } + if ($elem eq "umask") { # Umask of process + if ($line = &get_elem_last_line($handle, $elem)) { + $line =~ s/\s//g; + $UMASK = $line; + } + last FMTSW; + } + if ($elem eq "weekdays") { # Full weekday name + @a = &get_list_content($handle, $elem); + if (scalar(@a)) { + @Weekdays = @a; + } + last FMTSW; + } + if ($elem eq "weekdaysabr") { # Abbreviated weekday name + @a = &get_list_content($handle, $elem); + if (scalar(@a)) { + @weekdays = @a; + } + last FMTSW; + } + + } ## End FMTSW + } + close($handle); + 1; +} + +##---------------------------------------------------------------------- +sub get_elem_content { + local($filehandle, $gi, $chop) = ($_[0], $_[1], $_[2]); + local($ret) = ''; + + while (<$filehandle>) { + last if /^\s*<\/$gi\s*>/i; + $ret .= $_; + } + $ret =~ s/\r?\n?$// if $chop; + $ret; +} + +##---------------------------------------------------------------------- +sub get_elem_int { + local($filehandle, $gi, $abs) = ($_[0], $_[1], $_[2]); + local($ret) = ''; + + while (<$filehandle>) { + last if /^\s*<\/$gi\s*>/i; + next unless /^\s*[-+]?\d+\s*$/; + s/[+\s]//g; + s/-// if $abs; + $ret = $_; + } + $ret; +} + +##---------------------------------------------------------------------- +sub get_elem_last_line { + local($filehandle, $gi) = ($_[0], $_[1]); + local($ret) = ''; + + while (<$filehandle>) { + last if /^\s*<\/$gi\s*>/i; + next unless /\S/; + $ret = $_; + } + $ret =~ s/\r?\n?$//; + $ret; +} + +##---------------------------------------------------------------------- +sub get_list_content { + local($filehandle, $gi, $sep) = ($_[0], $_[1], $_[2]); + local(@items) = (); + $sep = ':' unless $sep; + + while (<$filehandle>) { + last if /^\s*<\/$gi\s*>/i; + next unless /\S/; + s/\r?\n?$//; + push(@items, split(/$sep/, $_)); + } + @items; +} + +##---------------------------------------------------------------------------## +1; diff --git a/lib/mhrcvars.pl b/lib/mhrcvars.pl new file mode 100644 index 0000000..31d6b36 --- /dev/null +++ b/lib/mhrcvars.pl @@ -0,0 +1,548 @@ +##---------------------------------------------------------------------------## +## File: +## @(#) mhrcvars.pl 1.7 97/05/13 11:28:21 @(#) +## Author: +## Earl Hood ehood@medusa.acs.uci.edu +## Description: +## Defines routine for expanding resource variables. +##---------------------------------------------------------------------------## +## MHonArc -- Internet mail-to-HTML converter +## Copyright (C) 1996,1997 Earl Hood, ehood@medusa.acs.uci.edu +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +##---------------------------------------------------------------------------## + +##--------------------------------------------------------------------------- +## replace_li_var() is used to substitute vars to current +## values. This routine relies on some variables being set by the +## calling routine or as globals. +## +sub replace_li_var { + local($val, $index) = ($_[0], $_[1]); + local($var,$len,$canclip,$raw,$isurl,$tmp,$ret) = ('',0,0,0,0,'',''); + local($expand) = (0); + local($n) = (0); + local($pi, $ni, $tni, $tpi, + $isfirst, $islast, $tisfirst, $tislast); + + ## Get length specifier (if defined) + ($var, $len) = split(/:/, $val, 2); + + ## Check if variable in a URL string + $isurl = 1 if ($len =~ s/u//ig); + + ## Set index related variables + if ($index ne '') { + if ($REVSORT) { + $ni = $MListOrder[$Index2MLoc{$index}-1]; + $pi = $MListOrder[$Index2MLoc{$index}+1]; + $isfirst = ($Index2MLoc{$index} == $#MListOrder); + $islast = ($Index2MLoc{$index} == 0); + } else { + $ni = $MListOrder[$Index2MLoc{$index}+1]; + $pi = $MListOrder[$Index2MLoc{$index}-1]; + $isfirst = ($Index2MLoc{$index} == 0); + $islast = ($Index2MLoc{$index} == $#MListOrder); + } + $tni = $TListOrder[$Index2TLoc{$index}+1]; + $tpi = $TListOrder[$Index2TLoc{$index}-1]; + $tisfirst = ($Index2TLoc{$index} == 0); + $tislast = ($Index2TLoc{$index} == $#TListOrder); + } + + ## Do variable replacement + REPLACESW: { + if ($var eq 'SUBJECT') { + $canclip = 1; $raw = 1; $isurl = 0; + $tmp = $Subject{$index}; + last REPLACESW; + } + if ($var eq 'SUBJECTNA') { + $canclip = 1; $raw = 1; + $tmp = $Subject{$index}; + last REPLACESW; + } + if ($var eq 'A_ATTR') { + $isurl = 0; + $tmp = qq{NAME="} . &fmt_msgnum($IndexNum{$index}) . + qq{" HREF="} . + &msgnum_filename($IndexNum{$index}) . + qq{"}; + last REPLACESW; + } + if ($var eq 'A_NAME') { + $isurl = 0; + $tmp = qq{NAME="} . &fmt_msgnum($IndexNum{$index}) . qq{"}; + last REPLACESW; + } + if ($var eq 'A_HREF') { + $isurl = 0; + $tmp = qq{HREF="} . &msgnum_filename($IndexNum{$index}) . qq{"}; + last REPLACESW; + } + if ($var eq 'DATE') { + $tmp = $Date{$index}; + last REPLACESW; + } + if ($var eq 'DDMMYY') { + $tmp = &time2mmddyy((split(/$X/o, $index))[0], 'ddmmyy'); + last REPLACESW; + } + if ($var eq 'DOCURL') { + $isurl = 0; + $tmp = $DOCURL; + last REPLACESW; + } + if ($var eq 'FROM') { + $canclip = 1; $raw = 1; + $tmp = $From{$index}; + last REPLACESW; + } + if ($var eq 'FROMADDR') { + $canclip = 1; $raw = 1; + $tmp = &extract_email_address($From{$index}); + last REPLACESW; + } + if ($var eq 'FROMNAME') { + $canclip = 1; $raw = 1; + $tmp = &extract_email_name($From{$index}); + last REPLACESW; + } + if ($var eq 'GMTDATE') { + $tmp = &time2str($GMTDateFmt, time, 0); + last REPLACESW; + } + if ($var eq 'ICON') { + if ($Icons{$ContentType{$index}}) { + $tmp = qq||; + } else { + $tmp = qq|[unknown]|; + } + last REPLACESW; + } + if ($var eq 'ICONURL') { + $isurl = 0; + if ($Icons{$ContentType{$index}}) { + $tmp = $Icons{$ContentType{$index}}; + } else { + $tmp = $Icons{'unknown'}; + } + last REPLACESW; + } + if ($var eq 'IDXFNAME') { + if ($MULTIIDX && + ($n = int($Index2MLoc{$index}/$IDXSIZE)+1) > 1) { + + $tmp = sprintf("%s%d.html", + $IDXPREFIX, $index ne '' ? $n : 1); + + } else { + $tmp = $IDXNAME; + } + last REPLACESW; + } + if ($var eq 'IDXLABEL') { + $tmp = $IDXLABEL; + last REPLACESW; + } + if ($var eq 'IDXSIZE') { + $tmp = $IDXSIZE; + last REPLACESW; + } + if ($var eq 'IDXTITLE') { + $canclip = 1; $expand = 1; + $tmp = $TITLE; + last REPLACESW; + } + if ($var eq 'LOCALDATE') { + $tmp = &time2str($LocalDateFmt, time, 1); + last REPLACESW; + } + if ($var eq 'MMDDYY') { + $tmp = &time2mmddyy((split(/$X/o, $index))[0], 'mmddyy'); + last REPLACESW; + } + if ($var eq 'MSGGMTDATE') { + $tmp = &time2str($MsgGMTDateFmt, &get_time_from_index($index), 0); + last REPLACESW; + } + if ($var eq 'MSGID') { + &defineIndex2MsgId(); + $tmp = $Index2MsgId{$index}; + last REPLACESW; + } + if ($var eq 'MSGLOCALDATE') { + $tmp = &time2str($MsgLocalDateFmt, &get_time_from_index($index), 1); + last REPLACESW; + } + if ($var eq 'MSGNUM') { + $tmp = &fmt_msgnum($IndexNum{$index}); + last REPLACESW; + } + if ($var eq 'NEXTFROM') { + $canclip = 1; $raw = 1; + $tmp = $From{$ni}; + last REPLACESW; + } + if ($var eq 'NEXTFROMADDR') { + $canclip = 1; $raw = 1; + $tmp = &extract_email_address($From{$ni}); + last REPLACESW; + } + if ($var eq 'NEXTFROMNAME') { + $canclip = 1; $raw = 1; + $tmp = &extract_email_name($From{$ni}); + last REPLACESW; + } + if ($var eq 'NEXTMSG') { + $tmp = &msgnum_filename($IndexNum{$ni}); + last REPLACESW; + } + if ($var eq 'NEXTMSGNUM') { + $tmp = &fmt_msgnum($IndexNum{$ni}); + last REPLACESW; + } + if ($var eq 'NEXTSUBJECT') { + $canclip = 1; $raw = 1; + $tmp = $Subject{$ni}; + last REPLACESW; + } + if ($var eq 'NUMFOLUP') { + $tmp = $FolCnt{$index}; + last REPLACESW; + } + if ($var eq 'NUMOFIDXMSG') { + $tmp = ($NumOfMsgs > $IDXSIZE ? $IDXSIZE : $NumOfMsgs); + last REPLACESW; + } + if ($var eq 'NUMOFMSG') { + $tmp = $NumOfMsgs; + last REPLACESW; + } + if ($var eq 'ORDNUM') { + $tmp = $i+1; + last REPLACESW; + } + if ($var eq 'OUTDIR') { + $tmp = $OUTDIR; + last REPLACESW; + } + if ($var eq 'PREVFROM') { + $canclip = 1; $raw = 1; + $tmp = $From{$pi}; + last REPLACESW; + } + if ($var eq 'PREVFROMADDR') { + $canclip = 1; $raw = 1; + $tmp = &extract_email_address($From{$pi}); + last REPLACESW; + } + if ($var eq 'PREVFROMNAME') { + $canclip = 1; $raw = 1; + $tmp = &extract_email_name($From{$pi}); + last REPLACESW; + } + if ($var eq 'PREVMSG') { + $tmp = &msgnum_filename($IndexNum{$pi}); + last REPLACESW; + } + if ($var eq 'PREVMSGNUM') { + $tmp = &fmt_msgnum($IndexNum{$pi}); + last REPLACESW; + } + if ($var eq 'PREVSUBJECT') { + $canclip = 1; $raw = 1; + $tmp = $Subject{$pi}; + last REPLACESW; + } + if ($var eq 'PROG') { + $tmp = $PROG; + last REPLACESW; + } + if ($var eq 'TIDXFNAME') { + if ($MULTIIDX && + ($n = int($Index2TLoc{$index}/$IDXSIZE)+1) > 1) { + + $tmp = sprintf("%s%d.html", + $TIDXPREFIX, $index ne '' ? $n : 1); + + } else { + $tmp = $TIDXNAME; + } + last REPLACESW; + } + if ($var eq 'TIDXLABEL') { + $tmp = $TIDXLABEL; + last REPLACESW; + } + if ($var eq 'TIDXTITLE') { + $canclip = 1; $expand = 1; + $tmp = $TTITLE; + last REPLACESW; + } + if ($var eq 'VERSION') { + $tmp = $VERSION; + last REPLACESW; + } + if ($var eq 'YYMMDD') { + $tmp = &time2mmddyy((split(/$X/o, $index))[0], 'yymmdd'); + last REPLACESW; + } + if ($var eq '') { + $tmp = '$'; + last REPLACESW; + } + + ## + ## Next/Prev buttons/links + ## + if ($var eq 'NEXTBUTTON') { + $expand = 1; + $tmp = (!$islast) ? $NEXTBUTTON : $NEXTBUTTONIA; + last REPLACESW; + } + if ($var eq 'NEXTLINK') { + $expand = 1; + $tmp = (!$islast) ? $NEXTLINK : $NEXTLINKIA; + last REPLACESW; + } + if ($var eq 'PREVBUTTON') { + $expand = 1; + $tmp = (!$isfirst) ? $PREVBUTTON : $PREVBUTTONIA; + last REPLACESW; + } + if ($var eq 'PREVLINK') { + $expand = 1; + $tmp = (!$isfirst) ? $PREVLINK : $PREVLINKIA; + last REPLACESW; + } + + ## + ## Thread Next/Prev buttons/links + ## + if ($var eq 'TNEXTBUTTON') { + $expand = 1; + $tmp = (!$tislast) ? $TNEXTBUTTON : $TNEXTBUTTONIA; + last REPLACESW; + } + if ($var eq 'TNEXTLINK') { + $expand = 1; + $tmp = (!$tislast) ? $TNEXTLINK : $TNEXTLINKIA; + last REPLACESW; + } + if ($var eq 'TPREVBUTTON') { + $expand = 1; + $tmp = (!$tisfirst) ? $TPREVBUTTON : $TPREVBUTTONIA; + last REPLACESW; + } + if ($var eq 'TPREVLINK') { + $expand = 1; + $tmp = (!$tisfirst) ? $TPREVLINK : $TPREVLINKIA; + last REPLACESW; + } + + ## + ## Thread related variables + ## + if ($var eq 'TNEXTFROM') { + $canclip = 1; $raw = 1; + $tmp = $From{$tni}; + last REPLACESW; + } + if ($var eq 'TNEXTFROMADDR') { + $canclip = 1; $raw = 1; + $tmp = &extract_email_address($From{$tni}); + last REPLACESW; + } + if ($var eq 'TNEXTFROMNAME') { + $canclip = 1; $raw = 1; + $tmp = &extract_email_name($From{$tni}); + last REPLACESW; + } + if ($var eq 'TNEXTMSG') { + $tmp = &msgnum_filename($IndexNum{$tni}); + last REPLACESW; + } + if ($var eq 'TNEXTMSGNUM') { + $tmp = &fmt_msgnum($IndexNum{$tni}); + last REPLACESW; + } + if ($var eq 'TNEXTSUBJECT') { + $canclip = 1; $raw = 1; + $tmp = $Subject{$tni}; + last REPLACESW; + } + if ($var eq 'TPREVFROM') { + $canclip = 1; $raw = 1; + $tmp = $From{$tpi}; + last REPLACESW; + } + if ($var eq 'TPREVFROMADDR') { + $canclip = 1; $raw = 1; + $tmp = &extract_email_address($From{$tpi}); + last REPLACESW; + } + if ($var eq 'TPREVFROMNAME') { + $canclip = 1; $raw = 1; + $tmp = &extract_email_name($From{$tpi}); + last REPLACESW; + } + if ($var eq 'TPREVMSG') { + $tmp = &msgnum_filename($IndexNum{$tpi}); + last REPLACESW; + } + if ($var eq 'TPREVMSGNUM') { + $tmp = &fmt_msgnum($IndexNum{$tpi}); + last REPLACESW; + } + if ($var eq 'TPREVSUBJECT') { + $canclip = 1; $raw = 1; + $tmp = $Subject{$tpi}; + last REPLACESW; + } + + ## + ## Multi-page index variables + ## + if ($var eq 'NEXTPGLINK') { + $expand = 1; + $tmp = $PageNum < $NumOfPages ? $NEXTPGLINK : $NEXTPGLINKIA; + last REPLACESW; + } + if ($var eq 'PREVPGLINK') { + $expand = 1; + $tmp = $PageNum > 1 ? $PREVPGLINK : $PREVPGLINKIA; + last REPLACESW; + } + if ($var eq 'TNEXTPGLINK') { + $expand = 1; + $tmp = $PageNum < $NumOfPages ? $TNEXTPGLINK : $TNEXTPGLINKIA; + last REPLACESW; + } + if ($var eq 'TPREVPGLINK') { + $expand = 1; + $tmp = $PageNum > 1 ? $TPREVPGLINK : $TPREVPGLINKIA; + last REPLACESW; + } + if ($var eq 'PAGENUM') { + $tmp = $PageNum; + last REPLACESW; + } + if ($var eq 'NUMOFPAGES') { + $tmp = $NumOfPages; + last REPLACESW; + } + if ($var eq 'NEXTPG') { + $tmp = sprintf("%s%d.html", $IDXPREFIX, $PageNum+1); + last REPLACESW; + } + if ($var eq 'PREVPG') { + $tmp = $PageNum > 2 ? + sprintf("%s%d.html", $IDXPREFIX, $PageNum-1) : + $IDXNAME; + last REPLACESW; + } + if ($var eq 'TNEXTPG') { + $tmp = sprintf("%s%d.html", $TIDXPREFIX, $PageNum+1); + last REPLACESW; + } + if ($var eq 'TPREVPG') { + $tmp = $PageNum > 2 ? + sprintf("%s%d.html", $TIDXPREFIX, $PageNum-1) : + $TIDXNAME; + last REPLACESW; + } + if ($var eq 'FIRSTPG') { + $tmp = $IDXNAME; + last REPLACESW; + } + if ($var eq 'LASTPG') { + $tmp = ($MULTIIDX && $NumOfPages > 1 ? sprintf("%s%d.html", + $IDXPREFIX, $NumOfPages) : + $IDXNAME); + last REPLACESW; + } + if ($var eq 'TFIRSTPG') { + $tmp = $TIDXNAME; + last REPLACESW; + } + if ($var eq 'TLASTPG') { + $tmp = ($MULTIIDX && $NumOfPages > 1 ? sprintf("%s%d.html", + $TIDXPREFIX, $NumOfPages) : + $TIDXNAME); + last REPLACESW; + } + if ($var eq 'IDXPREFIX') { + $tmp = $IDXPREFIX; + last REPLACESW; + } + if ($var eq 'TIDXPREFIX') { + $tmp = $TIDXPREFIX; + last REPLACESW; + } + + ## + ## User defined variable check + ## + if ($CustomRcVars{$var}) { + $expand = 1; + $tmp = $CustomRcVars{$var}; + last REPLACESW; + } + + warn qq{Warning: Unrecognized variable: "$val"\n}; + return "\$$val\$"; + } + + ## Check if string needs to be expanded again + if ($expand) { + $tmp =~ s/\$([^\$]*)\$/&replace_li_var($1,$index)/ge; + } + + ## Check if URL text specifier is set + if ($isurl) { + $ret = &urlize($tmp); + + } else { + if ($raw) { + $ret = &$MHeadCnvFunc($tmp) if $raw; + } else { + $ret = $tmp; + } + + # Check for clipping + if ($len > 0 && $canclip) { + # Check for entity refs and modify clip length accordingly + foreach ($ret =~ /(\&[^;\s]*;)/g) { + $len += length($_) -1; + } + $ret = substr($ret, 0, $len); + } + } + + ## Check for subject link + $ret = qq{$ret} + if $var eq 'SUBJECT'; + + $ret; +} + +##---------------------------------------------------------------------------## +1; diff --git a/lib/mhtime.pl b/lib/mhtime.pl new file mode 100644 index 0000000..5cbd971 --- /dev/null +++ b/lib/mhtime.pl @@ -0,0 +1,294 @@ +##---------------------------------------------------------------------------## +## File: +## @(#) mhtime.pl 1.7 97/05/13 @(#) +## Author: +## Earl Hood ehood@medusa.acs.uci.edu +## Description: +## Time related routines for mhonarc +##---------------------------------------------------------------------------## +## Copyright (C) 1996 Earl Hood, ehood@medusa.acs.uci.edu +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +##---------------------------------------------------------------------------## + +##---------------------------------------------------------------------------## +## Date variables for date routines +## +{ +package mhtime; + +%Month2Num = ( + 'jan', 0, 'feb', 1, 'mar', 2, 'apr', 3, 'may', 4, 'jun', 5, 'jul', 6, + 'aug', 7, 'sep', 8, 'oct', 9, 'nov', 10, 'dec', 11, +); +%WDay2Num = ( + 'sun', 0, 'mon', 1, 'tue', 2, 'wed', 3, 'thu', 4, 'fri', 5, 'sat', 6, +); + +@weekdays = ('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'); +@Weekdays = ('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', + 'Friday', 'Saturday'); +@months = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', + 'Sep', 'Oct', 'Nov', 'Dec'); +@Months = ('January', 'Febuary', 'March', 'April', 'May', 'June', + 'July', 'August', 'September', 'October', 'November', + 'December'); +} + +##--------------------------------------------------------------------------- +## Set weekday and month names. This allows localization of +## names. +## +sub set_date_names { + package mhtime; + + local(*in_wd, *in_Wd, *in_m, *in_M) = @_; + @weekdays = @in_wd if scalar(@in_wd); + @Weekdays = @in_Wd if scalar(@in_Wd); + @months = @in_m if scalar(@in_m); + @Months = @in_M if scalar(@in_M); +} + +##--------------------------------------------------------------------------- +## Get date in date(1)-like format. $local flag is if local time +## should be used. +## +sub getdate { + &time2str('', time, $_[0]); +} + +##--------------------------------------------------------------------------- +## Convert a calander time to a string. Similar to strftime(3). +## +sub time2str { + package mhtime; + + local($fmt, $time, $local) = @_ ; + local($date) = "" ; + + ## Get current date/time + local($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = + ($local ? localtime($time) : gmtime($time)); + + ## Format output + if ($fmt =~ /\S/) { + local($yearfull, $hour12); + $yearfull = $year + 1900; + $hour12 = $hour > 12 ? $hour-12 : $hour; + + $fmt =~ s/\%a/$weekdays[$wday]/g; + $fmt =~ s/\%A/$Weekdays[$wday]/g; + $fmt =~ s/\%b/$months[$mon]/g; + $fmt =~ s/\%B/$Months[$mon]/g; + + $sec = sprintf("%02d", $sec); + $min = sprintf("%02d", $min); + $hour = sprintf("%02d", $hour); + $hour12 = sprintf("%02d", $hour12); + $mday = sprintf("%02d", $mday); + $mon = sprintf("%02d", $mon+1); + $year = sprintf("%02d", $year); + $yearfull = sprintf("%04d", $yearfull); + $wday = sprintf("%02d", $wday+1); + $yday = sprintf("%03d", $yday); + + $fmt =~ s/\%d/$mday/g; + $fmt =~ s/\%H/$hour/g; + $fmt =~ s/\%I/$hour12/g; + $fmt =~ s/\%j/$yday/g; + $fmt =~ s/\%m/$mon/g; + $fmt =~ s/\%M/$min/g; + $fmt =~ s/\%n/\n/g; + $fmt =~ s/\%p/am/g if ($hour < 12); + $fmt =~ s/\%p/pm/g if ($hour >= 12); + $fmt =~ s/\%P/AM/g if ($hour < 12); + $fmt =~ s/\%P/PM/g if ($hour >= 12); + $fmt =~ s/\%S/$sec/eg ; + $fmt =~ s/\%w/$wday/g ; + $fmt =~ s/\%y/$year/g ; + $fmt =~ s/\%Y/$year+1900/ge ; + + $fmt =~ s/\%\%/\%/g ; + + $date = $fmt ; + + } else { + $date = sprintf("%s %s %02d %02d:%02d:%02d ". + ($local ? "%s" : "GMT %s"), + $weekdays[$wday], $months[$mon], + $mday, $hour, $min, $sec, $year); + } + $date ; +} + +##--------------------------------------------------------------------------- +## parse_date takes a string date specified like the output of +## date(1) into its components. Parsing a string for a date is +## ugly since we have to watch out for differing formats. +## +## The following date formats are looked for: +## +## Wdy DD Mon YY HH:MM:SS Zone +## DD Mon YY HH:MM:SS Zone +## Wdy Mon DD HH:MM:SS Zone YYYY +## Wdy Mon DD HH:MM:SS YYYY +## +## The routine keys off of the day of time field "HH:MM:SS" and +## scans realtive to its location. +## +## If the parse fails, a null array is returned. Thus the routine +## may be used as follows: +## +## if ( (@x = &parse_date($date)) ) { Success } +## else { Fail } +## +## If success the array contents are as follows: +## +## (Weekday (0-6), Day of the month (1-31), Month (0-11), +## Year, Hour, Minutes, Seconds, Time Zone) +## +## Contributer(s): Frank J. Manion +## +sub parse_date { + package mhtime; + + local($date) = $_[0]; + local($wday, $mday, $mon, $yr, $time, $hr, $min, $sec, $zone); + local(@array); + local($start, $rest); + + local($p_weekdays) = "Mon|Tue|Wed|Thu|Fri|Sat|Sun"; + local($p_months) = "Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec"; + local($p_hrminsec) = '\d{1,2}:\d\d:\d\d'; + local($p_hrmin) = '\d{1,2}:\d\d'; + local($p_day) = '\d{1,2}'; + local($p_year) = '\d\d\d\d|\d\d'; + + # Try to find the date by focusing on the "\d\d:\d\d" field. + # All parsing is then done relative to this location. + # + $date =~ s/^\s*//; + if ( $date =~ /\b($p_hrminsec)/o ) { + ($start, $time, $rest) = ($`, $1, $'); + } elsif ( $date =~ /\b($p_hrmin)/o ) { + ($start, $time, $rest) = ($`, $1, $'); + } else { + return (); # no time here ! + } + ($hr, $min, $sec) = split(/:/, $time); + $sec = 0 unless $sec; # Sometime seconds not defined + + # Strip $start of all but the last 4 tokens, + # and stuff all tokens in $rest into @array + # + @array = split(' ', $start); + $start = join(' ', ($#array-3 < 0) ? @array[0..$#array] : + @array[$#array-3..$#array]); + @array = split(' ', $rest); + $rest = join(' ', ($#array >= 1) ? @array[0..1] : + @array[0]); + # Wdy DD Mon YY HH:MM:SS Zone + if ( $start =~ + /($p_weekdays),*\s+($p_day)\s+($p_months)\s+($p_year)$/io ) { + + ($wday, $mday, $mon, $yr, $zone) = ($1, $2, $3, $4, $array[0]); + + # DD Mon YY HH:MM:SS Zone + } elsif ( $start =~ /($p_day)\s+($p_months)\s+($p_year)$/io ) { + ($mday, $mon, $yr, $zone) = ($1, $2, $3, $array[0]); + + # Wdy Mon DD HH:MM:SS Zone YYYY + # Wdy Mon DD HH:MM:SS YYYY + } elsif ( $start =~ /($p_weekdays),?\s+($p_months)\s+($p_day)$/io ) { + ($wday, $mon, $mday) = ($1, $2, $3); + if ( $rest =~ /^(\S+)\s+($p_year)/o ) { # Zone YYYY + ($zone, $yr) = ($1, $2); + } elsif ( $rest =~ /^($p_year)/o ) { # YYYY + ($yr) = ($1); + } else { # zilch, use current year + warn "Warning: No year in date, using current\n"; + $yr = (localtime(time))[5]; + } + + # All else fails! + } else { + return (); + } + + # Modify month and weekday for lookup + $mon =~ tr/A-Z/a-z/; $wday =~ tr/A-Z/a-z/; + + ($WDay2Num{$wday}, $mday, $Month2Num{$mon}, $yr, $hr, $min, $sec, $zone); +} + +##--------------------------------------------------------------------------- +## Routine to convert time in seconds to a month, day, and year +## format. The format can be "mmddyy", "yymmdd", "ddmmyy". The +## year can be specifed as "yyyy" if a 4 digit year is needed. +## +sub time2mmddyy { + package mhtime; + + local($time, $fmt) = ($_[0], $_[1]); + local($day,$mon,$year,$ylen); + if ($time) { + ($day,$mon,$year) = (localtime($time))[3,4,5]; + $year += 1900; + + ## Compute length for year field + $ylen = $fmt =~ s/y/y/g; + substr($year, 0, 4 - $ylen) = ''; + + ## Create string + if ($fmt =~ /ddmmyy/i) { # DDMMYY + $tmp = sprintf("%02d/%02d/%0${ylen}d", $day, $mon+1, $year); + + } elsif ($fmt =~ /yymmdd/i) { # YYMMDD + $tmp = sprintf("%0${ylen}d/%02d/%02d", $year, $mon+1, $day); + + } else { # MMDDYY + $tmp = sprintf("%02d/%02d/%0${ylen}d", $mon+1, $day, $year); + } + + } else { + $tmp = "--/--/--"; + } +} + +##--------------------------------------------------------------------------- +## zone_offset_to_secs translates a [+-]HHMM zone offset to +## seconds. +## +sub zone_offset_to_secs { + local($off) = shift; + local($sign, $min); + + if (length($off) < 4) { + warn qq{Warning: "$off" not a valid timezone offset\n}; + return 0; + } + if ($off =~ s/-//) { # Check for sign + $sign = -1; + } else { + $sign = 1; s/\+//; + } + $min = substr($off, -2, 2); # Extract minutes + substr($off, -2, 2) = ""; # Just leave hour in $off + $sign * (($off * 3600) + ($min * 60)); + +} + +##---------------------------------------------------------------------------## +1; diff --git a/lib/mhtxt2022.pl b/lib/mhtxt2022.pl deleted file mode 100644 index 3246df7..0000000 --- a/lib/mhtxt2022.pl +++ /dev/null @@ -1,159 +0,0 @@ -##---------------------------------------------------------------------------## -## File: -## mhtxt2022.pl -## Author: -## NIIBE Yutaka gniibe@mri.co.jp -## (adapted from mhtxtplain.pl by Earl Hood ) -## Date: -## Fri Jul 12 08:21:16 CDT 1996 -## Change: Escaped '@' in expression for use in Perl 5. -## (1996/07/12, ehood@isogen.com) -## Description: -## Library defines routine to filter text/plain body parts that -## use the ISO-2022 Japanese character sets into HTML for MHonArc. -## Filter routine can be registered with the following: -## -## -## text/plain:m2h_text_plain_iso2022'filter:mhtxt2022.pl -## -## -## This will override the default text/plain filter used by -## MHonArc. -## -## Filter is based on the following RFCs: -## -## RFC-1468 I -## J. Murai, M. Crispin, E. van der Poel, "Japanese Character -## Encoding for Internet Messages", 06/04/1993. (Pages=6) -## -## RFC-1554 I -## M. Ohta, K. Handa, "ISO-2022-JP-2: Multilingual Extension of -## ISO-2022-JP", 12/23/1993. (Pages=6) -## -##---------------------------------------------------------------------------## -## MHonArc -- Internet mail-to-HTML converter -## Copyright (C) 1995 NIIBE Yutaka, gniibe@mri.co.jp -## Earl Hood, ehood@isogen.com -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -##---------------------------------------------------------------------------## - -package m2h_text_plain_iso2022; - -$Url = '(http://|ftp://|afs://|wais://|telnet://|gopher://|' . - 'news:|nntp:|mid:|cid:|mailto:|prospero:)'; -$UrlExp = $Url . q%[^\s\(\)\|<>"']*[^\.;,"'\|\[\]\(\)\s<>]%; -$HUrlExp = $Url . q%[^\s\(\)\|<>"'\&]*[^\.;,"'\|\[\]\(\)\s<>\&]%; - -##--------------------------------------------------------------------------- -## Filter entitizes special characters, and converts URLs to -## hyperlinks. -## -sub filter { - local($header, *fields, *body) = @_; - local(@data) = split(/\n/,$body); - - $ret = "
    \n";
    -    for ($i = 0; $i <= $#data; $i++) {
    -        $_ = $data[$i];
    -
    -	# Process preceding ASCII text
    -	while(1) {
    -	    if (/^[^\033]+/) {	# ASCII plain text
    -		$ascii_text = $&;
    -		$_ = $';
    -
    -		# Replace meta characters in ASCII plain text
    -		$ascii_text =~ s%\&%\&%g;
    -		$ascii_text =~ s%<%\<%g;
    -		$ascii_text =~ s%>%\>%g;
    -		## Convert URLs to hyperlinks
    -		$ascii_text =~ s%($HUrlExp)%$1%gio
    -		    unless $'NOURL;
    -
    -		$ret .= $ascii_text;
    -	    } elsif (/\033\.[A-F]/) { # G2 Designate Sequence
    -		$_ = $';
    -		$ret .= $&;
    -	    } elsif (/\033N[ -]/) { # Single Shift Sequence
    -		$_ = $';
    -		$ret .= $&;
    -	    } else {
    -		last;
    -	    }
    -	}
    -
    -	# Process Each Segment
    -	while(1) {
    -	    if (/^\033\([BJ]/) { # Single Byte Segment
    -		$_ = $';
    -		$ret .= $&;
    -		while(1) {
    -		    if (/^[^\033]+/) {	# ASCII plain text
    -			$ascii_text = $&;
    -			$_ = $';
    -
    -			# Replace meta characters in ASCII plain text
    -			$ascii_text =~ s%\&%\&%g;
    -			$ascii_text =~ s%<%\<%g;
    -			$ascii_text =~ s%>%\>%g;
    -			## Convert URLs to hyperlinks
    -			$ascii_text =~ s%($HUrlExp)%$1%gio
    -			    unless $'NOURL;
    -
    -			$ret .= $ascii_text;
    -		    } elsif (/\033\.[A-F]/) { # G2 Designate Sequence
    -			$_ = $';
    -			$ret .= $&;
    -		    } elsif (/\033N[ -]/) { # Single Shift Sequence
    -			$_ = $';
    -			$ret .= $&;
    -		    } else {
    -			last;
    -		    }
    -		}
    -	    } elsif (/^\033\$[\@AB]|\033\$\([CD]/) { # Double Byte Segment
    -		$_ = $';
    -		$ret .= $&;
    -		while(1) {
    -		    if (/^([!-~][!-~])+/) { # Double Char plain text
    -			$_ = $';
    -			$ret .= $&;
    -		    } elsif (/\033\.[A-F]/) { # G2 Designate Sequence
    -			$_ = $';
    -			$ret .= $&;
    -		    } elsif (/\033N[ -]/) { # Single Shift Sequence
    -			$_ = $';
    -			$ret .= $&;
    -		    } else {
    -			last;
    -		    }
    -		}
    -	    } else {
    -		# Something wrong in text
    -		$ret .= $_;
    -		last;
    -	    }
    -	}
    -
    -	$ret .= "\n";
    -    }
    -
    -    $ret .= "
    \n"; - - ($ret); -} - -1; diff --git a/lib/mhtxthtml.pl b/lib/mhtxthtml.pl index 2f01233..bc3c71a 100644 --- a/lib/mhtxthtml.pl +++ b/lib/mhtxthtml.pl @@ -1,10 +1,8 @@ ##---------------------------------------------------------------------------## ## File: -## mhtxthtml.pl +## @(#) mhtxthtml.pl 1.1 96/09/17 @(#) ## Author: -## Earl Hood ehood@isogen.com -## Date: -## Fri Jan 19 16:12:01 CST 1996 +## Earl Hood ehood@medusa.acs.uci.edu ## Description: ## Library defines routine to filter text/html body parts ## for MHonArc. @@ -14,7 +12,7 @@ ## ##---------------------------------------------------------------------------## ## MHonArc -- Internet mail-to-HTML converter -## Copyright (C) 1995 Earl Hood, ehood@isogen.com +## Copyright (C) 1995 Earl Hood, ehood@medusa.acs.uci.edu ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by diff --git a/lib/mhtxtplain.pl b/lib/mhtxtplain.pl index 29b493a..3342339 100644 --- a/lib/mhtxtplain.pl +++ b/lib/mhtxtplain.pl @@ -1,10 +1,8 @@ ##---------------------------------------------------------------------------## ## File: -## mhtxtplain.pl +## @(#) mhtxtplain.pl 1.8 97/05/13 11:29:12 @(#) ## Author: -## Earl Hood ehood@isogen.com -## Date: -## Fri Jan 19 17:22:27 CST 1996 +## Earl Hood ehood@medusa.acs.uci.edu ## Description: ## Library defines routine to filter text/plain body parts to HTML ## for MHonArc. @@ -14,7 +12,7 @@ ## ##---------------------------------------------------------------------------## ## MHonArc -- Internet mail-to-HTML converter -## Copyright (C) 1995 Earl Hood, ehood@isogen.com +## Copyright (C) 1995-1997 Earl Hood, ehood@medusa.acs.uci.edu ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -34,26 +32,296 @@ package m2h_text_plain; -$Url = '(http://|ftp://|afs://|wais://|telnet://|gopher://|' . - 'news:|nntp:|mid:|cid:|mailto:|prospero:)'; -$UrlExp = $Url . q%[^\s\(\)\|<>"']*[^\.;,"'\|\[\]\(\)\s<>]%; -$HUrlExp = $Url . q%[^\s\(\)\|<>"'\&]*[^\.;,"'\|\[\]\(\)\s<>\&]%; +$Url = '(http://|https://|ftp://|afs://|wais://|telnet://' . + '|gopher://|news:|nntp:|mid:|cid:|mailto:|prospero:)'; +$UrlExp = $Url . q%[^\s\(\)\|<>"']*[^\.;,"'\|\[\]\(\)\s<>]%; +$HUrlExp = $Url . q%[^\s\(\)\|<>"'\&]*[^\.;,"'\|\[\]\(\)\s<>\&]%; +$QuoteChars = '>|[\|\]+:]'; +$HQuoteChars = '>|[\|\]+:]'; -##--------------------------------------------------------------------------- -## Filter entitizes special characters, and converts URLs to -## hyperlinks. +##---------------------------------------------------------------------------## +## Text/plain filter for mhonarc. The following filter arguments +## are recognized ($args): +## +## nourl -- Do hyperlink URLs +## quote -- Italicize quoted message text +## nonfixed -- Use normal typeface +## keepspace -- Preserve whitespace if nonfixed +## maxwidth=# -- Set the maximum width of lines. Lines +## exceeding the maxwidth will be broken +## up across multiple lines. +## asis=set1:set2:... -- Colon separated lists of charsets +## to leave as-is. Only HTML special +## characters will be converted into +## entities. +## +## All arguments should be separated by at least one space ## sub filter { local($header, *fields, *data, $isdecode, $args) = @_; - local($nourl) = ($'NOURL || ($args =~ /nourl/i)); + local($ctype, $charset, $nourl, $doquote, $igncharset, $nonfixed, + $keepspace, $maxwidth); + local(%asis) = (); + + $nourl = ($'NOURL || ($args =~ /nourl/i)); + $doquote = ($args =~ /quote/i); + $nonfixed = ($args =~ /nonfixed/i); + $keepspace = ($args =~ /keepspace/i); + if ($args =~ /maxwidth=(\d+)/) { + $maxwidth = $1; + } else { + $maxwidth = 0; + } + + ## Grab charset parameter (if defined) + $ctype = $fields{'content-type'}; + ($charset) = $ctype =~ /charset=(\S+)/; + $charset =~ s/['"]//g; $charset =~ tr/A-Z/a-z/; + + ## Check if certain charsets should be left alone + if ($args =~ /asis=(\S+)/i) { + local(@a) = split(':', $1); + foreach (@a) { + tr/A-Z/a-z/; + $asis{$_} = 1; + } + } + + ## Check MIMECharSetConverters if charset should be left alone + if ($main'MIMECharSetConverters{$charset} eq "-decode-") { + $asis{$charset} = 1; + } - $data =~ s%\&%\&%g; - $data =~ s%<%\<%g; - $data =~ s%>%\>%g; + ## Check if max-width set + if ($maxwidth) { + $* = 1; + $data =~ s/^(.*)$/&break_line($1, $maxwidth)/ge; + $* = 0; + } + + ## Convert data according to charset + if (!$asis{$charset}) { + ## Japanese message + if ($charset =~ /iso-2022-jp/i) { + return (&jp2022(*data)); + + ## Latin 2-6, Greek, Hebrew, Arabic + } elsif ($charset =~ /iso-8859-([2-9]|10)/i) { + $data = &iso_8859'str2sgml($data, $charset); + + ## ASCII, Latin 1, Other + } else { + &esc_chars_inplace(*data); + } + } else { + &esc_chars_inplace(*data); + } + + ## Check for quoting + if ($doquote) { + $* = 1; + $data =~ s@^( ?${HQuoteChars})(.*)$@$1$2@go; + $* = 0; + } + + ## Check if using nonfixed font + if ($nonfixed) { + $data =~ s/(\r?\n)/
    $1/g; + if ($keepspace) { + $* = 1; + $data =~ s/^(.*)$/&preserve_space($1)/ge; + $* = 0; + } + } else { + $data = "
    \n" . $data . "
    \n"; + } ## Convert URLs to hyperlinks - $data =~ s%($HUrlExp)%$1%gio unless $nourl; - ("
    \n" . $data . "
    \n"); + $data =~ s@($HUrlExp)@$1@gio unless $nourl; + + ($data); +} + +##---------------------------------------------------------------------------## +## Function to convert ISO-2022-JP data into HTML. Function is based +## on the following RFCs: +## +## RFC-1468 I +## J. Murai, M. Crispin, E. van der Poel, "Japanese Character +## Encoding for Internet Messages", 06/04/1993. (Pages=6) +## +## RFC-1554 I +## M. Ohta, K. Handa, "ISO-2022-JP-2: Multilingual Extension of +## ISO-2022-JP", 12/23/1993. (Pages=6) +## +## Author of function: +## NIIBE Yutaka gniibe@mri.co.jp +## (adapted for mhtxtplain.pl by Earl Hood ) +## +sub jp2022 { + local(*body) = shift; + local(@lines) = split(/\r?\n/,$body); + local($ret, $ascii_text); + + $ret = "
    \n";
    +    for ($i = 0; $i <= $#lines; $i++) {
    +        $_ = $lines[$i];
    +
    +	# Process preceding ASCII text
    +	while(1) {
    +	    if (/^[^\033]+/) {	# ASCII plain text
    +		$ascii_text = $&;
    +		$_ = $';
    +
    +		# Replace meta characters in ASCII plain text
    +		$ascii_text =~ s%\&%\&%g;
    +		$ascii_text =~ s%<%\<%g;
    +		$ascii_text =~ s%>%\>%g;
    +		## Convert URLs to hyperlinks
    +		$ascii_text =~ s%($HUrlExp)%$1%gio
    +		    unless $'NOURL;
    +
    +		$ret .= $ascii_text;
    +	    } elsif (/\033\.[A-F]/) { # G2 Designate Sequence
    +		$_ = $';
    +		$ret .= $&;
    +	    } elsif (/\033N[ -]/) { # Single Shift Sequence
    +		$_ = $';
    +		$ret .= $&;
    +	    } else {
    +		last;
    +	    }
    +	}
    +
    +	# Process Each Segment
    +	while(1) {
    +	    if (/^\033\([BJ]/) { # Single Byte Segment
    +		$_ = $';
    +		$ret .= $&;
    +		while(1) {
    +		    if (/^[^\033]+/) {	# ASCII plain text
    +			$ascii_text = $&;
    +			$_ = $';
    +
    +			# Replace meta characters in ASCII plain text
    +			$ascii_text =~ s%\&%\&%g;
    +			$ascii_text =~ s%<%\<%g;
    +			$ascii_text =~ s%>%\>%g;
    +			## Convert URLs to hyperlinks
    +			$ascii_text =~ s%($HUrlExp)%$1%gio
    +			    unless $'NOURL;
    +
    +			$ret .= $ascii_text;
    +		    } elsif (/\033\.[A-F]/) { # G2 Designate Sequence
    +			$_ = $';
    +			$ret .= $&;
    +		    } elsif (/\033N[ -]/) { # Single Shift Sequence
    +			$_ = $';
    +			$ret .= $&;
    +		    } else {
    +			last;
    +		    }
    +		}
    +	    } elsif (/^\033\$[\@AB]|\033\$\([CD]/) { # Double Byte Segment
    +		$_ = $';
    +		$ret .= $&;
    +		while(1) {
    +		    if (/^([!-~][!-~])+/) { # Double Char plain text
    +			$_ = $';
    +			$ret .= $&;
    +		    } elsif (/\033\.[A-F]/) { # G2 Designate Sequence
    +			$_ = $';
    +			$ret .= $&;
    +		    } elsif (/\033N[ -]/) { # Single Shift Sequence
    +			$_ = $';
    +			$ret .= $&;
    +		    } else {
    +			last;
    +		    }
    +		}
    +	    } else {
    +		# Something wrong in text
    +		$ret .= $_;
    +		last;
    +	    }
    +	}
    +
    +	$ret .= "\n";
    +    }
    +
    +    $ret .= "
    \n"; + + ($ret); +} + +##---------------------------------------------------------------------------## + +sub esc_chars_inplace { + local(*foo) = shift; + $foo =~ s@\&@\&@g; + $foo =~ s@<@\<@g; + $foo =~ s@>@\>@g; + 1; +} + +##---------------------------------------------------------------------------## + +sub preserve_space { + local($str) = shift; + + 1 while $str =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e; + # $str =~ s/ {2,}/' ' x length($&)/ge; + $str =~ s/ /\ /g; + $str; } +##---------------------------------------------------------------------------## + +sub break_line { + local($str) = shift; + local($width) = shift; + local($q, $new) = ('', ''); + local($try, $trywidth); + + ## Translate tabs to spaces + 1 while $str =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e; + + ## Do nothing if str <= width + return $str if length($str) <= $width; + + ## See if str begins with a quote char + if ($str =~ s/^($QuoteChars)//) { + $q = $1; + --$width; + } + + ## Create new string by breaking up str + while ($str) { + + # handle case where no-whitespace line larger than width + if (($str =~ /^\S+/) && (length($&) >= $width)) { + $new .= $q . $&; + $str = $'; + next; + } + + $try = ''; + $trywidth = $width; + $try = substr($str, 0, $trywidth); + + if ($try =~ /\S+$/) { + $trywidth -= length($&); + $new .= $q . substr($str, 0, $trywidth); + } else { + $new .= $q . $try; + } + substr($str, 0, $trywidth) = ''; + + } continue { + $new .= "\n" if $str; + } + $new; +} + +##---------------------------------------------------------------------------## 1; diff --git a/lib/mhtxtsetext.pl b/lib/mhtxtsetext.pl index 454a438..854bd2b 100644 --- a/lib/mhtxtsetext.pl +++ b/lib/mhtxtsetext.pl @@ -1,6 +1,7 @@ ##---------------------------------------------------------------------------## +## @(#) mhtxtsetext.pl 1.1 96/09/17 @(#) ## Library to convert text/setext to HTML. Adapted for use in MHonArc -## by ehood@isogen.com, Sept 1994. +## by ehood@medusa.acs.uci.edu, Sept 1994. ## Filter routine can be registered with the following: ## ## text/setext:m2h_text_setext'filter:mhtxtsetext.pl diff --git a/lib/mhusage.pl b/lib/mhusage.pl new file mode 100644 index 0000000..e4a6b07 --- /dev/null +++ b/lib/mhusage.pl @@ -0,0 +1,136 @@ +##---------------------------------------------------------------------------## +## File: +## @(#) mhusage.pl 1.1 97/02/06 19:14:31 @(#) +## Author: +## Earl Hood ehood@medusa.acs.uci.edu +## Description: +## Usage output. +##---------------------------------------------------------------------------## +## MHonArc -- Internet mail-to-HTML converter +## Copyright (C) 1995-1997 Earl Hood, ehood@medusa.acs.uci.edu +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +##---------------------------------------------------------------------------## + +select(STDOUT); +print <] ... + $PROG [] -rmm ... +Options: + -add : Add message(s) to archive + -authsort : Sort messages by author + -conlen : Honor Content-Length fields + -decodeheads : Decode 1522 decode-only data when reading mail + -definevars : Define custom resource variables + -dbfile : Name of MHonArc database file + (def: ".mhonarc.db") + -doc : Print link to doc at end of index page + -docurl : URL to MHonArc documentation + (def: "http://www.oac.uci.edu/indiv/ehood/ + mhonarc.html") + -editidx : Only edit/change index page and messages + -expiredate : Message cut-off date + -expireage : Time in seconds from current if message expires + -folrefs : Print links to explicit follow-ups/references + -force : Perform archive operation even if unable to lock + -footer : File containing user text for bottom of index page + -genidx : Output index to stdout based upon archive contents + -gmtdatefmt : Format for GMT date + -header : User text to include at top of index page + -help : This message + -idxfname : Name of index page + (def: "maillist.html") + -idxprefix : Filename prefix for multi-page main index + (def: "mail") + -idxsize <#> : Maximum number of messages shown in indexes + -localdatefmt : Format for local date + -lockdelay <#> : Time delay, in seconds, between lock tries + (def: "3") + -locktries <#> : Maximum number of tries in locking an archive + (def: "10") + -mailtourl : URL to use for e-mail address hyperlinks + (def: "mailto:\$TO\$") + -main : Create a main index + -maxsize <#> : Maximum number of messages allowed in archive + -mhpattern : Perl expression for message files in a directory + (def: "^\\d+$") + -modtime : Set modification time on files to message date + -months : Month names + -monthsabr : Abbreviated month names + -msgsep : Message separator (Perl) expression for mbox files + (def: "^From ") + -multipg : Generate multi-page indexes + -news : Add links to newsgroups + -noauthsort : Do not sort messages by author + -noconlen : Ignore Content-Length fields + -nodecodeheads : Leave message headers "as is" when read + -nodoc : Do not print link to doc at end of index page + -nofolrefs : Do not print links to explicit follow-ups/references + -nomailto : Do not add in mailto links for e-mail addresses + -nomain : Do not create a main index + -nomodtime : Do not set mod time on files to message date + -nomultipg : Do not generate multi-page indexes + -nonews : Do not add links to newsgroups + -noreverse : List messages in normal order + -nosort : Do not sort messages + -nosubsort : Do not sort messages by subject + -nothread : Do not create threaded index + -nourl : Do not make URL hyperlinks + -otherindexes : List of other rcfiles for extra indexes + -outdir : Destination/location of HTML mail archive + (def: ".") + -perlinc : List of paths to search for MIME filters + -quiet : Suppress status messages during execution + -rcfile : Resource file for MHonArc + -reverse : List messages in reverse order + -rmm : Remove messages from archive + -savemem : Write message data while processing + -scan : List out archive contents to stdout + -single : Convert a single message to HTML + -sort : Sort messages by date (this is the default) + -subsort : Sort message by subject + -thread : Create threaded index + -tidxfname : Filename of threaded index page + (def: "threads.html") + -tidxprefix : Filename prefix for multi-page thread index + (def: "thrd") + -time : Print to stderr CPU time used to process mail + -title : Title of main index page + (def: "Mail Index") + -tlevels <#> : Maximum # of nested lists in threaded index + (def: "3") + -treverse : List threads with newest thread first + -ttitle : Title of thread index page + (def: "Mail Thread Index") + -umask : Umask of MHonArc process (Unix only) + -url : Make URL hyperlinks + -v : Print version information + -weekdays : Weekday names + -weekdaysabr : Abbreviated weekday names + +Description: + MHonArc is a highly customizable Perl program for converting e-mail, + encoded with MIME, into HTML. MHonArc supports the conversion of UUCP + style mailbox files or MH mail folders into HTML with an index linking + to each mail message. The -single option can be used to convert a + single mail message. + + Read the documentation for more complete usage information. + +Version: +$VINFO +EndOfUsage + +1; diff --git a/lib/mhutil.pl b/lib/mhutil.pl index f5a6b0e..b1a5d75 100644 --- a/lib/mhutil.pl +++ b/lib/mhutil.pl @@ -1,15 +1,13 @@ ##---------------------------------------------------------------------------## ## File: -## mhutil.pl +## @(#) mhutil.pl 1.11 97/05/13 @(#) ## Author: -## Earl Hood ehood@isogen.com -## Date: -## Wed Apr 17 00:46:26 CDT 1996 +## Earl Hood ehood@medusa.acs.uci.edu ## Description: ## Utility routines for MHonArc ##---------------------------------------------------------------------------## ## MHonArc -- Internet mail-to-HTML converter -## Copyright (C) 1995 Earl Hood, ehood@isogen.com +## Copyright (C) 1995,1996 Earl Hood, ehood@medusa.acs.uci.edu ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -26,516 +24,44 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ##---------------------------------------------------------------------------## -package main; +## Regular expression variables for sorting routines +$PreSubjectStripExp = q{^\s*(re|sv|fwd|fw)(\[[\d+]\])?[:>-]+\s*}; +$ArtSubjectStripExp = q{^(the|a|an)\s+}; -%Month2Num = ( - 'Jan', 0, 'Feb', 1, 'Mar', 2, 'Apr', 3, 'May', 4, 'Jun', 5, 'Jul', 6, - 'Aug', 7, 'Sep', 8, 'Oct', 9, 'Nov', 10, 'Dec', 11, -); -%WDay2Num = ( - 'Sun', 0, 'Mon', 1, 'Tue', 2, 'Wed', 3, 'Thu', 4, 'Fri', 5, 'Sat', 6, -); - -##---------------------------------------------------------------------------## -## MHonArc based routines -##---------------------------------------------------------------------------## ##--------------------------------------------------------------------------- -## read_fmt_file() parses the resource file. The name is misleading. -## (The code for this routine could probably be simplified). +## convert_line() translates a line to HTML. Checks are made for +## embedded URLs. ## -sub read_fmt_file { - local($file) = shift; - local($line, $tag, $label, $acro, $hr, $type, $routine, $plfile, - $url, $arg); - local($elem, $attr, $override); - - if (!open(FMT, $file)) { - warn "Warning: Unable to open resource file: $file\n"; - return 0; - } - print STDOUT "Reading resource file: $file ...\n" unless $QUIET; - while ($line = ) { - next unless $line =~ /^\s*<([^>]+)>/; - ($elem, $attr) = split(' ', $1, 2); - $elem =~ tr/A-Z/a-z/; - $override = ($attr =~ /override/i); - FMTSW: { - if ($elem eq "botlinks") { # Bottom links in message - $BOTLINKS = ''; - while ($line = ) { - last if $line =~ /^\s*<\/botlinks\s*>/i; - $BOTLINKS .= $line; - } - last FMTSW; - } - if ($elem eq "docurl") { # Doc URL - while ($line = ) { - last if $line =~ /^\s*<\/docurl\s*>/i; - next if $line =~ /^\s*$/; - $line =~ s/\s//g; $DOCURL = $line; - } - last FMTSW; - } - if ($elem eq "dbfile") { # Database file - while ($line = ) { - last if $line =~ /^\s*<\/dbfile\s*>/i; - next if $line =~ /^\s*$/; - $line =~ s/\s//g; $DBFILE = $line; - } - last FMTSW; - } - if ($elem eq "excs") { # Exclude header fields - %HFieldsExc = () if $override; - while ($line = ) { - last if $line =~ /^\s*<\/excs\s*>/i; - $line =~ s/\s//g; $line =~ tr/A-Z/a-z/; - $HFieldsExc{$line} = 1 if $line; - } - last FMTSW; - } - if ($elem eq "fieldstyles") { # Field text style - while ($line = ) { - last if $line =~ /^\s*<\/fieldstyles\s*>/i; - next if $line =~ /^\s*$/; - $line =~ s/\s//g; $line =~ tr/A-Z/a-z/; - ($label, $tag) = split(/:/,$line); - $HeadFields{$label} = $tag; - } - last FMTSW; - } - if ($elem eq "fieldorder") { # Field order - @FieldOrder = (); %FieldODefs = (); - while ($line = ) { - last if $line =~ /^\s*<\/fieldorder\s*>/i; - next if $line =~ /^\s*$/; - $line =~ s/\s//g; $line =~ tr/A-Z/a-z/; - push(@FieldOrder, $line); - $FieldODefs{$line} = 1; - } - push(@FieldOrder,'-extra-') if (!$FieldODefs{'-extra-'}); - last FMTSW; - } - if ($elem eq "footer") { # Footer file - while ($line = ) { - last if $line =~ /^\s*<\/footer\s*>/i; - next if $line =~ /^\s*$/; - $line =~ s/\s//g; - $FOOTER = $line; - } - last FMTSW; - } - if ($elem eq "header") { # Header file - while ($line = ) { - last if $line =~ /^\s*<\/header\s*>/i; - next if $line =~ /^\s*$/; - $line =~ s/\s//g; - $HEADER = $line; - } - last FMTSW; - } - if ($elem eq "icons") { # Icons - %Icons = () if $override; - while ($line = ) { - last if $line =~ /^\s*<\/icons\s*>/i; - next if $line =~ /^\s*$/; - $line =~ s/\s//g; - ($type, $url) = split(/:/,$line,2); - $type =~ tr/A-Z/a-z/; - $Icons{$type} = $url; - } - last FMTSW; - } - if ($elem eq "idxfname") { # Index filename - while ($line = ) { - last if $line =~ /^\s*<\/idxfname\s*>/i; - next if $line =~ /^\s*$/; - $line =~ s/\s//g; - $IDXNAME = $line; - } - last FMTSW; - } - if ($elem eq "idxpgbegin") { # Opening markup of index - $IDXPGBEG = ''; - while ($line = ) { - last if $line =~ /^\s*<\/idxpgbegin\s*>/i; - $IDXPGBEG .= $line; - } - last FMTSW; - } - if ($elem eq "idxpgend") { # Closing markup of index - $IDXPGEND = ''; - while ($line = ) { - last if $line =~ /^\s*<\/idxpgend\s*>/i; - $IDXPGEND .= $line; - } - last FMTSW; - } - if ($elem eq "idxsize") { # Size of index - while ($line = ) { - last if $line =~ /^\s*<\/idxsize\s*>/i; - next if $line =~ /^\s*$/; - $line =~ s/\s//g; - $IDXSIZE = $line if ($line =~ /^\d+$/); - } - last FMTSW; - } - if ($elem eq "labelstyles") { # Field label style - while ($line = ) { - last if $line =~ /^\s*<\/labelstyles\s*>/i; - next if $line =~ /^\s*$/; - $line =~ s/\s//g; $line =~ tr/A-Z/a-z/; - ($label, $tag) = split(/:/,$line); - $HeadHeads{$label} = $tag; - } - last FMTSW; - } - if ($elem eq "listbegin") { # List begin - $LIBEG = ''; - while ($line = ) { - last if $line =~ /^\s*<\/listbegin\s*>/i; - $LIBEG .= $line; - } - last FMTSW; - } - if ($elem eq "listend") { # List end - $LIEND = ''; - while ($line = ) { - last if $line =~ /^\s*<\/listend\s*>/i; - $LIEND .= $line; - } - last FMTSW; - } - if ($elem eq "litemplate") { # List item template - $LITMPL = ''; - while ($line = ) { - last if $line =~ /^\s*<\/litemplate\s*>/i; - $LITMPL .= $line; - } - last FMTSW; - } - if ($elem eq "mailtourl") { # mailto URL - while ($line = ) { - last if $line =~ /^\s*<\/mailtourl\s*>/i; - next if $line =~ /^\s*$/; - $line =~ s/\s//g; - $MAILTOURL = $line; - } - last FMTSW; - } - if ($elem eq "maxsize") { # Size of archive - while ($line = ) { - last if $line =~ /^\s*<\/maxsize\s*>/i; - next if $line =~ /^\s*$/; - $line =~ s/\s//g; - $MAXSIZE = $line if ($line =~ /^\d+$/); - } - last FMTSW; - } - if ($elem eq "mimefilters") { # Mime filters - @Requires = (), %MIMEFilters = () if $override; - while ($line = ) { - last if $line =~ /^\s*<\/mimefilters\s*>/i; - next if $line =~ /^\s*$/; - $line =~ s/\s//g; - ($type,$routine,$plfile) = split(/:/,$line,3); - $type =~ tr/A-Z/a-z/; - $MIMEFilters{$type} = $routine; - push(@Requires, $plfile); - } - last FMTSW; - } - if ($elem eq "mimeargs") { # Mime arguments - %MIMEFiltersArgs = () if $override; - while ($line = ) { - last if $line =~ /^\s*<\/mimeargs\s*>/i; - next if $line =~ /^\s*$/; - ($type,$arg) = split(/:/,$line,2); - $type =~ tr/A-Z/a-z/ if $type =~ m%/%; - $MIMEFiltersArgs{$type} = $arg; - } - last FMTSW; - } - if ($elem eq "msgfoot") { # Message footer text - $MSGFOOT = ''; - while ($line = ) { - last if $line =~ /^\s*<\/msgfoot\s*>/i; - $MSGFOOT .= $line; - } - last FMTSW; - } - if ($elem eq "msghead") { # Message header text - $MSGHEAD = ''; - while ($line = ) { - last if $line =~ /^\s*<\/msghead\s*>/i; - $MSGHEAD .= $line; - } - last FMTSW; - } - if ($elem eq "msgpgbegin") { # Opening markup of message - $MSGPGBEG = ''; - while ($line = ) { - last if $line =~ /^\s*<\/msgpgbegin\s*>/i; - $MSGPGBEG .= $line; - } - last FMTSW; - } - if ($elem eq "msgpgend") { # Closing markup of message - $MSGPGEND = ''; - while ($line = ) { - last if $line =~ /^\s*<\/msgpgend\s*>/i; - $MSGPGEND .= $line; - } - last FMTSW; - } - if ($elem eq "msgsep") { # Message separator - while ($line = ) { - last if $line =~ /^\s*<\/msgsep\s*>/i; - next if $line =~ /^\s*$/; - chop $line; - $FROM = $line; - } - last FMTSW; - } - if ($elem eq "nextbutton") { # Next button link in message - $NEXTBUTTON = ''; - while ($line = ) { - last if $line =~ /^\s*<\/nextbutton\s*>/i; - $NEXTBUTTON .= $line; - } - chop $NEXTBUTTON; - last FMTSW; - } - if ($elem eq "nextbuttonia") { - $NEXTBUTTONIA = ''; - while ($line = ) { - last if $line =~ /^\s*<\/nextbuttonia\s*>/i; - $NEXTBUTTONIA .= $line; - } - chop $NEXTBUTTONIA; - last FMTSW; - } - if ($elem eq "nextlink") { # Next link in message - $NEXTLINK = ''; - while ($line = ) { - last if $line =~ /^\s*<\/nextlink\s*>/i; - $NEXTLINK .= $line; - } - last FMTSW; - } - if ($elem eq "nextlinkia") { - $NEXTLINKIA = ''; - while ($line = ) { - last if $line =~ /^\s*<\/nextlinkia\s*>/i; - $NEXTLINKIA .= $line; - } - last FMTSW; - } - if ($elem eq "nodoc") { - $NODOC = 1; last FMTSW; - } - if ($elem eq "nonews") { - $NONEWS = 1; last FMTSW; - } - if ($elem eq "nomailto") { - $NOMAILTO = 1; last FMTSW; - } - if ($elem eq "noreverse") { - $REVSORT = 0; last FMTSW; - } - if ($elem eq "nosort") { - $NOSORT = 1; $SUBSORT = 0; last FMTSW; - } - if ($elem eq "nothread") { - $THREAD = 0; last FMTSW; - } - if ($elem eq "notreverse") { - $TREVERSE = 0; last FMTSW; - } - if ($elem eq "notsubsort") { - $TSUBSORT = 0; last FMTSW; - } - if ($elem eq "nourl") { - $NOURL = 1; last FMTSW; - } - if ($elem eq "otherindexes") { # Other indexes - @OtherIdxs = (); - while ($line = ) { - last if $line =~ /^\s*<\/otherindexes\s*>/i; - next if $line =~ /^\s*$/; - $line =~ s/\s//g; - push(@OtherIdxs, $line); - } - last FMTSW; - } - if ($elem eq "perlinc") { # Message separator - @PerlINC = () if $override; - while ($line = ) { - last if $line =~ /^\s*<\/perlinc\s*>/i; - next if $line =~ /^\s*$/; - $line =~ s/\s//g; - unshift(@PerlINC, $line); - } - last FMTSW; - } - if ($elem eq "prevbutton") { # Prev button link in message - $PREVBUTTON = ''; - while ($line = ) { - last if $line =~ /^\s*<\/prevbutton\s*>/i; - $PREVBUTTON .= $line; - } - chop $PREVBUTTON; - last FMTSW; - } - if ($elem eq "prevbuttonia") { - $PREVBUTTONIA = ''; - while ($line = ) { - last if $line =~ /^\s*<\/prevbuttonia\s*>/i; - $PREVBUTTONIA .= $line; - } - chop $PREVBUTTONIA; - last FMTSW; - } - if ($elem eq "prevlink") { # Prev link in message - $PREVLINK = ''; - while ($line = ) { - last if $line =~ /^\s*<\/prevlink\s*>/i; - $PREVLINK .= $line; - } - last FMTSW; - } - if ($elem eq "prevlinkia") { - $PREVLINKIA = ''; - while ($line = ) { - last if $line =~ /^\s*<\/prevlinkia\s*>/i; - $PREVLINKIA .= $line; - } - last FMTSW; - } - if ($elem eq "reverse") { - $REVSORT = 1; last FMTSW; - } - if ($elem eq "sort") { - $NOSORT = 0; $SUBSORT = 0; last FMTSW; - } - if ($elem eq "subsort") { - $NOSORT = 0; $SUBSORT = 1; last FMTSW; - } - if ($elem eq "thead") { # Thread idx head - $THEAD = ''; - while ($line = ) { - last if $line =~ /^\s*<\/thead\s*>/i; - $THEAD .= $line; - } - last FMTSW; - } - if ($elem eq "tfoot") { # Thread idx foot - $TFOOT = ''; - while ($line = ) { - last if $line =~ /^\s*<\/tfoot\s*>/i; - $TFOOT .= $line; - } - last FMTSW; - } - if ($elem eq "tidxfname") { # Threaded idx filename - while ($line = ) { - last if $line =~ /^\s*<\/tidxfname\s*>/i; - next if $line =~ /^\s*$/; - $line =~ s/\s//g; - $TIDXNAME = $line; - } - last FMTSW; - } - if ($elem eq "tidxpgbegin") { # Opening markup of thread idx - $TIDXPGBEG = ''; - while ($line = ) { - last if $line =~ /^\s*<\/tidxpgbegin\s*>/i; - $TIDXPGBEG .= $line; - } - last FMTSW; - } - if ($elem eq "tidxpgend") { # Closing markup of thread idx - $TIDXPGEND = ''; - while ($line = ) { - last if $line =~ /^\s*<\/tidxpgend\s*>/i; - $TIDXPGEND .= $line; - } - last FMTSW; - } - if ($elem eq "timezones") { # Time zones - %Zone = () if $override; - while ($line = ) { - last if $line =~ /^\s*<\/timezones\s*>/i; - $line =~ s/\s//g; $line =~ tr/a-z/A-Z/; - ($acro,$hr) = split(/:/,$line); - $Zone{$acro} = $hr; - } - last FMTSW; - } - if ($elem eq "title") { # Title of index page - $TITLE = ''; - while ($line = ) { - last if $line =~ /^\s*<\/title\s*>/i; - $TITLE .= $line; - } - last FMTSW; - } - if ($elem eq "tlevels") { # Level of threading - while ($line = ) { - last if $line =~ /^\s*<\/tlevels\s*>/i; - next if $line =~ /^\s*$/; - $line =~ s/\s//g; - $TLEVELS = $line if ($line =~ /^\d+$/); - } - last FMTSW; - } - if ($elem eq "tlitxt") { # Thread idx
  • txt - $TLITXT = ''; - while ($line = ) { - last if $line =~ /^\s*<\/tlitxt\s*>/i; - $TLITXT .= $line; - } - last FMTSW; - } - if ($elem eq "toplinks") { # Top links in message - $TOPLINKS = ''; - while ($line = ) { - last if $line =~ /^\s*<\/toplinks\s*>/i; - $TOPLINKS .= $line; - } - last FMTSW; - } - if ($elem eq "tsubsort") { - $TSUBSORT = 1; last FMTSW; - } - if ($elem eq "ttitle") { # Title of threaded idx - $TTITLE = ''; - while ($line = ) { - last if $line =~ /^\s*<\/ttitle\s*>/i; - $TTITLE .= $line; - } - last FMTSW; - } - if ($elem eq "thread") { - $THREAD = 1; last FMTSW; - } - if ($elem eq "treverse") { - $TREVERSE = 1; last FMTSW; - } - if ($elem eq "umask") { # Umask of process - while ($line = ) { - last if $line =~ /^\s*<\/umask\s*>/i; - next if $line =~ /^\s*$/; - chop $line; - $UMASK = $line; - } - last FMTSW; - } +sub convert_line { + local($str, $charset) = ($_[0], $_[1]); + local($item, $item2, $item2h, @array); - } ## End FMTSW + if (!$NOURL && + (@array = split(m%($Url[^\s\(\)\|<>"']*[^\.\?;,"'\|\[\]\(\)\s<>])%o, + $str)) + ) { + $str = ''; + while($#array > 0) { + $item = &entify(shift @array); # Get non-URL text + $item2 = shift @array; # Get URL + $item2h = &entify($item2); # Variable for content + + $str .= join('', + $item, + '', $item2h, ''); + + # The next line is needed since Perl's split function also + # returns extra entries for nested ()'s in the split pattern. + shift @array if $array[0] =~ m%^$Url$%o; + } + $item = &entify(shift @array); # Last item in array + $str .= $item; + } else { + $str = &htmlize($str); } - close(FMT); - 1; + $str; } + ##--------------------------------------------------------------------------- ## Get an e-mail address from (HTML) $str. ## @@ -543,7 +69,7 @@ sub extract_email_address { local($str) = shift; local($ret); - if ($str =~ /\<(\S+)\>/) { + if ($str =~ /<(\S+)>/) { $ret = $1; } elsif ($str =~ s/\([^\)]+\)//) { $str =~ /\s*(\S+)\s*/; $ret = $1; @@ -552,14 +78,15 @@ sub extract_email_address { } $ret; } + ##--------------------------------------------------------------------------- -## Get an e-mail name from (HTML) $str. +## Get an e-mail name from $str. ## sub extract_email_name { local($str) = shift; local($ret); - if ($str =~ s/\<(\S+)\>//) { # Check for: name + if ($str =~ s/<(\S+)>//) { # Check for: name $ret = $1; if ($str !~ /^\s*$/) { # strip extra whitespace ($ret = $str) =~ s/\s+/ /g; @@ -577,237 +104,291 @@ sub extract_email_name { } $ret; } + ##--------------------------------------------------------------------------- ## Routine to sort messages ## sub sort_messages { - local(@a); - if ($NOSORT) { # Message processed order - if ($REVSORT) { @a = sort decrease_msgnum keys %Subject; } - else { @a = sort increase_msgnum keys %Subject; } + if ($NOSORT) { # Processed order + if ($REVSORT) { return sort decrease_msgnum keys %Subject; } + else { return sort increase_msgnum keys %Subject; } } elsif ($SUBSORT) { # Subject order - if ($REVSORT) { @a = sort decrease_subject keys %Subject; } - else { @a = sort increase_subject keys %Subject; } + if ($REVSORT) { return sort decrease_subject keys %Subject; } + else { return sort increase_subject keys %Subject; } + + } elsif ($AUTHSORT) { # Author order + if ($REVSORT) { return sort decrease_author keys %Subject; } + else { return sort increase_author keys %Subject; } } else { # Date order - if ($REVSORT) { @a = sort decrease_index keys %Subject; } - else { @a = sort increase_index keys %Subject; } + if ($REVSORT) { return sort decrease_index keys %Subject; } + else { return sort increase_index keys %Subject; } } - @a; } + ##--------------------------------------------------------------------------- ## Message-sort routines for sort_messages ## sub increase_msgnum { - local(@A) = split(/$'X/o, $a); - local(@B) = split(/$'X/o, $b); - local($sret); - $sret = $A[1] <=> $B[1]; - ($sret == 0 ? $A[0] <=> $B[0] : $sret); + $IndexNum{$a} <=> $IndexNum{$b}; } sub decrease_msgnum { - local(@A) = split(/$'X/o, $a); - local(@B) = split(/$'X/o, $b); - local($sret); - $sret = $B[1] <=> $A[1]; - ($sret == 0 ? $B[0] <=> $A[0] : $sret); + $IndexNum{$b} <=> $IndexNum{$a}; } sub increase_index { - local(@A) = split(/$'X/o, $a); - local(@B) = split(/$'X/o, $b); - local($sret); - $sret = $A[0] <=> $B[0]; - ($sret == 0 ? $A[1] <=> $B[1] : $sret); + (&get_time_from_index($a) <=> &get_time_from_index($b)) || + ($IndexNum{$a} <=> $IndexNum{$b}); } sub decrease_index { - local(@A) = split(/$'X/o, $a); - local(@B) = split(/$'X/o, $b); - local($sret); - $sret = $B[0] <=> $A[0]; - ($sret == 0 ? $B[1] <=> $A[1] : $sret); + (&get_time_from_index($b) <=> &get_time_from_index($a)) || + ($IndexNum{$b} <=> $IndexNum{$a}); } sub increase_subject { local($A, $B) = ($Subject{$a}, $Subject{$b}); - local($at, $bt) = ((split(/$'X/o, $a))[0], (split(/$'X/o, $b))[0]); $A =~ tr/A-Z/a-z/; $B =~ tr/A-Z/a-z/; - 1 while $A =~ s/^\s*(re|sv|fwd|fw)[:>-]+\s*//i; - 1 while $B =~ s/^\s*(re|sv|fwd|fw)[:>-]+\s*//i; - $A =~ s/^(the|a|an)\s+//i; $B =~ s/^(the|a|an)\s+//i; - local($sret) = ($A cmp $B); - ($sret == 0 ? $at <=> $bt : $sret); + 1 while $A =~ s/$PreSubjectStripExp//io; + 1 while $B =~ s/$PreSubjectStripExp//io; + $A =~ s/$ArtSubjectStripExp//io; $B =~ s/$ArtSubjectStripExp//io; + ($A cmp $B) || (&get_time_from_index($a) <=> &get_time_from_index($b)); } sub decrease_subject { local($A, $B) = ($Subject{$a}, $Subject{$b}); - local($at, $bt) = ((split(/$'X/o, $a))[0], (split(/$'X/o, $b))[0]); $A =~ tr/A-Z/a-z/; $B =~ tr/A-Z/a-z/; - 1 while $A =~ s/^\s*(re|sv|fwd|fw)[:>-]+\s*//i; - 1 while $B =~ s/^\s*(re|sv|fwd|fw)[:>-]+\s*//i; - $A =~ s/^(the|a|an)\s+//i; $B =~ s/^(the|a|an)\s+//i; - local($sret) = ($B cmp $A); - ($sret == 0 ? $bt <=> $at : $sret); + 1 while $A =~ s/$PreSubjectStripExp//io; + 1 while $B =~ s/$PreSubjectStripExp//io; + $A =~ s/$ArtSubjectStripExp//io; $B =~ s/$ArtSubjectStripExp//io; + ($A cmp $B) || (&get_time_from_index($b) <=> &get_time_from_index($a)); +} +sub increase_author { + local($A, $B) = (&extract_email_name($From{$a}), + &extract_email_name($From{$b})); + $A =~ tr/A-Z/a-z/; $B =~ tr/A-Z/a-z/; + ($A cmp $B) || (&get_time_from_index($a) <=> &get_time_from_index($b)); +} +sub decrease_author { + local($A, $B) = (&extract_email_name($From{$a}), + &extract_email_name($From{$b})); + $A =~ tr/A-Z/a-z/; $B =~ tr/A-Z/a-z/; + ($A cmp $B) || (&get_time_from_index($b) <=> &get_time_from_index($a)); } + ##--------------------------------------------------------------------------- ## Routine to determine last message number in use. ## sub get_last_msg_num { - local(@files) = (); - local($n); - opendir(DIR, $'OUTDIR) || &error("ERROR: Unable to open $'OUTDIR"); - @files = sort by_msgnum grep(/^msg\d+\.html?$/i, readdir(DIR)); - grep(s/msg0+(\d)/msg$1/i, @files); - close(DIR); - if (@files) { - ($n) = $files[$#files] =~ /(\d+)/; - } else { - $n = -1; + opendir(DIR, $'OUTDIR) || die("ERROR: Unable to open $'OUTDIR\n"); + local($max) = -1; + foreach (readdir(DIR)) { + if (/^msg0*(\d+).htm/i) { + $max = $1 if $1 > $max; + } } - $n; -} -sub by_msgnum { - ($A) = $a =~ /(\d+)/; - ($B) = $b =~ /(\d+)/; - $A <=> $B; + close(DIR); + $max; } + ##--------------------------------------------------------------------------- ## Routine for formating a message number for use in filenames or links. ## sub fmt_msgnum { - local($num) = $_[0]; - sprintf("%05d", $num); + sprintf("%05d", $_[0]); } + ##--------------------------------------------------------------------------- ## Routine to get filename of a message number. ## sub msgnum_filename { - local($num) = $_[0]; - sprintf("msg%05d.html", $num); + sprintf("msg%05d.html", $_[0]); } -##---------------------------------------------------------------------------## -## MHonArc independent routines -##---------------------------------------------------------------------------## -##--------------------------------------------------------------------------- -## parse_date takes a string date specified like the output of -## date(1) into its components. -## -sub parse_date { - local($date) = $_[0]; - local($wday, $mday, $mon, $yr, $time, $hr, $min, $sec, $zone); - local(@array); - - $date =~ s/^\s*//; - @array = split(' ', $date); - if ($array[0] =~ /\d/) { # DD Mon YY HH:MM:SS Zone - ($mday, $mon, $yr, $time, $zone) = @array; - } elsif ($array[1] =~ /\d/) { # Wdy DD Mon YY HH:MM:SS Zone - ($wday, $mday, $mon, $yr, $time, $zone) = @array; - } else { # Wdy Mon DD HH:MM:SS Zone YYYY - ($wday, $mon, $mday, $time, $zone, $yr) = @array; - if ($zone =~ /\d/) { # No zone - $yr = $zone; - $zone = ''; - } - } - ($hr, $min, $sec) = split(/:/, $time); - $sec = 0 unless $sec; # Sometime seconds not defined - ($WDay2Num{$wday}, $mday, $Month2Num{$mon}, $yr, $hr, $min, $sec, $zone); -} ##--------------------------------------------------------------------------- +## Routine to get filename of an index ## -sub time2mmddyy { - local($time, $fmt) = ($_[0], $_[1]); - local($day,$mon,$year); - if ($time) { - ($day,$mon,$year) = (localtime($time))[3,4,5]; - if ($fmt =~ /ddmmyy/i) { - $tmp = sprintf("%02d/%02d/%02d", $day, $mon+1, $year); - } elsif ($fmt =~ /yymmdd/i) { - $tmp = sprintf("%02d/%02d/%02d", $year, $mon+1, $day); - } else { - $tmp = sprintf("%02d/%02d/%02d", $mon+1, $day, $year); - } - } else { - $tmp = "--/--/--"; - } +sub get_filename_from_index { + sprintf("msg%05d.html", $IndexNum{$_[0]}); } + ##--------------------------------------------------------------------------- -## Remove duplicates in an array. +## Routine to get time component from index ## -sub remove_dups { - local(*array) = shift; - local(%dup); - @array = grep($dup{$_}++ < 1, @array); - %dup = (); +sub get_time_from_index { + (split(/$'X/o, $_[0]))[0]; } + ##--------------------------------------------------------------------------- -## numerically() is used to tell 'sort' to sort by numbers. +## Routine to get lc author name from index ## -sub numerically { - $a <=> $b; +sub get_base_author { + local($ret) = (&extract_email_name($From{$_[0]})); + $ret =~ tr/A-Z/a-z/; + $ret; } + ##--------------------------------------------------------------------------- -## "Entify" special characters +## Routine to get base subject text from index ## -sub htmlize { # Older name, variable passed by reference - local(*txt) = $_[0]; - $txt =~ s/&/\&/g; - $txt =~ s/>/>/g; - $txt =~ s//>/g; - $txt =~ s/ $dst") || &error("ERROR: Unable to create $dst"); - print DST ; - close(SRC); - close(DST); +sub get_time_from_date { + local($mday, $mon, $yr, $hr, $min, $sec, $zone) = @_; + local($time) = 0; + + ## If $zone, grab gmt time, else grab local + if ($zone) { + $time = &timegm($sec,$min,$hr,$mday,$mon, + ($yr > 1900 ? $yr-1900 : $yr)); + + # try to modify time/date based on timezone + if ($zone =~ /^[\+-]\d+$/) { # numeric timezone + $time -= &zone_offset_to_secs($zone); + + # timezone abbrev + } elsif (defined($Zone{$zone})) { + $time += ($Zone{$zone}*3600); + + # undefined timezone + } else { + warn qq|Warning: Unrecognized time zone, "$zone"\n|; + } + + } else { + $time = &timelocal($sec,$min,$hr,$mday,$mon, + ($yr > 1900 ? $yr-1900 : $yr)); + } + $time; } + ##--------------------------------------------------------------------------- -## Get date in date(1)-like format. $local flag is if local time -## should be used. +## Routine to check if time has expired. ## -sub getdate { - local($local) = $_[0]; - local($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst); - local($curtime) = (time()); - - ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = - ($local ? localtime($curtime) : gmtime($curtime)); - sprintf("%s %s %02d %02d:%02d:%02d " . ($local ? "%s" : "GMT %s"), - (Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$wday], - (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec)[$mon], - $mday, $hour, $min, $sec, $year); +sub expired_time { + ($ExpireTime && (time - $_[0] > $ExpireTime)) || + ($_[0] < $ExpireDateTime); } + ##--------------------------------------------------------------------------- -## Translate html string back to regular string +## Get HTML tags for formatting message headers ## -sub dehtmlize { - local($str) = shift; - $str =~ s/\<//g; - $str =~ s/\&/\&/g; - $str; +sub get_header_tags { + local($f) = shift; + local($ftago, $ftagc, $tago, $tagc); + + ## Get user specified tags (this is one funcky looking code) + $tag = (defined($HeadHeads{$f}) ? + $HeadHeads{$f} : $HeadHeads{"-default-"}); + $ftag = (defined($HeadFields{$f}) ? + $HeadFields{$f} : $HeadFields{"-default-"}); + if ($tag) { $tago = "<$tag>"; $tagc = ""; } + else { $tago = $tagc = ''; } + if ($ftag) { $ftago = "<$ftag>"; $ftagc = ""; } + else { $ftago = $ftagc = ''; } + + ($tago, $tagc, $ftago, $ftagc); } + ##--------------------------------------------------------------------------- -## Escape special characters in string for URL use. +## Format message headers in HTML. ## -sub urlize { - local($url) = shift; - $url =~ s/([{}\[\]\\^~<>\?%=\+ \t])/sprintf("%%%X",unpack("C",$1))/ge; - $url; +sub htmlize_header { + local(*fields, *l2o) = @_; + local($tmp, + $key, + $tago, + $tagc, + $ftago, + $ftagc, + $mesg, + $item, + @array, + %hf); + + %hf = %fields; + foreach $item (@FieldOrder) { + if ($item eq '-extra-') { + foreach $key (sort keys %hf) { + next if $FieldODefs{$key}; + delete $hf{$key}, next if &exclude_field($key); + + @array = split(/$readmail'FieldSep/o, $hf{$key}); + foreach $tmp (@array) { + $tmp = &$MHeadCnvFunc($tmp); + &field_add_links($key, *tmp); + ($tago, $tagc, $ftago, $ftagc) = &get_header_tags($key); + $mesg .= join('', $LABELBEG, + $tago, $l2o{$key}, $tagc, $LABELEND, + $FLDBEG, $ftago, $tmp, $ftagc, $FLDEND, + "\n"); + } + delete $hf{$key}; + } + } else { + if (!&exclude_field($item) && $hf{$item}) { + @array = (split(/$readmail'FieldSep/o, $hf{$item})); + foreach $tmp (@array) { + $tmp = &$MHeadCnvFunc($tmp); + &field_add_links($item, *tmp); + ($tago, $tagc, $ftago, $ftagc) = &get_header_tags($item); + $mesg .= join('', $LABELBEG, + $tago, $l2o{$item}, $tagc, $LABELEND, + $FLDBEG, $ftago, $tmp, $ftagc, $FLDEND, + "\n"); + } + } + delete $hf{$item}; + } + } + if ($mesg) { $mesg = $FIELDSBEG . $mesg . $FIELDSEND; } + $mesg; } + ##---------------------------------------------------------------------------## +## Routine to parse variable definitions in a string. The +## function returns a list of variable/value pairs. The format of +## the string is similiar to attribute specification lists in +## SGML, but NAMEs are any non-whitespace character. +## +sub parse_vardef_str { + local($org) = shift; + local(%hash) = (); + + ($str = $org) =~ s/^\s+//; + while ($str =~ /^([^=\s]+)\s*=\s*/) { + $var = $1; + $str = $'; + if ($str =~ s/^(['"])//) { + $q = $1; + if (!($q eq "'" ? $str =~ s/^([^']*)'// : + $str =~ s/^([^"]*)"//)) { + warn "Warning: Unclosed quote in: $org\n"; + return (); + } + $value = $1; + } else { + if ($str =~ s/^(\S+)//) { + $value = $1; + } else { + warn "Warning: No value after $var in: $org\n"; + return (); + } + } + $str =~ s/^\s+//; + $hash{$var} = $value; + } + if ($str =~ /\S/) { + warn "Warning: Illegal variable definition syntax in: $org\n"; + return (); + } + %hash; +} + +##---------------------------------------------------------------------------## 1; diff --git a/lib/osinit.pl b/lib/osinit.pl index cbe0d6c..971dee9 100644 --- a/lib/osinit.pl +++ b/lib/osinit.pl @@ -1,16 +1,14 @@ ##---------------------------------------------------------------------------## ## File: -## osinit.pl +## @(#) osinit.pl 1.2 97/01/28 12:19:10 @(#) ## Author: -## Earl Hood ehood@isogen.com +## Earl Hood ehood@medusa.acs.uci.edu ## Description: ## A library for setting up a script based upon the OS the script ## is running under. The main routine defined is OSinit. See ## the routine for specific information. -## Date: -## Mon Mar 11 15:52:12 CST 1996 ##---------------------------------------------------------------------------## -## Copyright (C) 1995 Earl Hood, ehood@isogen.com +## Copyright (C) 1995-1997 Earl Hood, ehood@medusa.acs.uci.edu ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -40,6 +38,9 @@ package os_init; ## $'MACOS => Set to 1 if running under Mac ## $'UNIX => Set to 1 if running under Unix ## $'DIRSEP => Directory separator character +## $'DIRSEPREX => Directory separator character for use in +## regular expressions. +## $'PATHSEP => Recommend path list separator ## $'CURDIR => Current working directory ## $'PROG => Program name with leading pathname component ## stripped off. @@ -56,16 +57,19 @@ sub main'OSinit { if (($tmp = $ENV{'COMSPEC'}) && ($tmp =~ /[a-zA-Z]:\\/) && (-e $tmp)) { $'MSDOS = 1; $'MACOS = 0; $'UNIX = 0; $'DIRSEP = '\\'; $'CURDIR = '.'; + $'PATHSEP = ';'; } elsif (defined($MacPerl'Version)) { $'MSDOS = 0; $'MACOS = 1; $'UNIX = 0; $'DIRSEP = ':'; $'CURDIR = ':'; + $'PATHSEP = ';'; } else { $'MSDOS = 0; $'MACOS = 0; $'UNIX = 1; $'DIRSEP = '/'; $'CURDIR = '.'; + $'PATHSEP = ':'; } ## Store name of program - ($tmp = $'DIRSEP) =~ s/(\W)/\\$1/g; - ($'PROG = $0) =~ s%.*[$tmp]%%o; + ($'DIRSEPREX = $'DIRSEP) =~ s/(\W)/\\$1/g; + ($'PROG = $0) =~ s%.*[$'DIRSEPREX]%%o; ## Ask for command-line options if script is a Mac droplet ## Code taken from the MacPerl FAQ diff --git a/lib/qprint.pl b/lib/qprint.pl index 2913e9b..b093639 100644 --- a/lib/qprint.pl +++ b/lib/qprint.pl @@ -1,8 +1,8 @@ ##---------------------------------------------------------------------------## ## File: -## quoted_printable.pl +## @(#) qprint.pl 1.1 96/09/17 @(#) ## Authors: -## Earl Hood ehood@isogen.com +## Earl Hood ehood@medusa.acs.uci.edu ## Alan Barrett barrett@daisy.ee.und.ac.za ## Description: ## This library defines the routine to decode "quoted-printable" @@ -12,7 +12,7 @@ ## $text = "ed_printable'qprdecode($data); ## ##---------------------------------------------------------------------------## -## Copyright (C) 1995 Earl Hood, ehood@isogen.com +## Copyright (C) 1995 Earl Hood, ehood@medusa.acs.uci.edu ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by diff --git a/lib/readmail.pl b/lib/readmail.pl index bd02bb3..f932200 100644 --- a/lib/readmail.pl +++ b/lib/readmail.pl @@ -1,18 +1,31 @@ ##---------------------------------------------------------------------------## ## File: -## readmail.pl +## @(#) readmail.pl 1.8 97/02/12 18:12:30 @(#) ## Author: -## Earl Hood ehood@isogen.com +## Earl Hood ehood@medusa.acs.uci.edu ## Description: ## Library defining routines to parse MIME e-mail messages. The ## library is designed so it may be reused for other e-mail ## filtering programs. The default behavior is for mail->html ## filtering, however, the defaults can be overridden to allow ## mail->whatever filtering. -## Date: -## Thu Mar 21 13:31:27 CST 1996 +## +## Public Functions: +## ---------------- +## ($data) = +## &main'MAILdecode_1522_str($str); +## ($data, @files) = +## &main'MAILread_body($header, $body, $ctypeArg, $encodingArg); +## ($header) = +## &main'MAILread_file_header($handle, *fields, *l2o); +## ($header) = +## &main'MAILread_header(*mesg, *fields, *l2o); +## +## ($disposition, $filename) = +## &main'MAILhead_get_disposition(*fields); +## ##---------------------------------------------------------------------------## -## Copyright (C) 1995 Earl Hood, ehood@isogen.com +## Copyright (C) 1996,1997 Earl Hood, ehood@medusa.acs.uci.edu ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -40,67 +53,130 @@ package readmail; ## Variable storing the mulitple fields separator value for the ## the read header routines. + +$FieldSep = "\034"; + +## Flag if message headers are decoded in the parse header routines: +## MAILread_header, MAILread_file_header. This only affects the +## values of the field hash created. The original header is still +## passed as the return value. ## -$main'FieldSep = "\034"; +## The only 1522 data that will be decoded is data encoded with charsets +## set to "-decode-" in the %MIMECharSetConverters hash. + +$DecodeHeader = 0; ##---------------------------------------------------------------------------## ## Variables for folding information related to the functions used ## for processing MIME data. Variables are defined in the scope ## of main. -## MIMEFilters is the associative array for storing functions that -## process various content-types in the MAILread_body routine. +## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +## MIMEDecoders is the associative array for storing functions for +## decoding mime data. ## -## Keys => Content-type (should be in lowercase) +## Keys => content-transfer-encoding (should be in lowercase) ## Values => function name. ## ## Function names should be qualified with package identifiers. ## Functions are called as follows: ## -## $converted_data = &function($header, *parsed_header_assoc_array, -## *message_data, $decoded_flag, -## $optional_filter_arguments); +## $decoded_data = &function($data); ## -## Functions can be registered for base types. Example: +## The value "as-is" may be used to allow the data to be passed without +## decoding to the registered filter, but the decoded flag will be +## set to true. + +%main'MIMEDecoders = () + unless defined(%main'MIMEDecoders); + +## Default settings: + +$main'MIMEDecoders{"7bit"} = "as-is" + unless defined($main'MIMEDecoders{"7bit"}); +$main'MIMEDecoders{"8bit"} = "as-is" + unless defined($main'MIMEDecoders{"8bit"}); +$main'MIMEDecoders{"binary"} = "as-is" + unless defined($main'MIMEDecoders{"binary"}); +$main'MIMEDecoders{"base64"} = "base64'b64decode" + unless defined($main'MIMEDecoders{"base64"}); +$main'MIMEDecoders{"quoted-printable"} = "quoted_printable'qprdecode" + unless defined($main'MIMEDecoders{"quoted-printable"}); +$main'MIMEDecoders{"x-uuencode"} = "base64'uudecode" + unless defined($main'MIMEDecoders{"x-uuencode"}); +$main'MIMEDecoders{"x-uue"} = "base64'uudecode" + unless defined($main'MIMEDecoders{"x-uue"}); +$main'MIMEDecoders{"uuencode"} = "base64'uudecode" + unless defined($main'MIMEDecoders{"uuencode"}); + +## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +## MIMECharSetConverters is the associative array for storing functions +## for converting data in a particular charset to a destination format +## within the MAILdecode_1522_str() routine. Destination format is defined +## by the function. +## +## Keys => charset (should be in lowercase) +## Values => function name. ## -## $MIMEFilters{"image/*"} = "mypackage'function"; +## Charset values take on a form like "iso-8859-1" or "us-ascii". +## NOTE: Values need to be in lower-case. ## -## To register a fallback function to be called if no function is -## defined for a specific content-type, do something like the -## following: +## The key "default" can be assigned to define the default function +## to call if no explicit charset function is defined. ## -## $MIMEFilters{"*/*"} = "mypackage'function"; +## The key "plain" can be set to a function for decoded regular text not +## encoded in 1522 format. ## -## IMPORTANT: If a function specified is not defined when MAILread_body -## tries to invoke it, MAILread_body will silently ignore. Make sure -## that all functions are defined before invoking MAILread_body. +## Function names are name of defined perl function and should be +## qualified with package identifiers. Functions are called as follows: +## +## $converted_data = &function($data, $charset); +## +## A function called "-pass-:function" implies that the data should be +## passed to the converter "function" but not decoded. ## -%main'MIMEFilters = (); +## A function called "-decode-" implies that the data should be +## decoded, but no converter is to be invoked. +## +## A function called "-ignore-" implies that the data should +## not be decoded and converted. Ie. For the specified charset, +## the encoding will stay unprocessed and passed back in the return +## string. -## MIMEDecoders is the associative array for storing functions for -## decoding mime data. +%'MIMECharSetConverters = () + unless defined(%main'MIMECharSetConverters); + +## Default settings: + +$main'MIMECharSetConverters{"default"} = "-ignore-" + unless defined($main'MIMECharSetConverters{"default"}); + +## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +## MIMEFilters is the associative array for storing functions that +## process various content-types in the MAILread_body routine. ## -## Keys => content-transfer-encoding (should be in lowercase) +## Keys => Content-type (should be in lowercase) ## Values => function name. ## ## Function names should be qualified with package identifiers. ## Functions are called as follows: ## -## $decoded_data = &function($data); +## $converted_data = &function($header, *parsed_header_assoc_array, +## *message_data, $decoded_flag, +## $optional_filter_arguments); ## -## The value "as-is" may be used to allow the data to be passed without -## decoding to the registered filter, but the decoded flag will be -## set to true. +## Functions can be registered for base types. Example: ## -%main'MIMEDecoders = (); -## Default settings: -$main'MIMEDecoders{"7bit"} = "as-is"; -$main'MIMEDecoders{"8bit"} = "as-is"; -$main'MIMEDecoders{"binary"} = "as-is"; -$main'MIMEDecoders{"base64"} = "base64'b64decode"; -$main'MIMEDecoders{"quoted-printable"} = "quoted_printable'qprdecode"; -$main'MIMEDecoders{"x-uuencode"} = "base64'uudecode"; +## $MIMEFilters{"image/*"} = "mypackage'function"; +## +## IMPORTANT: If a function specified is not defined when MAILread_body +## tries to invoke it, MAILread_body will silently ignore. Make sure +## that all functions are defined before invoking MAILread_body. +%main'MIMEFilters = () + unless defined(%main'MIMEFilters); + +## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ## MIMEFiltersArgs is the associative array for storing any optional ## arguments to functions specified in MIMEFilters (the ## $optional_filter_arguments from above). @@ -110,8 +186,9 @@ package readmail; ## ## Arguments listed for a content-type will be used over arguments ## listed for a function if both are applicable. -## -%main'MIMEFiltersArgs = (); + +%main'MIMEFiltersArgs = () + unless defined(%main'MIMEFiltersArgs); ##--------------------------------------------------------------------------- ## Variables holding functions for generating processed output @@ -125,26 +202,30 @@ package readmail; ## Function that returns a message when failing to process a part of a ## a multipart message. The content-type of the message is passed ## as an argument. -## -$CantProcessPartFunc = "cantProcessPart"; + +$CantProcessPartFunc = "cantProcessPart" + unless(defined($CantProcessPartFunc)); ## Function that returns a message when a part is unrecognized in a ## multipart/alternative message. I.e. No part could be processed. ## No arguments are passed to function. -## -$UnrecognizedAltPartFunc = "unrecognizedAltPart"; + +$UnrecognizedAltPartFunc = "unrecognizedAltPart" + unless(defined($UnrecognizedAltPartFunc)); ## Function that returns a string to go before any data generated generating ## from processing an embedded message (message/rfc822 or message/news). ## No arguments are passed to function. -## -$BeginEmbeddedMesgFunc = "beginEmbeddedMesg"; + +$BeginEmbeddedMesgFunc = "beginEmbeddedMesg" + unless(defined($BeginEmbeddedMesgFunc)); ## Function that returns a string to go after any data generated generating ## from processing an embedded message (message/rfc822 or message/news). ## No arguments are passed to function. -## -$EndEmbeddedMesgFunc = "endEmbeddedMesg"; + +$EndEmbeddedMesgFunc = "endEmbeddedMesg" + unless(defined($EndEmbeddedMesgFunc)); ## Function to return a string that is a result of the functions ## processing of a message header. The function is called for @@ -159,13 +240,122 @@ package readmail; ## argument 1 to original case. ## ## Prototype: $return_data = &function(*fields, *lower2orig_fields); -## -$FormatHeaderFunc = ""; + +$FormatHeaderFunc = "" + unless(defined($FormatHeaderFunc)); ############################################################################### ## Public Routines ## ############################################################################### -##--------------------------------------------------------------------------- +##---------------------------------------------------------------------------## +## MAILdecode_1522_str() decodes a string encoded in a format +## specified by RFC 1522. The decoded string is the return value. +## If no MIMECharSetConverters is registered for a charset, then +## the decoded data is returned "as-is". +## +## Usage: +## +## $ret_data = &'MAILdecode_1522_str($str, $justdecode); +## +## If $justdecode is non-zero, $str will be decoded for only +## the charsets specified as "-decode-". +## +sub main'MAILdecode_1522_str { + local($str) = shift; + local($justdecode) = shift; + local($charset, + $lcharset, + $encoding, + $dec, + $charcnv, + $defcharcnv, + $plaincnv, + $strtxt, + $str_before + ); + local($ret) = (''); + + $defcharcnv = '-bogus-'; + + # Get default converter + $defcharcnv = $'MIMECharSetConverters{"default"}; + + # Get plain converter + $plaincnv = $'MIMECharSetConverters{"plain"}; + $plaincnv = $defcharcnv unless $plaincnv; + + # Decode string + while ($str =~ /=\?([^?]+)\?(.)\?([^?]*)\?=/) { + + # Grab components + ($charset, $encoding) = ($1, $2); + $strtxt = $3; $str_before = $`; $str = $'; + + # Check encoding method and grab proper decoder + if ($encoding =~ /b/i) { + $dec = $'MIMEDecoders{"base64"}; + } else { + $dec = $'MIMEDecoders{"quoted-printable"}; + } + + # Convert before (unencoded) text + if ($justdecode) { # ignore if just decode + $ret .= $str_before; + } elsif (defined(&$plaincnv)) { # decode and convert + $ret .= &$plaincnv($str_before,''); + } elsif (($plaincnv =~ /-pass-:(.*)/) && # pass + (defined(&${1}))) { + $ret .= &${1}($str_before,''); + } else { # ignore + $ret .= $str_before; + } + + # Convert encoded text + ($lcharset = $charset) =~ tr/A-Z/a-z/; + $charcnv = $'MIMECharSetConverters{$lcharset}; + $charcnv = $defcharcnv unless $charcnv; + + # Decode only + if ($charcnv eq "-decode-") { + $strtxt =~ s/_/ /g; + $ret .= &$dec($strtxt); + + # Ignore if just decoding + } elsif ($justdecode) { + $ret .= "=?$charset?$encoding?$strtxt?="; + + # Decode and convert + } elsif (defined(&$charcnv)) { + $strtxt =~ s/_/ /g; + $ret .= &$charcnv(&$dec($strtxt),$lcharset); + + # Do not decode, but convert + } elsif (($charcnv =~ /-pass-:(.*)/) && + (defined(&${1}))) { + $ret .= &${1}($str_before,$lcharset); + + # Fallback is to ignore + } else { + $ret .= "=?$charset?$encoding?$strtxt?="; + } + } + + # Convert left-over unencoded text + if ($justdecode) { # ignore if just decode + $ret .= $str; + } elsif (defined(&$plaincnv)) { # decode and convert + $ret .= &$plaincnv($str,''); + } elsif (($plaincnv =~ /-pass-:(.*)/) && # pass + (defined(&${1}))) { + $ret .= &${1}($str,''); + } else { # ignore + $ret .= $str; + } + + $ret; +} + +##---------------------------------------------------------------------------## ## MAILread_body() parses a MIME message body. $header is the ## header of the message. $body is the actual message body. ## $ctypeArg is the value of the Content-Type field and $encodingArg @@ -187,11 +377,11 @@ sub main'MAILread_body { ## Get type/subtype $content = $ctypeArg || 'text/plain'; # Default to text/plain # if no content-type - ($ctype) = $content =~ m%^\s*([\w-/]+)%; # Extract content-type + ($ctype) = $content =~ m%^\s*([\w-\./]+)%; # Extract content-type $ctype =~ tr/A-Z/a-z/; # Convert to lowercase if ($ctype =~ m%/%) { # Extract base and sub types ($type,$subtype) = split(/\//, $ctype, 2); - } elsif ($ctype =~ /text/) { + } elsif ($ctype =~ /text/i) { $ctype = 'text/plain'; $type = 'text'; $subtype = 'plain'; } else { @@ -199,9 +389,9 @@ sub main'MAILread_body { } ## Process message - $filter = $'MIMEFilters{$ctype}; # Specific filter - $filter = $'MIMEFilters{"$type/*"} unless $filter; # Base type filter - $filter = $'MIMEFilters{"*/*"} unless $filter; # Last resort + $filter = $main'MIMEFilters{$ctype}; # Specific filter + $filter = $main'MIMEFilters{"$type/*"} unless $filter; # Base type filter + $filter = $main'MIMEFilters{"*/*"} unless $filter; # Last resort ## A filter is defined for given content-type if ($filter && defined(&$filter)) { @@ -210,16 +400,16 @@ sub main'MAILread_body { local($decodefunc, $decoded, $args) = ('', '', ''); ## Check for filter arguments - $args = $'MIMEFiltersArgs{$ctype}; - $args = $'MIMEFiltersArgs{"$type/*"} if $args eq ''; - $args = $'MIMEFiltersArgs{$filter} if $args eq ''; + $args = $main'MIMEFiltersArgs{$ctype}; + $args = $main'MIMEFiltersArgs{"$type/*"} if $args eq ''; + $args = $main'MIMEFiltersArgs{$filter} if $args eq ''; ## Parse message header for filter - &'MAILread_header(*tmphead, *partfields, *partl2o); + &main'MAILread_header(*tmphead, *partfields, *partl2o); ## Check encoding and decode data $encoding =~ s/\s//g; $encoding =~ tr/A-Z/a-z/; - $decodefunc = $'MIMEDecoders{$encoding}; + $decodefunc = $main'MIMEDecoders{$encoding}; if (defined(&$decodefunc)) { $decoded = &$decodefunc($body); @array = &$filter($header, *partfields, *decoded, 1, $args); @@ -241,7 +431,7 @@ sub main'MAILread_body { if ($content =~ m%boundary\s*=\s*"([^"]*)"%i) { $boundary = $1; } else { - ($boundary) = $content =~ m%boundary\s*=\s*(\S+)%; + ($boundary) = $content =~ m%boundary\s*=\s*(\S+)%i; } $boundary =~ s/(\W)/\\$1/g; @@ -264,7 +454,7 @@ sub main'MAILread_body { $part =~ s/^\r?\n//; # Drop begining newline ## Read header to get content-type - $parthead = &'MAILread_header(*part, *partfields, *partl2o); + $parthead = &main'MAILread_header(*part, *partfields, *partl2o); $partcontent = $partfields{'content-type'}; $partencoding = $partfields{'content-transfer-encoding'}; @@ -280,7 +470,7 @@ sub main'MAILread_body { } ## Process part - @array = &'MAILread_body($parthead, $part, + @array = &main'MAILread_body($parthead, $part, $partcontent, $partencoding); ## Only use last filterable part in alternate @@ -305,7 +495,7 @@ sub main'MAILread_body { ## Else if message/rfc822 or message/news } elsif ($ctype =~ m%message/(rfc822|news)%i) { - $parthead = &'MAILread_header(*body, *partfields, *partl2o); + $parthead = &main'MAILread_header(*body, *partfields, *partl2o); $partcontent = $partfields{'content-type'}; $partencoding = $partfields{'content-transfer-encoding'}; @@ -316,7 +506,7 @@ sub main'MAILread_body { warn "WARNING: readmail.pl: No message header formatting ", "function defined\n"; } - @array = &'MAILread_body($parthead, $body, + @array = &main'MAILread_body($parthead, $body, $partcontent, $partencoding); $ret .= shift @array || &$CantProcessPartFunc($partfields{'content-type'}); @@ -331,14 +521,15 @@ sub main'MAILread_body { } ($ret, @files); } -##--------------------------------------------------------------------------- + +##---------------------------------------------------------------------------## ## MAILread_header reads (and strips) a mail message header from the ## variable *mesg. *mesg is a pointer to the mail message. ## ## *fields is a pointer to an associative array to put field ## values indexed by field labels that have been converted to all ## lowercase. If a field repeats (eg Received fields), then each -## value in $fields{$fieldname} will be a $'FieldSep separated +## value in $fields{$fieldname} will be a $FieldSep separated ## string representing the multiple values. ## ## *l2o is an associative array to get the original label text @@ -347,20 +538,24 @@ sub main'MAILread_body { ## The return value is the original (extracted) header text. ## sub main'MAILread_header { - local(*mesg, *fields, *l2o) = @_; local($label, $olabel, $value, - $tmp, $header); + local(*mesg, *fields, *l2o) = @_; + local($label, $olabel, $value, $tmp, $header); $header = ''; %fields = (); %l2o = (); $label = ''; ## Read a line at a time. while ($mesg =~ s/^([^\n]*\n)//) { - $tmp = $1; + $tmp = $1; # Save off match last if $tmp =~ /^[\r]?$/; # Done if blank line - $header .= $tmp; - $tmp =~ s/\n/ /g; + + $header .= $tmp; # Store original text + $tmp =~ s/[\r\n]//g; # Delete eol characters + + ## Decode text if requested + $tmp = &'MAILdecode_1522_str($tmp,1) if $DecodeHeader; ## Check for continuation of a field - if ($tmp =~ /^\s/) { + if ($tmp =~ s/^\s//) { $fields{$label} .= $tmp if $label; next; } @@ -371,7 +566,7 @@ sub main'MAILread_header { ($label = $olabel) =~ tr/A-Z/a-z/; $l2o{$label} = $olabel; if ($fields{$label}) { - $fields{$label} .= $'FieldSep . $value; + $fields{$label} .= $FieldSep . $value; } else { $fields{$label} = $value; } @@ -379,7 +574,8 @@ sub main'MAILread_header { } $header; } -##--------------------------------------------------------------------------- + +##---------------------------------------------------------------------------## ## MAILread_file_header reads (and strips) a mail message header ## from the filehandle $handle. The routine behaves in the ## same manner as MAILread_header; @@ -392,11 +588,18 @@ sub main'MAILread_file_header { $/ = "\n"; $label = ''; $header = ''; %fields = (); %l2o = (); while (($tmp = <$handle>) !~ /^[\r]?$/) { + + ## Store original header $header .= $tmp; - $tmp =~ s/\n/ /g; + + ## Delete eol characters + $tmp =~ s/[\r\n]//g; + + ## Decode text if requested + $tmp = &'MAILdecode_1522_str($tmp,1) if $DecodeHeader; ## Check for continuation of a field - if ($tmp =~ /^\s/) { + if ($tmp =~ s/^\s//) { $fields{$label} .= $tmp if $label; next; } @@ -407,7 +610,7 @@ sub main'MAILread_file_header { ($label = $olabel) =~ tr/A-Z/a-z/; $l2o{$label} = $olabel; if ($fields{$label}) { - $fields{$label} .= $'FieldSep . $value; + $fields{$label} .= $FieldSep . $value; } else { $fields{$label} = $value; } @@ -417,6 +620,29 @@ sub main'MAILread_file_header { $header; } +##---------------------------------------------------------------------------## +## MAILhead_get_disposition gets the content disposition and +## filename from *hfields, *hfields is a hash produced by the +## MAILread_head* routines. +## +sub main'MAILhead_get_disposition { + local(*hfields) = shift; + local($disp, $filename) = ('', ''); + + if ($_ = $hfields{'content-disposition'}) { + ($disp) = /^\s*(\S+)/; + ($filename) = /filename=(\S+)/i; + $disp =~ s%;%%g; # Remove semi-colon if grabbed + } + if (!$filename) { + $_ = $hfields{'content-type'}; + ($filename) = /name=(\S+)/i; + } + $filename =~ s%["']%%g; # Remove quotes + $filename =~ s%.*[/\\:]%%; # Remove any path component + ($disp, $filename); +} + ############################################################################### ## Private Routines ############################################################################### diff --git a/logo/mhonarc_t.gif b/logo/mhonarc_t.gif new file mode 100644 index 0000000000000000000000000000000000000000..106571504446025a194960c389c990febee3489d GIT binary patch literal 6773 zcmV-*8j9sdNk%w1VI%>_0P_F<0000a002lN0BuG9B$3+MZ2;Ph0ROT8|JVTk|F-}C z+W-ImB$3(x0000000000A^8Le000aCA^s*HAW3a-Z*p{HWFTg8Z*3q)Nk$-PZDD6+ zIv{OmZ*F07V=iZDW&kVz0000a0muMA1pbi8NvpkVh%K=HU?`4cX`X1Rs+=&apb*Tn zyvTH3>wNF`359Sdl)Yfc$smwa1&&SFQa~goe%LGx=MyXf+?posw0CJL&OF3#fWi@CcJC>IVH)uHn2c@Q` zsHKo~b_$JoWC97Zv}b!@eR}|h6-+R`yb=Jpwz0OfwP>#`tqQBD(5IC&WuP^eTQgDt zUuJzewgU#^RD^1eNqz?6eRJL=}**WlK}jrc*c@*gT!uMolJ~ACz`^S>dEaWlgC*)eu%}Nv%Y; zoPlx_;*tf^Xms-tt*%{EQO!OD$TmzD3L0jX)jNso-NSXeI9&6EZQI8#8KxnHxU%H~ z<2XnqEJu`AQh@q=U>F1vkH*CL2INySDAyxO3~?jeuN>0h=YA`8+rd z@D}8FD__psK3e5}H(ZNuwxCJB%mX(l?z#*qJlGWX?)C>R=DJ6{?=tY)#0oZ0h2N&|N3u(3mu-$EWnYF=`XpVCs7hb@}0p{$3UJt#b#1Ae0Z-_*K_RgH$-oA>EiopU2Gm8`VP~c(APq{wDJfD9rXgmcmpx(E zmILUPC2w0s6lhCe^7bii8ekgD5~eX2Xp)o03ejs0eNmYPh;^u*j?1kl>Q)p)$y}+p zxqz6lh}8;)bh7?7+g63tP=*<+fSp{jtGadh$l-yl$p&Fn0_4scJMTo)qc76cZAQ zCJu(E9KOo&c~rOz%gft8ekn9u#VE`77HsR}#xZZeu?F0{B8$kf7b~T#Gm{iv!}1I@ z)5d9wsiOLWiEHhwbjoZtB$2-oIlaZwEk=Fx6QE>$9g1qTAfF2k21akJV#7E}!bj=B z^)*_9G6fb-i{OQ4Lv4}uqqpQS+DS7x7{m})G=j#&tmPcc5-u)5%pZRXk$_fzEWUS2 zc(d!I-Tv*8aYI%EEYKyp&m}3O20uN{58qKGk`drQjop^(D+~ge1{pQpx)CrgzD(&Z z1jnIL)?H4`dnQ1e#lWYPvR*4d3C4Kijt6{|BKZu?3oyk`SiST8q(cYv3e3WNLEsA! zW%8vw>LB(>oGaNDoo@}!Kts6SNcqhx!beUzsjZ7jNI+XekYFK|_`xGNp$RNjR|V5i zj}G)J0#n=;D3A~iU=A^Z{CwsY9OcM&IO+!<`~j;H7-1AfDM9YgFhUM^@C{^nVHDF(})CRlc%@!W>5;mnoABp;D<#D9Jz7PcXn3VQj-_y!ge6Tt|y%z#VWk#W3Bmw9(?Ako=9U_yn!B~bm^{-&3)OdxUe2fhz>%U1uXGz{QlwZT zT4y>7KqcdCg>wG@8aUr1CmqmfN}a?J?TXbY=Xi3E=6M?u(HGJ&C9>!Y@z zmR(qNnL1%2qECgBYBrV9P4N^_46^_hECAN8ifgLSNR?H4kXEHBFgtB^YtX`4SA$K= zYZ!Q$VRvJwTUjj+W$3FMt+tM871n0oDW(at3MAzql~GO8tYj&MGY75evbDJ?!$fOB z)Vj>I2nehx(6YJFKJ}E@u|&sUt0kvejI+f8Zfq&CEN$5KxPY1IG+O?-hkLP>9)s15 z0g(hWYoHam*ga$Dpp>kA}y*pa92Pfiu%@c3v|#670}_lf9URj0k&9EN+Fjd(b1&kcc~6l~=_DC5SB5Hghc)yf8`*aIuG zMEun9Qa1cBVtRA1D_r0VTl9~540PNqHjqDET$vDAb_oVaX8r`z(ZUKoKA?^1OqMx= zVRGHmjGHNo4GLNUhb73M4T!w2RE72A4&*j5RY-2}zGVtRu68!d``35_VgoaFE{ zo7knrc|^gU6C9=|B3QriJ)v~7fHalC5)VAE`_C*fVf#Ab?qFL57mBD|=@R{i3`Y`6Ye-# z|0jhJT0-aAW1R~1_ZpxH;YK|uLSyH1$G%{B&f|oO{(R=GO6vqVj#NSs2XiAeHc+{& zXo&?D=OB$jZ{o%UBZ3;pDK&D798J>L$su#bJ}*`#!6}wz&Gl0TW=ZF9eD-Eray^k1 ziWE7ok=P2|nd|6uFMS@ZcC+ZWb1la7(#qMj0{v#~vJT?RrM`%U(3Qa#mq0^^f%hk} zv21S+E%0y<(>gxs(UTsbVt$mdHVMhx+S z?9MBh`Mz`+(f#Egdq*PcQv>@>+?yzWSsQi!1LSDk4)pCy3#~SVfe!Sie(P6F2PJl* zu}A?JOTd?F`XCqg1z(Z}79RpX30Q$b^EUS3eo*o`D`kNdxLq4~ZxHwaGu3350Dv9{ zOyHq`69^(KxKhHEf{fK-HiS8;HiCtKYpM~03sNI~Hg`M_90fQ?FmxhTfd@8Xf!lO6 zk%faJz)Ee>IRX-cv&3M}^be&6ZUYwpg|QPRW+@3mg#-5<*D-!hh+oR(e~N(v8t7kW z7frmi=fy|kT{All4QAeDYVEc zt`|)n)l*;cGk@|esg-`oND>1BgS5z9)3^h;s4#Oga4c0-sjyIL1ciZtNYNE4gThs? z7>nW}j~hihbzvwMB_K&=d+De`6h(AlXd}pT7-E$Q)`BHp6)av75uD{!VS-ob<9ra4 zkUj`=y0>Emi2=q#N7vAh44F}Ra#=p*Q9{L66QEi|g;jRpj*Mb9`mk*`7?LUAOpVei zD4CM!XOXz!D=*1a!XR7^iT)~|6%FH3R;`!~I{7ieV=I=i9=UQ^GqW6HBT^EeSf~Py z8kq{`V;Qc5Gg0|EDpFaf5tgX11meOS_Lu>X2L<`~mY%|v(twxgV|1x>mao$T&;TCQ z@>YZem&~RF*r6oe=vnE908L3%;s6b*;g{1j)86U54dJAb)z=Cko3Y4^sQ01&VgsSo z16t{!0>)dW#3tRqqEth4TgYa6@FoUSL-vqSI@Vw3}f?$KQ#+LtDPfmhQumiC1h z(VHyiI%E+mQ2`hifpW8hV%PLwT62dxfL1+IM^3f|#Q03Z0X?FqR$&@I4ys^L7Csl_ zh?>!KkaTALy|ANf=7>Hp5DB0R{N$g9W2&u@5+o-Cpt=?7xh5A^L73v1op=W3zszV0j!ypa`j5D`Su80 zNEkIlP6K&ZCc|ldA+6CQWK%XiAJHJ*c?jK_X)Hu&05N4khOk8TsujU}AaHc`v3xxg zLhPaL$M{x0pR0{0+p^vR}i-L0R!1&VV4azkxr2Ht?v*3 zKSBN$$gp=S+pC4+UdRv?KOwZspsRgX68eR#Y$K#134Sj31aQh9dT9zz&YwxnR~1tE*?lmT+W+KBLP6?#TjaVXM#SltkM=_LFa`>u>;ZW5nRN zd}^Z3iN+D;Wp?pzoHwwg3)?7KyHqs4&Ul!QELqB z_NWAuuk)sL{SgrM)d=?10;_5VbF%b)*usFJkrMLTQ>hQrtpn6&ZaI^#&TF61Vw+{3(s`?8(d!{>OfKnn%u`~?1 zauYi-!4Bvfj(-IYw<|sYA;f)pliWCV5L&Fd9?|O>$5&A^<+(x2Zban3P}a!(=C;yHmw}dO{w$;iGUUcB z@W^J?h?iy!l#^fHwj`(IG~-KnUJ}XWx)=Ju6KcQ`W>b<`W_Kd7Aw$GTL+7f`DmIJJ zEVIlv!gP+|2(YcJjAlA{CCsOAb6t6p!@3;Fug3+_NJVgT$iYyGRAhK>_pf2pJrhf& zS~^VvRISj)bx#I$xd}H|D=Tk-fiJfXp`mt==5|omcxDh8hpY?_MwGQ$Ac+wd&6kLo8|h#IO=JSHa+6FomZF8l0kmMy zy%7CEHP;Xx*8+F_j}lQybkxpI z)ne?i1&N(UK%L9Q8ViTrlas9|6rm7~eS4Z_Pc*&Rm~p;>{X!P@189)ZdQ-lneE^$x zL)j`(w6e8GLe&mAC0=0=Ahk&;t&DPb%m-*ly`2yofF{WUr{Gx;uxm^v)0_jhj6@P? z7}_ho-PU3h+*U%|u|(ZcvUe!Va-VHmM^b(_lO!^@C%*n&%uu1-ix^7i`AdxGsqZt} zef1XZ1U3{A-zm6$>?a39m`jwPef;f#d;%Li?GOho(oTj08+4-S4V&xT-o)|9jS}IQ z^c>&m7dh*M9BxI|P~aG@B?i^H!CfiKIO3V~l*-!RxM)LVq@OC@9Lh}%a)?VtAmS<> zOl!ECk*EQMEHI5Zf2Gu6wppzDOS{jAiyWOD*h{|rWqm%9cSj?5OaiX=NEPhyq#I( zQ4R9rIo*i|OeIKzlT`=-C9Ue}L^jL#r%sdL>39ecb9)aPD3=apjIk2jy_(i%q~~?U#`97H9o_mtCt5;>xulhpAPr)%)r?ycO0p4Nc02 zw%V!}jooelj0m9VnqV{R9*+_&?tMc+R2mdlSR#u+>!ugxkXN6Hc!>eCrMIv)b(-&O zihf1n@BhAv(?n9j9qSE$I*PI2Be=%pL5r67LaNwXE-jSsn2HVciMFU@OPYscjp(O1 z@5WJBD@BaQ?Un@P@yrMwKGO-l?w93F{>?XU00A}6iuEZVI2py6FD@@eCC`guey~I8 z0&BtrKOgi$a-zDjNugLOR?prxQ4>G^sZe5u4_bq1@$)pBcA6MlA`>d^_a$S3iCjMk za$b&~*CsfoL5`oe*mv55I670fr1$Npk=Lk3qmh0iYLDDl2(V4UjBV z`qt2-NsMi2;*Vps6H0ARg_8NbQ4e!9__@(1`JyTkr@ zGy?-#R63u&=`#|Gsx8|0a+eeM~s8c*6ub?nBJvN8m2i446j1N zL&U^GiUk0{Bm=)A0lzzzJU0XbfGB}5uqXhYOax4yBBMRY5DkerfQ1UhS=w6LEdfU{ z&&XAgC%+gsVNy*_8bPtpQPLf^zBCD6k(f__oZD>eZA1!3&)8|T0Ljfvfnt@IxX&B7 z8Rv9#H&IDoae>&1>j3_4|9^m0z+Lm?X__iCOELvWrwLn)cA#`HBgN1S8A%-u7R;qD z;75?$U@3iGBnAYdqjWO36E!XbiW0p;4&3qNEYNCXBX6 zYq*KsnzjOXEUFYc{EosZ;m^j!liSa6wwxTHPe7wa$!JL}_+Dc5z+o_l%#LCWW^ z08W}FhQpAuuC!WKYskSDI@k{dTfujAgi?H zn)ZmCfG8!8bnO=2&dDzb6hjar%UrBflNJrf80rk~x~x$|MVfrFn4Ge52Zt5c^b?T* zlX)$rX119F#~DhD*QPCQO^gT!D-YqMJj*NJ}+jkPD*Q zDb8jR{!C{{Aw7-IOBKHPYo`i!GIiHNJQ$F(UD9Ip)zq|+u(-y~8MUBT>f`lUE(QSW zC8b=YkIq|6B!$zsUh)PiXv57yf>>~S;;iD-`Ut{`@@sSq^S~8%UMxBwkWv_EWkFq# z*cDT}hzgRIUV^P?sz9f9&;S5y&jQL{Hbl`N;cuQO_+l-dU{4q3azU)CWJw`Ns~Fjn z0ArN3kXBVK1yNEvpF-}z+v&bd`R0rX;>g#$vs4UjbH7 z&EDO`lOA#KPid^{wN+Gp+If!TTu54V;H=AD%jje(AUm^zXWMCQv*WHp4gl)L7QI{& X>ZSm0x%>9}Z@>c=d~m|kivR#SKTKB+ literal 0 HcmV?d00001 diff --git a/logo/monicon.gif b/logo/monicon.gif new file mode 100644 index 0000000000000000000000000000000000000000..a0a9161391e022a624a64264cf74261e453ac8cf GIT binary patch literal 452 zcmZ?wbhEHblw}ZM_#(-`%D`eGz^1FLCaD{)=b!H_!jNXf9q($WlD9-++9#EXHHhEE$9eq3Pq|AFDy{wYAk3>ZN1CkrP7 zgCv9EKQ#pf&)kCiqLS1Ug|wplTm^SeH-*gH#Pn1vh1`t%yu_kpz4Xj91|5(YAlEst z{!>trX>u^}nx^QnO6$#SfrA-6AO z0XwDs{3RE-4scB@u~0ga8_w$G`cK+NPsH-tT^A8;Q3*z2J|;cQb|yYyMu`U3sDh$m zfh>k3fyveRmP~9SnSzxJm6;3JnCAE~3lxir^D^^_ujBVw6>TCA#pSp?-PWMg4qVOu!)(Hy5>+X^;@`JaPX z8FxssGcq!CgfKBYWOQKo&-dZ9!h?e{2KEddD-u>QwS;i72L?VQyp-B+b3j~aS7&%=pXU;tHJTsx;A;Niy)gT3Y z24Fe>Rz$!>fCB*b0N6pm0Rm10FariNNPtfQE(maf(kg0 zj~Vc?gnTT)0vq6K1$-?TbIqA97F>Z9+t-RCv@&1dK=XF6bak+Co#7~$>Et7D_4S-3 z5P0!z>;k8OAS)1RP4u763FLt=2M}Tlf*s)~M-a|Om-3?&n?GiKJV_g9FEePZVfo&1sw`d@ZWG@ez^=r`F@JR195&V=e zVa76#EvXK9DL&HV1*`n6`SZdsAAezJq|d^o?h#8|qElwarn|?bdo54*PDpiKzD4kB zmisS>zRBsr)myD2)5S~0>z0ORuZT)nxqRE|WtnTlVXHR;rfylhE>oJ88j~33=kKfV z1tlRs8377Hp#zaX83RgUL2&}8hzEO?o7csF=B41|GSCnY+LnQft3b;VP!kPGQo#O1 zP@M!F+5jrkh=(&lc_!GM!L3^dPNabo8K5B#9LoV0wu81@(3ELXu*s!25ey`Qp*7(C z25>tSjHQFpoY)fC+Txt_W+gb856%{V?sBMmKj@W%n2y z*O$PnUhv@>_;L+=zYV_M1^?a$|BZsrw?SoL+yTYn>f+RLmF#%M+U81GOKoPITH>@y z<+`TWHMwwZTG6cZa_7`?_ljEdwXSUco6)5o9$O31i(0O{lAR=!vsJl!4-;in3^Y?6FJ3W8?9&&Vp^Z?`osh2d5Xe3?H1* z(b$=G^OV#gL(vCcK#WYWbbN(xvY$0yq{sVEm%G$WKhC7(ldYI^Iwq-mI4>z_#!Iv4 zJe{1x%EjlIR!=-(+iRn$?~x+g+e-U_`-WG0o4wq3dvd7{+<@ehYKn`!Fn@YW=0w^{ zFN3b2fPMYqx{o2j3Wa4#sze7NA_L5L$vAd6)iQqXLholsd#tl9<$b%C5$bpDbpICq zzuoTfg1M!U51adAgyZ%8HpI#H?5-#QO^{L-j9HL-v2+J_eXakRZY`EgWoaCDyzcAPic>`F>Tc&<(fBPrr> z$VyNi;}M#rhb(O9y1sb_1X`fj~xyj zEh_Wu&+maOT)4{@Y7ns+w$6R?ZqQzxMhkWPi)%VSoGoyRvY4(l1kh${MM}<4)>w>i zNMid>@MFpC8^^7;-6`P+8n4f$P2cAhWjZ^GRp9nlEaA$TM}Dn^)1=QtJy7rdJ1?jy zQWn|mUJ9|)VgX+xhhbN79~Ef?p$_}{T{CZ#jmS%VUaNWnXs)q_Op^H4u&Kld(nxrA%M1&l#|GAYUc&6Fr@%v6QGgSN~7R6*a*D~X7GO7=_c zxw!&YIA{WGo}(ddrSfuCygWm@c;FLp3Ul?xO|eT+|G3ha5=lj%&C4(X^^jRJ`hK`A_hK~_Uokcs3ddz0n5P z4JG@GWYDcvTq9+4>llO3p5KnvQRK4A7S~m~e&Gfn8;{qTvtwsDrzjm|d-trAi3%PL zYD_z{J7?#tqs9N|;fiw$9bKi}=B`h;0?q(KjCG>1fHajSr_S3v_;y>9Ix2=tIlN4c z#^WS@ryL8Bl{j`AWM9^!}QhhK^FJN zr+I`KW<)$?}H*W)0i`n8zbK3hzQ< zS$%BdJLQNG;CYoj)`BM#v1=`}S2Q`pZP1^YWDx!8mwEgH_IW6~g$8fy))DP+h~+T8 zlJu^?eXloj!u>4oaTpoJSaJ%;CU6aj=Us8(yI)7vzU}Qv+fW>pIFiWL81rX5$CS5X z-$naD0zmTl-ls{V0$0J7&7itSkRe%j?3+q7ZB^FVyVE?^3=9B3bM3 zSKB4jRb49g2LG~kqf_nws31(Y*8xP#>&?HOsw`*GQ#j*_Maex=vb-g-*r%7cDmho7 z^dVKy>9<%%V-xra)Rh-*p$(e1Uc@6cX6j-rL+GV12#I0sHqT|f`sZOCoH$A6)KfUe zFM^$lDeZ3H1CznSb~`sNl@Ubt)_Tmj!>MBYS}(eSevP;~@$U)X$uD$tS05z>iHLWy zZiqO}J1O}E^GjdhQ|S4nzjck<45;Mt2OY#Lt!An(=co zrJ!%B|Cpe^hLNsHwv0Xzrkbb!$8b$EQa-xe;cqp}>DSN~YGX+&v>W68XDIlKOFlPw z>&Y#c(*ZFxijy7lSsTPXWI>gVT`DQEAGrkyWdSyS>I%F@6HW3`mHNlV0_#DMN!{y5 z)3Sk*BE|SVcVMdq!4_)E>(HcgY zEYRjKu6!uKpL-m^XwIgk0k@#Jndt$Ktkx8C!&5*XI1(?{aL?k+?ieEH;5DH zEFAQAZ{8U81YY$Tx9#8LZCe{<+#c>5EEy297-lUiZ-Ktd>Z{EnE1k=O7( z|5IE*rcA*ch;$u%0Q5kcb>EH#_P$s%{gA^aJ(;VnfDSr^3C~O#Djoi}n#LIpss3&Q zaocO&v>xdHBYDpEuxAFq>&!>UIGE>%6ZI^2BfOEsNYy=~{d5@8)3Gh(MxQ+rWS#`M z?X-<^WfNVRUhBym6A@@q^STz`pc5t#<))%djLx~Q&f}?TPN2}cZInQ0UX`#?=iF(?W7*bH;&eAW^<*9fMk60k4 z)}~MoNl+Xk2H>;y9?Rz#&1h;Ue=cDqt8g>A=&BZKZv$Lu;ki3xsqts&$RQ)uZ|W~c zFeKfG+J5nTH5WExL2QF!TuNHcw=|KG?2|}0QXvl=9>%Ba(UUWclpdM*w4Rd5B5ndm zx@f@(6}0ewz)DS@!!3r{%%ui6ssW175~x~W0$^N9ZIOtLAE_z>xu|n@WDdj>JKf^* zYj1-Q)PX65QgTW@XCoVN^fXW1&7mCwC?@iuY6%g>9i9gGCVx*|5;?DR*ZCYG6`LeN zSIdmCw8Ns30abnpn(#nOB8seuVp8M;sOa4NNQfL}l?p6qff^7hlI3(dt-*eqS;T%I zC3|TBLj>&?(HTZWaJ7v17uh7a>|J2S6fr4=S2VyTE#X1DitT#rs-pM9iv1zSDltd1mMUnzCtSXy4(V`*l#VzkpNyu zwsTc?EUiks6?zF->PX+NR9UeZi5g;Ij@+GvHcX1E&xmQQ#zT)SX!VAK0u~ymfzO?* z_Gm*m0Q5tEqm%8Pd+_o+qFjQ$TtaODhaX=()FGkDdGL4D)(93k!v4_VUV4ZgV4r_6 z!C)0m{ozbIEv1&QRC0AqfdQ$|QkpficJ0dNjn(0wQFFuLS_qgM(UXNpcV|MohSsd5 zR2Yzn<2ASrJ!Yhu?xL#nD}yIsFFgps;?M-n9TtJ1hy0}8!~n>fhh(Yi%)QYHHKo}= zO?X8;r>9*q)?d=my0lbWQktzU_eieg?=qixt@da+-i@LsG_-Eea7j-)r>#GwqgLV+ zrKlbkA)7VuqlLAO7BzOEE|%)A>N{sIXJYz8vq>2(Vp}+BAE%tzI&g# zpr)96*t_Uq!~m~l9r~wp@;T0v!;+z<{{9w03K0=S8#=IyBHopcuP>h5? z9eP4UD?Q(7{~7@z_<-I?pj)7L?R+nF^Az#9KvDb9Sf|>BdIG0pun>Pep*Qi|`6uqV z(%Qxdx0xCqQ8#TCi+HJ+azb~$p}0#s*+dHjT~jdL5O+^YBkNno4w>K}Xn2Tp(S5E_hI}t8m7GrIip6v#o+B2)j)0N)>8cq0H{Hdm=d9fSK=);X}`ycGW&J# zjI{tWAWfjQghg~#gNXNb2O^>Bt3DAg3GD&i`Jp7rq?kont`G84yTh z4M}cn*IimyReB-dIN7?NBt9pL0n>TpvuOnDsOu-c(i2(aai5{r{=6ST$Q0Yu)roA? z=QX?{uZ~2SMdl0-rMxLAomzOaJ=uOv0I;yW>HmCanmftD&>#3C-Oo#d z@rWCFKY0$`q(xpidz2f=6?)o5-mU(aTNm}T3M1KKsBo)slI+1FZvIK0`YiJ=dWNyr z@gTI=xD`Fb)=P<|xQ?jbV>$~7V4%e;>QNE(hzR+1Fl(1wh!*%Sm;}{GN3yrwuaTmE|M1+y zLYkzWre)4Jq&6g-e)3_S?L-pPqJ6C zAm_z8f7V!+&Aly}(W8M#AVym@xtmf4h!=~@X@FRVQ^fOWfg;50E4sxndOez|VG)Vj zyx0a(-v#!lga|KM5Fq|D`z-02}>y#51JTS|Wjlm~$lrLknI*b@9^j`Uv z@^RZp0PZtmEpb%;r=^^cqya1q1hB^@7tsL2!_0$^4;t!E;*{iFL?@B86Hd(BML8)w zc2Hxm{elK)QImz#001ljMCFmEZhXQ`BxNuN>$Fgy(Qw3w1WJ)Qm=Y*{dPzg8_(nSc z$oAN%Js_Vj(mJjkzkrR`M^kbz;tp`{<9wo(n#|Jx3kfM;(#uN^G1X4q`17tul%PW+ zles#di{rIQ-SLY&>hWz8j<}pECahTaN3F4`3qv>INc~KT-xo^qBg(|T6mLBgY5+D8 z__XN@Gqz8n7?4GPBSE{~CS>7}|E)t)WQd{(&IETaVKk-T=Lthyqa&$qlGf-aR{EjC zhwf&w>a(PXUn=^C^DkNW%C2;jqwglM$Xb_I&{@B7i7mv3H@s5nme{nrPpwe+PwK0H>F&c?ypDhV4U z=+kK>XAKk;R(?iI-6d*w`nk|`#CsUSO7i}Wgb{_`ZKaO4Hlg*}$QJdx-+vPmH=!HV zgyqX%)d5n)zaQ?32m*~|P8)m#`_R2Fq=EH|N=sQaMyoR3myA)@OIfDcf|)gBH)cbV zhVr$Gl6WZ+qJ5|7TO*w5id~ z@3dMyi4lHlWRz4ZIo72{4gVpHtY4~dwAHv+qlFcA(0s!u{So#Uj{sr}KV@KRnoUsr zhO(M?bkn-wk=OU<#MI?QALKU`3uhx_x=Br`cR_d?lr^hOQ?F6DlOq$Rin!t*Yb;Ahi)$o=m{k` zwjX+s#U5{t>YC9-B^Ez-5!GwPn(l^$=TD38w;@@_8x1u>!(YU``RkVi9!~x9)xPkj zbCy=m_~qG>)T$14GQywaCZ;FYuAH$oJ;}2ru3_P9cCNca&TLahzhQy>!R4PfYVPSq z;@N?wLkU&f`SVk!z78LmvE#3#q_-9bJe?txt=V0)y!`jOy}xhMn%PGWrmx%8QcLD; z=zeqwvA($rCQ)DdURd(VWM<>xDbWMLrYjCs*VCn^+pjg zwT^RteNCMo(u^X0>`>w^OSYL%LSCG9j?}mC#tBkcEM`eE?Z6h*7ys0aPjFbIYB)AK zHshvwR7ekhYLMhj%7Oz?l}~U|kftEWC6r!BqjFLurSaH4O4B0FlT!0wb=E?TYwi@M zVr1Ij)6*GR@#NK`F&yW&^Mc>lZ7lmYsj?0t@eOwUE+)U-vS8-*>(mPr@vgQZYYwKG z`SS$f9FM#zrq7WZjhQDS%YB(maf&Z}EPCEEokh^9M?;ou%Rz~PlM=ruYQg3jw=&=8 zYyGq%trm&-X?gGMOkZq&;>Z^4xO&;d&om&YfHPxI1F^@H9m{*VE1#;SrOJ4v#{NKJ z`PHiWk)t;n-Z>wfbq32iczb*FaNJ$&YDbfBnx>}EzQH)KTnY6xSX)_&-_4%DdV|?3 zDJv9CM|98&r}X_gPTdMlrP18@x1trYy4Let@_TV_2n9h^eceitMgI9!v0pbWi=MEK zuofSfeCx=zYqKQoJHNh236OnZTUH;FZzdBFCi-+m_YBW))76K@>&w=b<~FeNoUR3# zmM?PdXyP%YfEahAV5{|pftPZKT5w_}D{9MC2hSJT8To(IHfN+9SiS7(v-``QDk4m& z+?R>;p7E8-sy#~$iHfFmgkX0SQYq|xSvovBWe-Bx;#tR5II1WzVG^U*dDXImGxrGt zlpN#5u1Bku#(b7y?p{=D?1vYle96s)-@7>iVL;JLS;MarYkFU5{KCquj*iE8E&FsJ zI-hidW<2od*@IPUEP~D~e*Kz9f7q0hQ0?Z8>F~{~iY82Nx%Cm>WA9Jt9=?`Ve7U=R z(vMvn_rqm}4Y%*j%N#6&pA0J!bZ{1i*r6w*=%~rq2zcPT3UetUj4< z8e=JfO8|Kd?!K2?ox-pb0hkZSMHQE4PJ!qz3<}EK!D!ElNlDi#V9!2L5o{;X0Qe_0 zd!|mfjDOlK-6{8@$^h%<$+j}7-{sfFBuVe>oeoJv?shJLHO)|i(cf4NA6?<47tvYz zU49G@a3zlt^$5L_)dmzAYxOJ^3uatVI8C&>kr=)JaWSe0I8KTCNH8xN9o!hQ7hUnO zcWMRbjb~~J*1jTmv04)FWIuyHf)h-HxQCSvTfp+CIy;tl9TgE5+>kW1`RZW480Pb0 z>)X!{aNRXH9LA&jNnSx-*n-c3WY}*JZqmz>|BQf>I|pL^GA~UP)euajz@&98ZnAUn z-1ixxSw1=#iP8|ns)FU0yZjc-3X{W(FdPn&?o2O9wTffO;VF8+4D+XjJbF#MaGUOu h=TEzX4DUB9gdpJa{{RBv_mBVp literal 0 HcmV?d00001 diff --git a/logo/stamp.gif b/logo/monstamp.gif similarity index 100% rename from logo/stamp.gif rename to logo/monstamp.gif diff --git a/logo/stamp_t.gif b/logo/monstamp_t.gif similarity index 100% rename from logo/stamp_t.gif rename to logo/monstamp_t.gif diff --git a/mhonarc b/mhonarc index 8ee4b4c..36507d8 100755 --- a/mhonarc +++ b/mhonarc @@ -1,19 +1,15 @@ -#! /usr/local/bin/perl +#!/usr/local/bin/perl ##---------------------------------------------------------------------------## ## File: -## MHonArc +## @(#) mhonarc 1.31 97/05/22 18:54:39 @(#) ## Author: -## Earl Hood ehood@isogen.com -## Contributers: -## Steve Pacenka , -## Achim Bohnet , -## Achille Petrilli +## Earl Hood ehood@medusa.acs.uci.edu ## Description: ## MHonArc is a Perl program to convert mail to HTML. See ## accompany documentation for full details. ##---------------------------------------------------------------------------## ## MHonArc -- Internet mail-to-HTML converter -## Copyright (C) 1995,1996 Earl Hood, ehood@isogen.com +## Copyright (C) 1995-1997 Earl Hood, ehood@medusa.acs.uci.edu ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -32,21 +28,34 @@ ############################################################################# ############################################################################# + package main; -$VERSION = "1.2.3"; # Version number +$VERSION = "2.0.1"; # Version number + +$VINFO =<= 0) || $ADD || $SINGLE || $EDITIDX || $SCAN || $IDXONLY; - $FMTFILE = $opt_rcfile if $opt_rcfile; + + ## Require needed libraries + require 'timelocal.pl' || die("ERROR: Unable to require timelocal.pl\n"); + require 'ewhutil.pl' || die("ERROR: Unable to require ewhutil.pl\n"); + require 'mhtime.pl' || die("ERROR: Unable to require mhtime.pl\n"); + require 'mhutil.pl' || die("ERROR: Unable to require mhutil.pl\n"); + require 'mhinit.pl' || die("ERROR: Unable to require mhinit.pl\n"); + + ## Load default resource file + require 'mhrcfile.pl' || die("ERROR: Unable to require mhrcfile.pl\n"); + + if ($DefRcFile) { + &read_fmt_file($DefRcFile); + } else { + $tmp = $ENV{'HOME'} . $DIRSEP . $DefRcName; + $tmp = $INC[0] . $DIRSEP . $DefRcName unless (-e $tmp); + &read_fmt_file($tmp) if (-e $tmp); + } + + ## Grab a few options + $FMTFILE = $opt_rcfile if $opt_rcfile; $LOCKTRIES = $opt_locktries if ($opt_locktries > 0); $LOCKDELAY = $opt_lockdelay if ($opt_lockdelay > 0); $FORCELOCK = defined($opt_force); @@ -156,8 +218,9 @@ sub get_cli_opts { ## since these options may tells us where the database file is. ## $OUTDIR = $opt_outdir if $opt_outdir; - if (!(-r $OUTDIR) || !(-w $OUTDIR) || !(-x $OUTDIR)) { - &error("ERROR: Unable to access $OUTDIR"); + if (!$SINGLE && + (!(-r $OUTDIR) || !(-w $OUTDIR) || !(-x $OUTDIR))) { + die("ERROR: Unable to access $OUTDIR\n"); } $DBFILE = $opt_dbfile if $opt_dbfile; @@ -171,9 +234,10 @@ sub get_cli_opts { $LOCKTRIES-1, $LOCKDELAY, $FORCELOCK)) { - &error("ERROR: Unable to create $LOCKFILE after $LOCKTRIES tries"); + die("ERROR: Unable to create $LOCKFILE after $LOCKTRIES tries\n"); } } + ## Race condition exists: if process is terminated before termination ## handlers set, lock file will not get removed. ## @@ -185,10 +249,12 @@ sub get_cli_opts { $DBFILE = ".mail2html.db" unless (-e "${OUTDIR}${DIRSEP}${DBFILE}") || (!-e "${OUTDIR}${DIRSEP}.mail2html.db"); - if (-e "${OUTDIR}${DIRSEP}${DBFILE}") { - eval q%require "${OUTDIR}${DIRSEP}${DBFILE}"%; - &error("ERROR: Database read error of ", - "${OUTDIR}${DIRSEP}${DBFILE}:\n\t$@") if $@; + $DBPathName = "${OUTDIR}${DIRSEP}${DBFILE}"; + if (-e $DBPathName) { + print STDOUT "Reading database ...\n" unless $QUIET; + require "$DBPathName" || + die("ERROR: Database read error of $DBPathName\n"); + $OldAUTHSORT = $AUTHSORT; $OldNOSORT = $NOSORT; $OldSUBSORT = $SUBSORT; $OldREVSORT = $REVSORT; @@ -196,6 +262,13 @@ sub get_cli_opts { warn "Warning: Database ($DbVERSION) != ", "program ($VERSION) version.\n"; } + + ## Check for 1.x archive, and update data as needed + if ($DbVERSION =~ /^1\./) { + print STDOUT "Updating database data to 2.0 ...\n" + unless $QUIET; + &update_data_1_to_2(); + } } if ($#ARGV < 0) { $ADDSINGLE = 1; } # See if adding single mesg else { $ADDSINGLE = 0; } @@ -204,6 +277,7 @@ sub get_cli_opts { $OldTITLE = $TITLE; $OldTHREAD = $THREAD; $OldTTITLE = $TTITLE; + $OldMULTIIDX = $MULTIIDX; ## Get highest message number if ($ADD) { @@ -228,51 +302,119 @@ sub get_cli_opts { &read_fmt_file($FMTFILE); } + $RFC1522 = 1; # Always True + + unshift(@OtherIdxs, split(/$'PATHSEP/o, $opt_otherindexes)) + if defined($opt_otherindexes); + unshift(@PerlINC, split(/$'PATHSEP/o, $opt_perlinc)) + if defined($opt_perlinc); + &remove_dups(*OtherIdxs); + &remove_dups(*PerlINC); + ## Require MIME filters and other libraries ## unshift(@INC, @PerlINC); - if (!$EDITIDX && !$SCAN && !$RMM) { - &remove_dups(*Requires); - print STDOUT "Requiring MIME filter libraries ...\n" unless $QUIET; - foreach (@Requires) { - print STDOUT "\t$_\n" unless $QUIET; - eval qq{require "$_"}; - &error("ERROR: Unable to require ${_}:\n\t$@") if $@; + if (!$SCAN && !$RMM) { + + ## Require readmail library + require 'readmail.pl' || die("ERROR: Unable to require readmail.pl\n"); + + ## Require MIME filters + if (!$EDITIDX) { + &remove_dups(*Requires); + print STDOUT "Requiring content filter libraries ...\n" + unless $QUIET; + foreach (@Requires) { + print STDOUT "\t$_\n" unless $QUIET; + require $_ || die("ERROR: Unable to require ${_}\n"); + } } - ## Register message header formatter to readmail library + + ## Register functions to readmail.pl $readmail'FormatHeaderFunc = "main'htmlize_header"; + + ## Check for 1522 processing + if ($RFC1522) { + &remove_dups(*CharSetRequires); + print STDOUT "Requiring charset filter libraries ...\n" + unless $QUIET; + foreach (@CharSetRequires) { + print STDOUT "\t$_\n" unless $QUIET; + require $_ || die("ERROR: Unable to require ${_}\n"); + } + $MHeadCnvFunc = "main'MAILdecode_1522_str"; + } else { + $MHeadCnvFunc = "convert_line"; + } } ## Get other command-line options ## $DBFILE = $opt_dbfile if $opt_dbfile; # Set again to override db + $DBPathName = "${OUTDIR}${DIRSEP}${DBFILE}"; $DOCURL = $opt_docurl if $opt_docurl; $FOOTER = $opt_footer if $opt_footer; $FROM = $opt_msgsep if $opt_msgsep; $HEADER = $opt_header if $opt_header; $IDXNAME = $opt_idxfname if $opt_idxfname; - $IDXSIZE = $opt_idxsize if $opt_idxsize; + $IDXPREFIX = $opt_idxprefix if $opt_idxprefix; + $IDXSIZE = $opt_idxsize if defined($opt_idxsize); $IDXSIZE *= -1 if $IDXSIZE < 0; $OUTDIR = $opt_outdir if $opt_outdir; # Set again to override db $MAILTOURL = $opt_mailtourl if $opt_mailtourl; - $MAXSIZE = $opt_maxsize if $opt_maxsize; - $MAXSIZE = "" if $MAXSIZE < 0; + $MAXSIZE = $opt_maxsize if defined($opt_maxsize); + $MAXSIZE = 0 if $MAXSIZE < 0; + $MHPATTERN = $opt_mhpattern if $opt_mhpattern; $TIDXNAME = $opt_tidxfname if $opt_tidxfname; + $TIDXPREFIX = $opt_tidxprefix if $opt_tidxprefix; $TITLE = $opt_title if $opt_title; $TLEVELS = $opt_tlevels if $opt_tlevels; $TTITLE = $opt_ttitle if $opt_ttitle; + $ExpireDate = $opt_expiredate if $opt_expiredate; + $ExpireTime = $opt_expireage if $opt_expireage; + $ExpireTime *= -1 if $ExpireTime < 0; + + $GMTDateFmt = $opt_gmtdatefmt if $opt_gmtdatefmt; + $LocalDateFmt = $opt_localdatefmt if $opt_localdatefmt; + + ## Parse any rc variable definition from command-line + %CustomRcVars = (%CustomRcVars, &parse_vardef_str($opt_definevars)) + if ($opt_definevars); + + $CONLEN = 1 if defined($opt_conlen); + $CONLEN = 0 if defined($opt_noconlen); + $MAIN = 1 if defined($opt_main); + $MAIN = 0 if defined($opt_nomain); + $MODTIME = 1 if defined($opt_modtime); + $MODTIME = 0 if defined($opt_nomodtime); + $MULTIIDX = 1 if defined($opt_multipg); + $MULTIIDX = 0 if defined($opt_nomultipg); + $NODOC = 0 if defined($opt_doc); $NODOC = 1 if defined($opt_nodoc); $NOMAILTO = 1 if defined($opt_nomailto); + $NONEWS = 0 if defined($opt_news); $NONEWS = 1 if defined($opt_nonews); + $NOURL = 0 if defined($opt_url); $NOURL = 1 if defined($opt_nourl); $SLOW = 1 if defined($opt_savemem); $THREAD = 1 if defined($opt_thread); $THREAD = 0 if defined($opt_nothread); $TREVERSE = 1 if defined($opt_treverse); $TREVERSE = 0 if defined($opt_notreverse); - $TSUBSORT = 1 if defined($opt_tsubsort); - $TSUBSORT = 0 if defined($opt_notsubsort); + $DoFolRefs = 1 if defined($opt_folrefs); + $DoFolRefs = 0 if defined($opt_nofolrefs); + + $DecodeHeads = 1 if defined($opt_decodeheads); + $DecodeHeads = 0 if defined($opt_nodecodeheads); + $readmail'DecodeHeader = $DecodeHeads; + + @Months = split(/:/, $opt_months) if defined($opt_months); + @months = split(/:/, $opt_monthsabr) if defined($opt_monthsabr); + @Weekdays = split(/:/, $opt_weekdays) if defined($opt_weekdays); + @weekdays = split(/:/, $opt_weekdaysabr) if defined($opt_weekdaysabr); + + $MULTIIDX = 0 if $IDXONLY || !$IDXSIZE; ## Set umask if ($UNIX) { @@ -283,13 +425,18 @@ sub get_cli_opts { ## Get sort method ## $SORTCHNG = 0; - if (defined($opt_nosort)) { # No sorting takes highest precedence - $NOSORT = 1; $SUBSORT = 0; - } elsif (defined($opt_subsort)) { # Subject sort - $SUBSORT = 1; $NOSORT = 0; - } elsif (defined($opt_sort)) { # Regular sort is last - $NOSORT = 0; $SUBSORT = 0; + $AUTHSORT = 1 if defined($opt_authsort); + $AUTHSORT = 0 if defined($opt_noauthsort); + $SUBSORT = 1 if defined($opt_subsort); + $SUBSORT = 0 if defined($opt_nosubsort); + $NOSORT = 1 if defined($opt_nosort); + $NOSORT = 0 if defined($opt_sort); + if ($NOSORT) { + $SUBSORT = 0; $AUTHSORT = 0; + } elsif ($SUBSORT) { + $AUTHSORT = 0; } + ## Check for listing order ## if (defined($opt_noreverse)) { @@ -299,6 +446,7 @@ sub get_cli_opts { } $SORTCHNG = 1 if (($OldNOSORT != $NOSORT) || ($OldSUBSORT != $SUBSORT) || + ($OldAUTHSORT != $AUTHSORT) || ($OldREVSORT != $REVSORT)); ## Check if all messages must be updated @@ -306,153 +454,71 @@ sub get_cli_opts { if ($SORTCHNG || $RMM || $EDITIDX || ($OldTITLE ne $TITLE) || ($OldTTITLE ne $TTITLE) || + ($OldMULTIIDX != $MULTIIDX) || ($THREAD != $OldTHREAD)) { $UPDATE_ALL = 1; } else { $UPDATE_ALL = 0; } - ## Check index resources - $IDXPGBEG = join('', - '', - "\n", - "\n", - "\n", - '$IDXTITLE$', "\n", - "\n", - "\n", - '

    $IDXTITLE$

    ', "\n") - unless $IDXPGBEG; - $IDXPGEND = join('', - "\n", - "\n") - unless $IDXPGEND; - - if ($THREAD) { - $LIBEG = join('', "\n
    \n
      \n") - unless $LIBEG; - $THEAD = join('', "\n
      \n") - unless $THEAD; - $TLITXT = '($NUMFOLUP$) $SUBJECT:40$, ' . - '$FROMNAME$' - unless $TLITXT; - $TIDXPGBEG = join('', - "\n}, - "\n", - "\n", - '$TIDXTITLE$', "\n", - "\n", - "\n", - '

      $TIDXTITLE$

      ', "\n") - unless $TIDXPGBEG; - $TIDXPGEND = join('', - "\n", - "\n") - unless $TIDXPGEND; + ## Set date names + ## + &set_date_names(*weekdays, *Weekdays, *months, *Months); - } else { - $LIBEG = "
      \n
        \n" unless $LIBEG; - } - $LIEND = "
      \n" - unless $LIEND; - $LITMPL = join('', '
    • $SUBJECT$', "\n", - '
      • From: $FROM$
      ' , "\n", - "
    • \n") - unless $LITMPL; - - ## Message resources - $MSGPGBEG = join('', - '', - "\n", - "\n", - "\n", - '$SUBJECTNA:72$', "\n", - '', "\n", - "\n", - "\n") - unless $MSGPGBEG; - $MSGPGEND = join('', - "\n", - "\n") - unless $MSGPGEND; - - # Check for next/prev message link resources. Must check for - # older variables to preserve capatibility. - $PREVBL = '[Prev]' unless $PREVBL; - $NEXTBL = '[Next]' unless $NEXTBL; - $IDXBL = '[Index]' unless $IDXBL; - $TIDXBL = '[Thread]' unless $TIDXBL; - $NEXTFL = 'Next' unless $NEXTFL; - $PREVFL = 'Prev' unless $PREVFL; - - $NEXTBUTTON = '' . $NEXTBL . '' - unless $NEXTBUTTON; - $PREVBUTTON = '' . $PREVBL . '' - unless $PREVBUTTON; - $NEXTBUTTONIA = '' - unless $PREVBUTTONIA; - $PREVBUTTONIA = '' - unless $PREVBUTTONIA; - - $NEXTLINK = join('', - "
    • $NEXTFL: ", - '$NEXTSUBJECT$', - "
    • \n") unless $NEXTLINK; - $NEXTLINKIA = '' unless $NEXTLINKIA; - $PREVLINK = join('', - "
    • $PREVFL: ", - '$PREVSUBJECT$', - "
    • \n") unless $PREVLINK; - $PREVLINKIA = '' unless $PREVLINKIA; - - if (!$TOPLINKS) { - $TOPLINKS = join('', - "
      \n", - '$PREVBUTTON$$NEXTBUTTON$', - '', $IDXBL, ''); - $TOPLINKS .= join('', - '', $TIDXBL, '') - if $THREAD; - } - - if (!$BOTLINKS) { - $BOTLINKS = join('', - "
      \n", - "
        \n", - '$PREVLINK$', - '$NEXTLINK$', - "
      • Index(es):\n", - "\n
      • \n
      \n"; - } - - ## Set unknown icon - $Icons{'unknown'} = $Icons{'text/plain'} unless $Icons{'unknown'}; - - ## Set some other variables - $IDXPATHNAME = "${OUTDIR}${DIRSEP}${IDXNAME}"; - $TIDXPATHNAME = "${OUTDIR}${DIRSEP}${TIDXNAME}"; - - ## Create dynamic subroutines. + ## Require some more libaries + ## + ## Set index resources. + ## + require 'mhidxrc.pl' || die("ERROR: Unable to require mhidxrc.pl\n"); + ## + ## Create dynamic subroutines. + ## + require 'mhdysub.pl' || die("ERROR: Unable to require mhdysub.pl\n"); &create_routines(); + ## + ## Require library for expanding resource variables + ## + require 'mhrcvars.pl' || die("ERROR: Unable to require mhrcvars.pl\n"); + ## + ## Require database write library if needed + ## + if (!($SCAN || $IDXONLY)) { + require 'mhdb.pl' || die("ERROR: Unable to require mhdb.pl\n"); + } + + ## Predefine %Index2TLoc in case of message deletion + if (@TListOrder) { + @Index2TLoc{@TListOrder} = (0 .. $#TListOrder); + } + + ## Set $ExpireDateTime from $ExpireDate + if ($ExpireDate) { + if (@array = &parse_date($ExpireDate)) { + $ExpireDateTime = &get_time_from_date(@array[1..$#array]); + } else { + warn qq|Warning: Unable to parse EXPIREDATE, "$ExpireDate"\n|; + } + } + + ## Delete bogus empty entries in hashes due to bug in earlier + ## versions to avoid any future problems. + + delete($IndexNum{''}); + delete($Subject{''}); + delete($From{''}); + delete($MsgId{''}); + delete($FollowOld{''}); + delete($ContentType{''}); + delete($Refs{''}); + ## Check if printing process time $TIME = defined($opt_time); $StartTime = (times)[0] if ($TIME); } + ##--------------------------------------------------------------------------- +## Main routine that does the work +## sub doit { ## Check for non-archive modification modes. if ($SCAN) { @@ -464,8 +530,9 @@ sub doit { } ## Following causes changes to an archive - local($mesg, $tmp, $index, $sub, $from, $i, $date, @array, - @array2, $tmp2, %fields); + local($mesg, $tmp, $index, $sub, $from, $i, $date, $fh, $tmp2); + local(@array, @array2); + local(%fields); $i = $NumOfMsgs; ##-------------------## @@ -479,7 +546,7 @@ sub doit { unless $QUIET; &rmm(*ARGV); - } elsif ($ADDSINGLE) { ## Adding single message + } elsif ($ADDSINGLE) { ## Adding single message print STDOUT "Adding message to $OUTDIR\n" unless $QUIET; $handle = $ADD; @@ -495,7 +562,6 @@ sub doit { $IndexNum{$index} = &getNewMsgNum(); $MsgHead{$index} = $mesg; - $MsgHead{$index} .= "
      \n" unless $mesg =~ /^\s*$/; ## Read rest of message $Message{$index} = &read_mail_body( @@ -517,7 +583,8 @@ sub doit { } $MBOX = 0; $MH = 1; print STDOUT "\nReading $mbox " unless $QUIET; - @files = sort numerically grep(/^\d+$/, readdir(MAILDIR)); + @files = sort numerically grep(/$MHPATTERN/o, + readdir(MAILDIR)); closedir(MAILDIR); foreach (@files) { $mesgfile = "${mbox}${DIRSEP}${_}"; @@ -535,7 +602,6 @@ sub doit { ($From{$index},$Date{$index},$Subject{$index}) = ($from,$date,$sub); $MsgHead{$index} = $mesg; - $MsgHead{$index} .= "
      \n" unless $mesg =~ /^\s*$/; if ($ADD && !$SLOW) { $AddIndex{$index} = 1; } $IndexNum{$index} = &getNewMsgNum(); @@ -547,7 +613,7 @@ sub doit { *fields); # Check if conserving memory if ($SLOW) { - &output_mail($index, 0, 0, *bogus, 1, 1); + &output_mail($index, 1, 1); $Update{$IndexNum{$index}} = 1; undef $MsgHead{$index}; undef $Message{$index}; @@ -556,44 +622,47 @@ sub doit { close(FILE); } } else { # UUCP mail box file - if (!open(FILE, $mbox)) { + if ($mbox eq "-") { + $fh = 'STDIN'; + } elsif (!open(FILE, $mbox)) { warn "\nWarning: Unable to open $mbox\n"; next; + } else { + $fh = 'FILE'; } $MBOX = 1; $MH = 0; print STDOUT "\nReading $mbox " unless $QUIET; - while () { last if /$FROM/o; } - MBOX: while (!eof(FILE)) { + while (<$fh>) { last if /$FROM/o; } + MBOX: while (!eof($fh)) { print STDOUT "." unless $QUIET; $mesg = ''; ($index,$from,$date,$sub,$header) = - &read_mail_header(FILE, *mesg, *fields); + &read_mail_header($fh, *mesg, *fields); if ($index ne '') { ($From{$index},$Date{$index},$Subject{$index}) = ($from,$date,$sub); $MsgHead{$index} = $mesg; - $MsgHead{$index} .= "
      \n" unless $mesg =~ /^\s*$/; if ($ADD && !$SLOW) { $AddIndex{$index} = 1; } $IndexNum{$index} = &getNewMsgNum(); $Message{$index} = &read_mail_body( - FILE, + $fh, $index, $header, *fields); if ($SLOW) { - &output_mail($index, 0, 0, *bogus, 1, 1); + &output_mail($index, 1, 1); $Update{$IndexNum{$index}} = 1; undef $MsgHead{$index}; undef $Message{$index}; } } else { - &read_mail_body(FILE, $index, $header, *fields, 1); + &read_mail_body($fh, $index, $header, *fields, 1); } } - close(FILE); + close($fh); } } } @@ -608,29 +677,43 @@ sub doit { ## Setup data structures for final HTML output ## ##---------------------------------------------## - ## Remove old message if hit maximum size - if (!$IDXONLY && $MAXSIZE && ($NumOfMsgs > $MAXSIZE)) { + ## Remove old message if hit maximum size or expiration + if (!$IDXONLY && (($MAXSIZE && ($NumOfMsgs > $MAXSIZE)) || + $ExpireTime || $ExpireDateTime)) { if ($REVSORT) { @array = reverse &sort_messages(); } else { @array = &sort_messages(); } &ign_signals(); # Ignore termination signals - while ($NumOfMsgs > $MAXSIZE) { - $index = shift @array; + + while ($index = shift(@array)) { + last unless + ($MAXSIZE && ($NumOfMsgs > $MAXSIZE)) || + (&expired_time(&get_time_from_index($index))); + &delmsg($index); + $IdxMinPg = 0; + $TIdxMinPg = 0; $Update{$IndexNum{$array[0]}} = 1; # Update next foreach (split(/$bs/o, $FollowOld{$index})) { # Update any replies $Update{$IndexNum{$_}} = 1; } + $Update{$IndexNum{$TListOrder[$Index2TLoc{$index}-1]}} = 1; + $Update{$IndexNum{$TListOrder[$Index2TLoc{$index}+1]}} = 1; } } - @array = &sort_messages(); - ## Compute follow up messages - foreach $index (@array) { + ## Set MListOrder + @MListOrder = &sort_messages(); + + ## Compute follow up messages with side-effect of setting %Index2MLoc + $i = 0; + foreach $index (@MListOrder) { + $Index2MLoc{$index} = $i; $i++; + $FolCnt{$index} = 0 unless $FolCnt{$index}; - if (@array2 = split(/$'X/o, $Refs{$index})) { + if (@array2 = split(/$X/o, $Refs{$index})) { $tmp2 = $array2[$#array2]; next unless defined($IndexNum{$MsgId{$tmp2}}); $tmp = $MsgId{$tmp2}; @@ -640,24 +723,41 @@ sub doit { } } + ## Compute thread information (sets ThreadList, TListOrder, Index2TLoc) + &compute_threads(); + ## Check for which messages to update when adding to archive if (!$IDXONLY && $ADD) { if ($UPDATE_ALL) { - foreach $index (@array) { $Update{$IndexNum{$index}} = 1; } + foreach $index (@MListOrder) { $Update{$IndexNum{$index}} = 1; } + $IdxMinPg = 0; + $TIdxMinPg = 0; + } else { $i = 0; - foreach $index (@array) { + foreach $index (@MListOrder) { ## Check for New follow-up links if ($FollowOld{$index} ne $Follow{$index}) { $Update{$IndexNum{$index}} = 1; } - ## Check if new message; must update links in prev/next mesgs + ## Check if new message; must update links in prev/next msgs if ($AddIndex{$index}) { - $Update{$IndexNum{$array[$i-1]}} = 1 if $i > 0; - $Update{$IndexNum{$array[$i+1]}} = 1 if $i < $#array; + + # Mark where main index page updates start + if ($MULTIIDX) { + $tmp = int($Index2MLoc{$index}/$IDXSIZE)+1; + $IdxMinPg = $tmp + if ($tmp < $IdxMinPg || $IdxMinPg < 0); + } + + # Mark previous/next messages + $Update{$IndexNum{$MListOrder[$i-1]}} = 1 + if $i > 0; + $Update{$IndexNum{$MListOrder[$i+1]}} = 1 + if $i < $#MListOrder; } ## Check for New reference links - foreach (split(/$'X/o, $Refs{$index})) { + foreach (split(/$X/o, $Refs{$index})) { $tmp = $MsgId{$_}; if (defined($IndexNum{$tmp}) && $AddIndex{$tmp}) { $Update{$IndexNum{$index}} = 1; @@ -665,46 +765,87 @@ sub doit { } $i++; } + $i = 0; + foreach $index (@TListOrder) { + ## Check if new message; must update links in prev/next msgs + if ($AddIndex{$index}) { + + # Mark where thread index page updates start + if ($MULTIIDX) { + $tmp = int($Index2TLoc{$index}/$IDXSIZE)+1; + $TIdxMinPg = $tmp + if ($tmp < $TIdxMinPg || $TIdxMinPg < 0); + } + + # Mark previous/next message in thread + $Update{$IndexNum{$TListOrder[$i-1]}} = 1 + if $i > 0; + $Update{$IndexNum{$TListOrder[$i+1]}} = 1 + if $i < $#TListOrder; + } + $i++; + } } } + ## Compute total number of pages + $i = $NumOfPages; + if ($MULTIIDX && $IDXSIZE) { + $NumOfPages = int($NumOfMsgs/$IDXSIZE); + ++$NumOfPages if ($NumOfMsgs/$IDXSIZE) > $NumOfPages; + $NumOfPages = 1 if $NumOfPages == 0; + } else { + $NumOfPages = 1; + } + if ($i != $NumOfPages) { # Update all pages for $LASTPG$ + $IdxMinPg = 0; + $TIdxMinPg = 0; + } + ##------------## - ## Write HTML ## + ## Write Data ## ##------------## &ign_signals(); # Ignore termination signals print STDOUT "\n" unless $QUIET; + + ## Write indexes and mail if (!$IDXONLY) { - &write_mail(*array); - &write_main_index(); + &write_mail(); + &write_main_index() if $MAIN; &write_thread_index() if $THREAD; } elsif ($THREAD) { &write_thread_index(); - } else { + } elsif ($MAIN) { &write_main_index(); } - ## Save archive state + ## Write any alternate indexes if (!$IDXONLY) { - &output_db(); + ## Write database + print STDOUT "Writing database ...\n" unless $QUIET; + &output_db($DBPathName); + + $IdxMinPg = 0; $TIdxMinPg = 0; + foreach $tmp (@OtherIdxs) { $THREAD = 0; $tmp = "${OUTDIR}${DIRSEP}$tmp" unless ($tmp =~ m%^/%) || (-e $tmp); if (&read_fmt_file($tmp)) { if ($THREAD) { - $TIDXPATHNAME = "${OUTDIR}${DIRSEP}${TIDXNAME}"; &write_thread_index(); } else { - $IDXPATHNAME = "${OUTDIR}${DIRSEP}${IDXNAME}"; &write_main_index(); } } } + print STDOUT "$NumOfMsgs messages\n" unless $QUIET; } &quit(0); } + ##--------------------------------------------------------------------------- ## Function to do scan feature. ## @@ -713,21 +854,22 @@ sub scan { $subject, $time, @array); print STDOUT "$NumOfMsgs messages in $OUTDIR:\n\n"; - print STDOUT sprintf("%5s %s %-15s %-45s\n", - "Msg #", "YY/MM/DD", "From", "Subject"); - print STDOUT sprintf("%5s %s %-15s %-45s\n", - "-" x 5, "--------", "-" x 15, "-" x 45); + print STDOUT sprintf("%5s %s %-15s %-43s\n", + "Msg #", "YYYY/MM/DD", "From", "Subject"); + print STDOUT sprintf("%5s %s %-15s %-43s\n", + "-" x 5, "----------", "-" x 15, "-" x 43); @array = &sort_messages(); foreach $index (@array) { - $date = &time2mmddyy((split(/$X/o, $index))[0], 'yymmdd'); + $date = &time2mmddyy((split(/$X/o, $index))[0], 'yyyymmdd'); $num = $IndexNum{$index}; - $from = substr(&dehtmlize(&extract_email_name($From{$index})), 0, 15); - $subject = substr(&dehtmlize($Subject{$index}), 0, 45); - print STDOUT sprintf("%5d %s %-15s %-45s\n", + $from = substr(&extract_email_name($From{$index}), 0, 15); + $subject = substr($Subject{$index}, 0, 43); + print STDOUT sprintf("%5d %s %-15s %-43s\n", $num, $date, $from, $subject); } } + ##--------------------------------------------------------------------------- ## Routine to perform conversion of a single mail message to ## HTML. @@ -741,7 +883,7 @@ sub single { ## See where input is coming from if ($ARGV[0]) { - open(SINGLE, $ARGV[0]) || &error("ERROR: Unable to open $ARGV[0]"); + open(SINGLE, $ARGV[0]) || die("ERROR: Unable to open $ARGV[0]\n"); $handle = 'SINGLE'; $filename = $ARGV[0]; } else { @@ -753,35 +895,15 @@ sub single { &read_mail_header($handle, *mhead, *fields); ($From{$index},$Date{$index},$Subject{$index}) = ($from,$date,$sub); + $MsgHead{$index} = $mhead; ## Read rest of message - $mesg = &read_mail_body($handle, $index, $header, *fields); + $Message{$index} = &read_mail_body($handle, $index, $header, *fields); - ## Output to stdout - $template = $MSGPGBEG; - $template =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; - print STDOUT $template; - - $template = $MSGHEAD; - $template =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; - print STDOUT $template; - - print STDOUT "

      $sub

      \n", - "
      \n", - $mhead; - - print STDOUT "
      \n" unless $mhead =~ /^\s*$/; - print STDOUT $mesg, - "
      \n"; - - $template = $MSGFOOT; - $template =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; - print STDOUT $template; - - $template = $MSGPGEND; - $template =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; - print STDOUT $template; + ## Output mail + &output_mail($index, 1, 0); } + ##--------------------------------------------------------------------------- ## Function for removing messages. *numbers points to an array ## of message numbers to delete @@ -791,7 +913,7 @@ sub rmm { local($key, %Num2Index, $num, $didrmm, $filename); if ($#numbers < 0) { - &error("Error: No message numbers specified"); + die("ERROR: No message numbers specified\n"); } $didrmm = 0; @@ -802,8 +924,9 @@ sub rmm { ## Remove messages foreach $num (@numbers) { if ($num !~ /^\d+$/) { - print STDERR "`$num' is not a legal message number\n"; + warn "`$num' is not a legal message number\n"; } + $num =~ s/^0+// unless $num eq '0'; if ($key = $Num2Index{$num}) { print STDOUT "\tRemoving message $num\n" unless $QUIET; &delmsg($key); @@ -813,13 +936,15 @@ sub rmm { } } if (!$didrmm) { - &error("ERROR: Messages specified do not exist"); + die("ERROR: Messages specified do not exist\n"); } } + ##--------------------------------------------------------------------------- sub delmsg { local($key) = @_; local($filename); + local($pathname); &defineIndex2MsgId(); $msgnum = $IndexNum{$key}; return 0 if ($msgnum eq ''); @@ -832,122 +957,317 @@ sub delmsg { delete $Subject{$key}; delete $MsgId{$Index2MsgId{$key}}; unlink $filename; - foreach $filename (split(/$'X/o, $Derived{$key})) { - unlink "${OUTDIR}${DIRSEP}${filename}"; + foreach $filename (split(/$X/o, $Derived{$key})) { + $pathname = "${OUTDIR}${DIRSEP}${filename}"; + if (-d $pathname) { + &rmdir($pathname); + } else { + unlink "${OUTDIR}${DIRSEP}${filename}"; + } } delete $Derived{$key}; $NumOfMsgs--; 1; } + ##--------------------------------------------------------------------------- ## write_mail outputs converted mail. It takes a reference to an ## array containing indexes of messages to output. ## sub write_mail { - local(*idxarray) = $_[0]; - local($max, $hack) = ($#idxarray, 0); - print STDOUT "Writing mail ...\n" unless $QUIET; - if ($SLOW && !$ADD) { $ADD = 1; $hack = 1; } - $i = 0; - foreach $index (@idxarray) { - &output_mail($index, $i, $max, *idxarray, $AddIndex{$index}, 0); - $i++; + local($hack) = (0); + print STDOUT "Writing mail " unless $QUIET; + + if ($SLOW && !$ADD) { + $ADD = 1; + $hack = 1; } - if ($hack) { $ADD = 0; } + + foreach $index (@MListOrder) { + print STDOUT "." unless $QUIET; + &output_mail($index, $AddIndex{$index}, 0); + } + + if ($hack) { + $ADD = 0; + } + + print STDOUT "\n" unless $QUIET; } + ##--------------------------------------------------------------------------- ## write_main_index outputs main index of archive ## sub write_main_index { - local(@array) = &sort_messages(); - local($outhandle, $i, $i_p0, $filename, $tmpl); + local(@array) = (); + local($outhandle, $i, $i_p0, $filename, $tmpl, $isfirst, $tmp); + local(@a, $PageNum); - ## Set messages that are shown in index - if ($IDXSIZE && (($i = ($#array+1) - $IDXSIZE) > 0)) { - if ($REVSORT) { - splice(@array, $IDXSIZE); - } else { - splice(@array, 0, $i); + @array = &sort_messages(); + + for ($PageNum = 1; $PageNum <= $NumOfPages; $PageNum++) { + if ($MULTIIDX) { + @a = splice(@array, 0, $IDXSIZE); } - } + next if $PageNum < $IdxMinPg; - ## Open/create index file - if ($ADD) { - if (-e $IDXPATHNAME) { - &cp($IDXPATHNAME, "${OUTDIR}${DIRSEP}tmp.$$"); - open(MAILLISTIN, "${OUTDIR}${DIRSEP}tmp.$$") - || &error("ERROR: Unable to open ${OUTDIR}${DIRSEP}tmp.$$"); - $MLCP = 1; + $isfirst = 1; + + if ($MULTIIDX) { + if ($PageNum > 1) { + $IDXPATHNAME = ${OUTDIR} . ${DIRSEP} . + ${IDXPREFIX} . $PageNum . ".html"; + } else { + $IDXPATHNAME = ${OUTDIR} . ${DIRSEP} . ${IDXNAME}; + } } else { - $MLCP = 0; + if ($IDXSIZE && (($i = ($#array+1) - $IDXSIZE) > 0)) { + if ($REVSORT) { + splice(@array, $IDXSIZE); + } else { + splice(@array, 0, $i); + } + } + $IDXPATHNAME = ${OUTDIR} . ${DIRSEP} . ${IDXNAME}; + *a = *array; + } + + ## Open/create index file + if ($ADD) { + if (-e $IDXPATHNAME) { + &cp($IDXPATHNAME, "${OUTDIR}${DIRSEP}tmp.$$"); + open(MAILLISTIN, "${OUTDIR}${DIRSEP}tmp.$$") + || die("ERROR: Unable to open ${OUTDIR}${DIRSEP}tmp.$$\n"); + $MLCP = 1; + } else { + $MLCP = 0; + } } - } - if ($IDXONLY) { - $outhandle = STDOUT; - } else { - open(MAILLIST, "> $IDXPATHNAME") || - &error("ERROR: Unable to create $IDXPATHNAME"); - $outhandle = 'MAILLIST'; - } - print STDOUT "Writing $IDXPATHNAME ...\n" unless $QUIET; + if ($IDXONLY) { + $outhandle = STDOUT; + } else { + open(MAILLIST, "> $IDXPATHNAME") || + die("ERROR: Unable to create $IDXPATHNAME\n"); + $outhandle = 'MAILLIST'; + } + print STDOUT "Writing $IDXPATHNAME ...\n" unless $QUIET; - ## Print top part of index - &output_maillist_head($outhandle, MAILLISTIN); + ## Print top part of index + &output_maillist_head($outhandle, MAILLISTIN); - ## Output messages to HTML - $i = 0; - foreach $index (@array) { - $msgnum = $IndexNum{$index}; - $i_p0 = &fmt_msgnum($msgnum); # Var for replace_li_var - $filename = &msgnum_filename($msgnum); # Var for replace_li_var - $tmpl = $LITMPL; - $tmpl =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; - print $outhandle $tmpl; - $i++; - } - - ## Print bottom part of index - &output_maillist_foot($outhandle, MAILLISTIN); - close($outhandle) unless $IDXONLY; - close(MAILLISTIN), unlink("${OUTDIR}${DIRSEP}tmp.$$") if $MLCP; + ## Output links to messages + + if ($NOSORT) { + foreach $index (@a) { + ($tmpl = $LITMPL) =~ s/$VarExp/&replace_li_var($1,$index)/geo; + print $outhandle $tmpl; + } + + } elsif ($SUBSORT) { + local($prevsub) = ''; + foreach $index (@a) { + if (($tmp = &get_base_subject($index)) ne $prevsub) { + $prevsub = $tmp; + if (!$isfirst) { + ($tmpl = $SUBJECTEND) =~ + s/$VarExp/&replace_li_var($1,$index)/geo; + print $outhandle $tmpl; + } else { + $isfirst = 0; + } + ($tmpl = $SUBJECTBEG) =~ + s/$VarExp/&replace_li_var($1,$index)/geo; + print $outhandle $tmpl; + } + ($tmpl = $LITMPL) =~ s/$VarExp/&replace_li_var($1,$index)/geo; + print $outhandle $tmpl; + } + ($tmpl = $SUBJECTEND) =~ s/$VarExp/&replace_li_var($1,$index)/geo; + print $outhandle $tmpl; + + } elsif ($AUTHSORT) { + local($prevauth) = ''; + foreach $index (@a) { + if (($tmp = &get_base_author($index)) ne $prevauth) { + $prevauth = $tmp; + if (!$isfirst) { + ($tmpl = $AUTHEND) =~ + s/$VarExp/&replace_li_var($1,$index)/geo; + print $outhandle $tmpl; + } else { + $isfirst = 0; + } + ($tmpl = $AUTHBEG) =~ + s/$VarExp/&replace_li_var($1,$index)/geo; + print $outhandle $tmpl; + } + ($tmpl = $LITMPL) =~ s/$VarExp/&replace_li_var($1,$index)/geo; + print $outhandle $tmpl; + } + ($tmpl = $AUTHEND) =~ s/$VarExp/&replace_li_var($1,$index)/geo; + print $outhandle $tmpl; + + } else { + local($prevdate) = ''; + local($time); + foreach $index (@a) { + $time = &get_time_from_index($index); + $tmp = join("", (localtime($time))[3,4,5]); + if ($tmp ne $prevdate) { + $prevdate = $tmp; + if (!$isfirst) { + ($tmpl = $DAYEND) =~ + s/$VarExp/&replace_li_var($1,$index)/geo; + print $outhandle $tmpl; + } else { + $isfirst = 0; + } + ($tmpl = $DAYBEG) =~ + s/$VarExp/&replace_li_var($1,$index)/geo; + print $outhandle $tmpl; + } + ($tmpl = $LITMPL) =~ s/$VarExp/&replace_li_var($1,$index)/geo; + print $outhandle $tmpl; + } + ($tmpl = $DAYEND) =~ s/$VarExp/&replace_li_var($1,$index)/geo; + print $outhandle $tmpl; + } + + ## Print bottom part of index + &output_maillist_foot($outhandle, MAILLISTIN); + close($outhandle) unless $IDXONLY; + close(MAILLISTIN), unlink("${OUTDIR}${DIRSEP}tmp.$$") if $MLCP; + } } + ##--------------------------------------------------------------------------- ## write_thread_index outputs the thread index ## sub write_thread_index { local($tmpl, $handle); + local($index) = (""); + local(*a, $PageNum, %Printed); + local($lastlevel, $tlevel, $iscont, $i); - if ($IDXONLY) { - $handle = 'STDOUT'; - } else { - open(THREAD, "> $TIDXPATHNAME") || - &error("ERROR: Unable to create $TIDXPATHNAME"); - $handle = 'THREAD'; - } - print STDOUT "Writing $TIDXPATHNAME ...\n" unless $QUIET; + local($level) = 0; ## !!!Used in print_thread!!! + local($last0index) = ''; - $tmpl = $TIDXPGBEG; - $tmpl =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; - print $handle $tmpl; + for ($PageNum = 1; $PageNum <= $NumOfPages; $PageNum++) { + if ($MULTIIDX) { + @a = splice(@TListOrder, 0, $IDXSIZE); + } + next if $PageNum < $TIdxMinPg; - $tmpl = $THEAD; - $tmpl =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; - print $handle $tmpl; + if ($MULTIIDX) { + if ($PageNum > 1) { + $TIDXPATHNAME = ${OUTDIR} . ${DIRSEP} . + ${TIDXPREFIX} . $PageNum . ".html"; + } else { + $TIDXPATHNAME = ${OUTDIR} . ${DIRSEP} . ${TIDXNAME}; + } + } else { + $TIDXPATHNAME = ${OUTDIR} . ${DIRSEP} . ${TIDXNAME}; + if ($IDXSIZE && (($i = ($#ThreadList+1) - $IDXSIZE) > 0)) { + if ($TREVERSE) { + @NotIdxThreadList = splice(@ThreadList, $IDXSIZE); + } else { + @NotIdxThreadList = splice(@ThreadList, 0, $i); + } + } + *a = *ThreadList; + } + - &output_thread_index($handle); + if ($IDXONLY) { + $handle = 'STDOUT'; + } else { + open(THREAD, "> $TIDXPATHNAME") || + die("ERROR: Unable to create $TIDXPATHNAME\n"); + $handle = 'THREAD'; + } + print STDOUT "Writing $TIDXPATHNAME ...\n" unless $QUIET; - $tmpl = $TFOOT; - $tmpl =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; - print $handle $tmpl; + ($tmpl = $TIDXPGBEG) =~ s/$VarExp/&replace_li_var($1,'')/geo; + print $handle $tmpl; - &output_doclink($handle); + ($tmpl = $THEAD) =~ s/$VarExp/&replace_li_var($1,'')/geo; + print $handle $tmpl; - $tmpl = $TIDXPGEND; - $tmpl =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; - print $handle $tmpl; + ## Flag visible messages for use in printing thread index page + foreach $index (@a) { $TVisible{$index} = 1; } + + ## Print index. Print unless message has been printed, or + ## unless it has reference that is visible. + $level = 0; # Used in print_thread!!! + $lastlevel = $ThreadLevel{$a[0]}; - close($handle) unless $IDXONLY; + # check if continuing a thread + if ($lastlevel > 0) { + ($tmpl = $TCONTBEG) =~ s/$VarExp/&replace_li_var($1,$a[0])/geo; + print $handle $tmpl; + } + # perform any indenting + for ($i=0; $i < $lastlevel; ++$i) { + ++$level; + if ($level <= $TLEVELS) { + ($tmpl = $TINDENTBEG) =~ s/$VarExp/&replace_li_var($1,'')/geo; + print $handle $tmpl; + } + } + # print index listing + foreach $index (@a) { + $tlevel = $ThreadLevel{$index}; + if (($lastlevel > 0) && ($tlevel < $lastlevel)) { + for ($i=$tlevel; $i < $lastlevel; ++$i) { + if ($level <= $TLEVELS) { + ($tmpl = $TINDENTEND) =~ + s/$VarExp/&replace_li_var($1,'')/geo; + print $handle $tmpl; + } + --$level; + } + $lastlevel = $tlevel; + if ($lastlevel < 1) { # Check if continuation done + ($tmpl = $TCONTEND) =~ + s/$VarExp/&replace_li_var($1,'')/geo; + print $handle $tmpl; + } + } + unless ($Printed{$index} || + ($HasRef{$index} && $TVisible{$HasRef{$index}})) { + &print_thread($handle, $index, + ($lastlevel > 0) ? 0 : 1); + } + } + # unindent if required + for ($i=0; $i < $lastlevel; ++$i) { + if ($level <= $TLEVELS) { + ($tmpl = $TINDENTEND) =~ s/$VarExp/&replace_li_var($1,'')/geo; + print $handle $tmpl; + } + --$level; + } + # close continuation if required + if ($lastlevel > 0) { + ($tmpl = $TCONTEND) =~ s/$VarExp/&replace_li_var($1,'')/geo; + print $handle $tmpl; + } + + ## Reset visibility flags + foreach $index (@a) { $TVisible{$index} = 0; } + + ($tmpl = $TFOOT) =~ s/$VarExp/&replace_li_var($1,'')/geo; + print $handle $tmpl; + + &output_doclink($handle); + + ($tmpl = $TIDXPGEND) =~ s/$VarExp/&replace_li_var($1,'')/geo; + print $handle $tmpl; + + close($handle) unless $IDXONLY; + } } + ##--------------------------------------------------------------------------- ## read_mail_header() is responsible for parsing the header of ## a mail message. @@ -969,8 +1289,7 @@ sub read_mail_header { $msgid =~ s/\s*$//; } - # Return if message already exists in archive - # + ## Return if message already exists in archive ## if ($msgid && defined($MsgId{$msgid})) { return ("", "", "", "", ""); } @@ -979,53 +1298,47 @@ sub read_mail_header { ## Get date ## ##----------## $date = ''; - if ($fields{'received'}) { - @array = split(/$'FieldSep/o, $fields{'received'}); + + ## Extract date from Date: or Received: fields + if ($fields{'date'}) { + @array = split(/$readmail'FieldSep/o, $fields{'date'}); + $date = shift @array; + + } elsif ($fields{'received'}) { + @array = split(/$readmail'FieldSep/o, $fields{'received'}); $tmp = shift @array; @array = split(/;/, $tmp); $date = pop @array; - } elsif ($fields{'date'}) { - @array = split(/$'FieldSep/o, $fields{'date'}); - $date = shift @array; } - if ($date =~ /\w/) { - local($wday, $mday, $mon, $yr, $hr, $min, $sec, $zone) = - &parse_date($date); - if ($zone) { - $index = &timegm($sec,$min,$hr,$mday,$mon, - ($yr > 1900 ? $yr-1900 : $yr)); - } else { - $index = &timelocal($sec,$min,$hr,$mday,$mon, - ($yr > 1900 ? $yr-1900 : $yr)); - } - ## Try to modify time/date based on timezone ## - if ($zone =~ /^[\+-]\d+$/) {# Numeric timezone - $zone =~ s/0//g; - $index -= ($zone*3600); - } else { # Timezone abbrev - warn qq|Warning: Undefined time zone: "$zone", Line $.\n| - if $zone && !defined($Zone{$zone}); - $index += ($Zone{$zone}*3600); # %Zone defined above - } + ## Parse date ## + if (($date =~ /\w/) && (@array = &parse_date($date))) { + $index = &get_time_from_date(@array[1..$#array]); } else { - warn "Warning: Could not find date for message\n"; - $date = ''; $index = 0; + warn "Warning: Could not parse date for message\n"; + $date = '' unless $date =~ /\S/; + $index = time; # Use current time + } + + ## Return if message to old to add ## + if (&expired_time($index)) { + return ("", "", "", "", ""); } + ##-------------## ## Get Subject ## ##-------------## if ($fields{'subject'} !~ /^\s*$/) { ($sub = $fields{'subject'}) =~ s/\s*$//; - &htmlize(*sub); } else { $sub = 'No Subject'; } + ##----------## ## Get From ## ##----------## - $tmp = $fields{'from'} || $fields{'apparently-from'}; - $from = &convert_line($tmp); + $from = $fields{'from'} || $fields{'apparently-from'}; + ##----------------## ## Get References ## ##----------------## @@ -1037,16 +1350,17 @@ sub read_mail_header { if ($tmp =~ s/^[^<]*<([^>]*)>.*$/$1/) { push(@refs, $tmp) unless $tmp =~ /^\s*$/; } + ##------------------------## ## Create HTML for header ## ##------------------------## $mesg .= &htmlize_header(*fields, *l2o); ## Insure uniqueness of msg-id - $index .= $'X . sprintf("%d",$LastMsgNum+1); + $index .= $X . sprintf("%d",$LastMsgNum+1); if ($fields{'content-type'}) { - ($tmp = $fields{'content-type'}) =~ m%^\s*([\w-/]+)%; + ($tmp = $fields{'content-type'}) =~ m%^\s*([\w-\./]+)%; $tmp = $1 || 'text/plain'; $tmp =~ tr/A-Z/a-z/; } else { @@ -1054,24 +1368,63 @@ sub read_mail_header { } $ContentType{$index} = $tmp; - $MsgId{$msgid} = $index; + if ($msgid) { + $MsgId{$msgid} = $index; + $NewMsgId{$msgid} = $index; # Track new message-ids + } &remove_dups(*refs); # Remove duplicate msg-ids - $Refs{$index} = join($'X, @refs) if (@refs); + $Refs{$index} = join($X, @refs) if (@refs); ($index,$from,$date,$sub,$header); } + ##--------------------------------------------------------------------------- ## read_mail_body() reads in the body of a message. The returned ## filtered body is in $ret. ## sub read_mail_body { local($handle, $index, $header, *fields, $skip) = @_; - local($ret, $data, @files); + local($ret, $data) = ('', ''); + local(@files) = (); - while (<$handle>) { - last if $MBOX && /$FROM/o; - $data .= $_; + ## Define "globals" for use by filters + ## NOTE: This stuff can be handled better, and will be done + ## when/if I get around to rewriting mhonarc in Perl 5. + ## + $'MHAmsgnum = &fmt_msgnum($IndexNum{$index}) unless $skip; + + ## Slurp of message body + ## UUCP mailbox + if ($MBOX) { + if ($CONLEN && $fields{"content-length"}) { # Check for content-length + local($len, $cnt) = ($fields{"content-length"}, 0); + if ($len) { + while (<$handle>) { + $cnt += length($_); # Increment byte count + $data .= $_; # Save data + last if $cnt >= $len # Last if hit length + } + } + # Slurp up bogus data if required (should I do this?) + while (!/$FROM/o && !eof($handle)) { + $_ = <$handle>; + } + + } else { # No content-length + while (<$handle>) { + last if /$FROM/o; + $data .= $_; + } + } + + ## MH message file + } else { + while (<$handle>) { + $data .= $_; + } } + + ## Filter data return '' if $skip; $fields{'content-type'} = 'text/plain' if $fields{'content-type'} =~ /^\s*$/; @@ -1087,42 +1440,24 @@ sub read_mail_body { "\n" ) unless $ret; if (@files) { - $Derived{$index} = join($'X, @files); + $Derived{$index} = join($X, @files); } $ret; } + ##--------------------------------------------------------------------------- ## Output/edit a mail message. ## $index => current index (== $array[$i]) -## $i => current index into *array -## $maxnum => size of *array -## *array => reference to array of indexes ## $force => flag if mail is written and not editted, regardless ## $nocustom => ignore sections with user customization -## ($i, $maxnum, *array ignored if true) ## sub output_mail { - local($index, $i, $maxnum, *array, $force, $nocustom) = @_; - local($msgi,$tmp,$tmp2,$template,@array2); - local($filepathname, $tmppathname); - local($adding) = ($ADD && !$force); - - # Variables for replace_li_var - local($i_p0,$i_p1,$i_m1,$filename,$nextindex,$previndex); - - if (!$nocustom) { - $nextindex = $array[$i+1]; - $previndex = $array[$i-1]; - } - - # Here $i is the current message count and not necessarily the - # message number in the filename. + local($index, $force, $nocustom) = @_; + local($msgi, $tmp, $tmp2, $template, @array2); + local($filepathname, $tmppathname, $i_p0, $filename, $msghandle); + local($adding) = ($ADD && !$force && !$SINGLE); $i_p0 = &fmt_msgnum($IndexNum{$index}); - if (!$nocustom) { - $i_p1 = &fmt_msgnum($IndexNum{$nextindex}); - $i_m1 = &fmt_msgnum($IndexNum{$previndex}); - } $filename = &msgnum_filename($IndexNum{$index}); $filepathname = $OUTDIR . $DIRSEP . $filename; @@ -1132,10 +1467,15 @@ sub output_mail { return ($i_p0,$filename) unless $Update{$IndexNum{$index}}; &cp($filepathname, $tmppathname); open(MSGFILEIN, $tmppathname) - || &error("ERROR: Unable to open $tmppathname"); + || die("ERROR: Unable to open $tmppathname\n"); + } + if ($SINGLE) { + $msghandle = 'STDOUT'; + } else { + open(MSGFILE, "> $filepathname") + || die("ERROR: Unable to create $filepathname\n"); + $msghandle = 'MSGFILE'; } - open(MSGFILE, "> $filepathname") - || &error("ERROR: Unable to create $filepathname"); ## Output HTML header if ($adding) { @@ -1146,23 +1486,27 @@ sub output_mail { # Output comments -- more informative, but can be used for # error recovering. - print MSGFILE "\n", - "\n", - "\n", - "\n", - "\n"; - foreach (split(/$'X/o, $Refs{$index})) { - print MSGFILE - "\n"; - } - print MSGFILE "\n"; + print $msghandle "\n", + "\n", + "\n", + "\n", + "\n"; + foreach (split(/$X/o, $Refs{$index})) { + print $msghandle + "\n"; + } + print $msghandle "\n"; # Add in user defined markup - $template = $MSGPGBEG; - $template =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; - print MSGFILE $template; + ($template = $MSGPGBEG) =~ s/$VarExp/&replace_li_var($1,$index)/geo; + print $msghandle $template; } - print MSGFILE "\n"; + print $msghandle "\n"; ## Output header if ($adding) { @@ -1170,26 +1514,23 @@ sub output_mail { last if /\n"; + print $msghandle "\n"; if (!$nocustom) { - $template = $MSGHEAD; - $template =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; - print MSGFILE $template; + ($template = $MSGHEAD) =~ s/$VarExp/&replace_li_var($1,$index)/geo; + print $msghandle $template; } - print MSGFILE "\n"; + print $msghandle "\n"; ## Output Prev/Next/Index links at top if ($adding) { while () { last if /\n"; - if (!$nocustom) { - $template = $TOPLINKS; - $template =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; - print MSGFILE $template; + print $msghandle "\n"; + if (!$nocustom && !$SINGLE) { + ($template = $TOPLINKS) =~ s/$VarExp/&replace_li_var($1,$index)/geo; + print $msghandle $template; } - print MSGFILE qq|\n|; - print MSGFILE "\n"; + print $msghandle "\n\n"; ## Output message body if ($adding) { @@ -1198,106 +1539,106 @@ sub output_mail { $tmp2 .= $_; last if /\n"; - print MSGFILE "

      ", $Subject{$index}, "

      \n"; - print MSGFILE "
      \n"; - foreach (split(/$'X/o, $Refs{$index})) {# Convert msg-ids to hyperlinks - ($tmp = $_) =~ s/(\W)/\\$1/g; - if (defined($IndexNum{$MsgId{$_}}) && - $IndexNum{$MsgId{$_}} != $IndexNum{$index}) { - - $msgi = &fmt_msgnum($IndexNum{$MsgId{$_}}); - $MsgHead{$index} =~ - s/$tmp/$_<\/A>/g; - $Message{$index} =~ - s/$tmp/$_<\/A>/g; - } - } + $tmp2 =~ s%($AddrExp)%&link_refmsgid($1,1)%geo; + print $msghandle $tmp2; - print MSGFILE $MsgHead{$index}; - print MSGFILE $Message{$index}; - print MSGFILE "\n"; + } else { + print $msghandle "\n"; + print $msghandle "\n"; + ($template = $SUBJECTHEADER) =~ + s/$VarExp/&replace_li_var($1,$index)/geo; + print $msghandle $template; + print $msghandle "\n"; + + $MsgHead{$index} =~ s%($AddrExp)%&link_refmsgid($1)%geo; + $Message{$index} =~ s%($AddrExp)%&link_refmsgid($1)%geo; + + print $msghandle $MsgHead{$index}; + print $msghandle "\n"; + ($template = $HEADBODYSEP) =~ + s/$VarExp/&replace_li_var($1,$index)/geo; + print $msghandle $template; + print $msghandle "\n"; + print $msghandle "\n"; + print $msghandle $Message{$index}; + print $msghandle "\n"; } ## Output any followup messages if ($adding) { while () { last if /\n"; - if (!$nocustom) { + print $msghandle "\n"; + if (!$nocustom && $DoFolRefs) { @array2 = split(/$bs/o, $Follow{$index}); if ($#array2 >= 0) { $tmp = 1; # Here, $tmp a flag if
      printed - print MSGFILE "
      \n", + print $msghandle "
      \n", "Follow-Ups:\n", "
      \n"; } - print MSGFILE "
    \n"; + print $msghandle "\n"; } else { $tmp = 0; } } - print MSGFILE "\n"; + print $msghandle "\n"; ## Output any references if ($adding) { while () { last if /\n"; - if (!$nocustom) { - @array2 = split(/$'X/o, $Refs{$index}); $tmp2 = 0; + print $msghandle "\n"; + if (!$nocustom && $DoFolRefs) { + @array2 = split(/$X/o, $Refs{$index}); $tmp2 = 0; if ($#array2 >= 0) { foreach (@array2) { if (defined($IndexNum{$MsgId{$_}})) { - if (!$tmp) { print MSGFILE "
    \n"; $tmp = 1; } + if (!$tmp) { print $msghandle "
    \n"; $tmp = 1; } if (!$tmp2) { - print MSGFILE "References:\n", + print $msghandle "References:\n", "
      \n"; $tmp2 = 1; } - print MSGFILE "
    • ", - qq|", + qq{$Subject{$MsgId{$_}}
    • \n|, + qq{">}, + &$MHeadCnvFunc($Subject{$MsgId{$_}}), + qq{\n}, "
        \n", - "
      • From: $From{$MsgId{$_}}
      • \n", + "
      • From: ", + &$MHeadCnvFunc($From{$MsgId{$_}}), + "
      • \n", "
      \n"; } } - print MSGFILE "
    \n" if $tmp2; + print $msghandle "\n" if $tmp2; } } - print MSGFILE "\n"; + print $msghandle "\n"; ## Output verbose links to prev/next message in list if ($adding) { while () { last if /\n"; - if (!$nocustom) { - $template = $BOTLINKS; - $template =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; - print MSGFILE $template; - print MSGFILE qq|\n|; + print $msghandle "\n"; + if (!$nocustom && !$SINGLE) { + ($template = $BOTLINKS) =~ s/$VarExp/&replace_li_var($1,$index)/geo; + print $msghandle $template; } - print MSGFILE "\n"; + print $msghandle "\n\n"; ## Output footer if ($adding) { @@ -1305,35 +1646,81 @@ sub output_mail { last if /\n"; + print $msghandle "\n"; if (!$nocustom) { - $template = $MSGFOOT; - $template =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; - print MSGFILE $template; + ($template = $MSGFOOT) =~ s/$VarExp/&replace_li_var($1,$index)/geo; + print $msghandle $template; } - print MSGFILE "\n"; + print $msghandle "\n"; if (!$nocustom) { - $template = $MSGPGEND; - $template =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; - print MSGFILE $template; + ($template = $MSGPGEND) =~ s/$VarExp/&replace_li_var($1,$index)/geo; + print $msghandle $template; } - close(MSGFILE); + close($msghandle) if (!$SINGLE); close(MSGFILEIN), unlink($tmppathname) if ($adding); + ## Create user defined files + foreach (keys %UDerivedFile) { + ($tmp = $_) =~ s/$VarExp/&replace_li_var($1,$index)/geo; + $tmp2 = $OUTDIR . $DIRSEP . $tmp; + if (open(DERIVED, "> $tmp2")) { + ($template = $UDerivedFile{$_}) =~ + s/$VarExp/&replace_li_var($1,$index)/geo; + print DERIVED $template; + close(DERIVED); + if ($Derived{$index}) { + $Derived{$index} .= $X . $tmp; + } else { + $Derived{$index} = $tmp; + } + } else { + warn "Warning: Unable to create $tmp2\n"; + } + } + if (@array2 = split(/$X/o, $Derived{$index})) { + &remove_dups(*array2); + $Derived{$index} = join($X, @array2); + } + + ## Set modification times -- Use eval incase OS does not support utime. + if ($MODTIME && !$SINGLE) { + eval q% + $tmp = &get_time_from_index($index); + @array2 = split(/$X/o, $Derived{$index}); + grep($_ = $OUTDIR . $DIRSEP . $_, @array2); + unshift(@array2, $filepathname); + utime($tmp, $tmp, @array2); + %; + } + ($i_p0, $filename); } + +##--------------------------------------------------------------------------- +## Routine to convert a msgid to an anchor +## +sub link_refmsgid { + local($refmsgid, $onlynew) = @_; + + defined($IndexNum{$MsgId{$refmsgid}}) && + (!$onlynew || $NewMsgId{$refmsgid}) ? + join("", '', $refmsgid, '') : + $refmsgid; +} + ##--------------------------------------------------------------------------- ## output_maillist_head() outputs the beginning of the index page. ## sub output_maillist_head { local($handle, $cphandle) = @_; - local($tmp); + local($tmp, $index); + $index = ""; ## Output title - $tmp = $IDXPGBEG; - $tmp =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; + ($tmp = $IDXPGBEG) =~ s/$VarExp/&replace_li_var($1,'')/geo; print $handle $tmp; print $handle "\n"; @@ -1364,19 +1751,19 @@ sub output_maillist_head { } print $handle "\n"; - $tmp = $LIBEG; - $tmp =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; + ($tmp = $LIBEG) =~ s/$VarExp/&replace_li_var($1,'')/geo; print $handle $tmp; } + ##--------------------------------------------------------------------------- ## output_maillist_foot() outputs the end of the index page. ## sub output_maillist_foot { local($handle, $cphandle) = @_; - local($tmp); + local($tmp, $index); + $index = ""; - $tmp = $LIEND; - $tmp =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; + ($tmp = $LIEND) =~ s/$VarExp/&replace_li_var($1,'')/geo; print $handle $tmp; print $handle "\n"; @@ -1410,10 +1797,10 @@ sub output_maillist_foot { &output_doclink($handle); ## Close document - $tmp = $IDXPGEND; - $tmp =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; + ($tmp = $IDXPGEND) =~ s/$VarExp/&replace_li_var($1,'')/geo; print $handle $tmp; } + ##--------------------------------------------------------------------------- ## Output link to documentation, if specified ## @@ -1428,6 +1815,7 @@ sub output_doclink { "\n"; } } + ############################################################################# ## Miscellaneous routines ############################################################################# @@ -1436,225 +1824,7 @@ sub getNewMsgNum { $NumOfMsgs++; $LastMsgNum++; $LastMsgNum; } -##--------------------------------------------------------------------------- -## replace_li_var() is used to substitute vars to current -## values. This routine relies on dynamic linking for $i, -## $i_{p0,p1,m1}, $index, $maxnum and $filename. -## -sub replace_li_var { - local($val) = $_[0]; - local($var,$len,$canclip,$raw,$isurl,$tmp,$ret) = ('',0,0,0,0,'',''); - local($expand) = (0); - - ## Get length specifier (if defined) - ($var, $len) = split(/:/, $val, 2); - - ## Check if variable in a URL string - $isurl = 1 if ($len =~ s/u//ig); - - REPLACESW: { - if ($var eq 'SUBJECT') { - $canclip = 1; $raw = 1; $isurl = 0; - $tmp = &dehtmlize($Subject{$index}); - last REPLACESW; - } - if ($var eq 'SUBJECTNA') { - $canclip = 1; $raw = 1; - $tmp = &dehtmlize($Subject{$index}); - last REPLACESW; - } - if ($var eq 'A_ATTR') { - $isurl = 0; $tmp = qq|NAME="$i_p0" HREF="$filename"|; - last REPLACESW; - } - if ($var eq 'A_NAME') - { $isurl = 0; $tmp = qq|NAME="$i_p0"|; last REPLACESW; } - if ($var eq 'A_HREF') - { $isurl = 0; $tmp = qq|HREF="$filename"|; last REPLACESW; } - if ($var eq 'DATE') - { $tmp = $Date{$index}; last REPLACESW; } - if ($var eq 'DDMMYY') { - $tmp = &time2mmddyy((split(/$X/o, $index))[0], 'ddmmyy'); - last REPLACESW; - } - if ($var eq 'DOCURL') - { $isurl = 0; $tmp = $DOCURL; last REPLACESW; } - if ($var eq 'FROM') { - $canclip = 1; $raw = 1; - $tmp = &dehtmlize($From{$index}); - last REPLACESW; - } - if ($var eq 'FROMADDR') { - $canclip = 1; $raw = 1; - $tmp = &dehtmlize(&extract_email_address($From{$index})); - last REPLACESW; - } - if ($var eq 'FROMNAME') { - $canclip = 1; $raw = 1; - $tmp = &dehtmlize(&extract_email_name($From{$index})); - last REPLACESW; - } - if ($var eq 'GMTDATE') - { $tmp = $curdate; last REPLACESW; } - if ($var eq 'ICON') { - if ($Icons{$ContentType{$index}}) { - $tmp = qq||; - } else { - $tmp = qq|[unknown]|; - } - last REPLACESW; - } - if ($var eq 'ICONURL') { - $isurl = 0; - if ($Icons{$ContentType{$index}}) { - $tmp = $Icons{$ContentType{$index}}; - } else { - $tmp = $Icons{'unknown'}; - } - last REPLACESW; - } - if ($var eq 'IDXFNAME') - { $tmp = $IDXNAME; last REPLACESW; } - if ($var eq 'IDXSIZE') - { $tmp = $IDXSIZE; last REPLACESW; } - if ($var eq 'IDXTITLE') - { $canclip = 1; $tmp = $TITLE; last REPLACESW; } - if ($var eq 'LOCALDATE') - { $tmp = $locdate; last REPLACESW; } - if ($var eq 'MMDDYY') { - $tmp = &time2mmddyy((split(/$X/o, $index))[0], 'mmddyy'); - last REPLACESW; - } - if ($var eq 'MSGID') { - &defineIndex2MsgId(); - $tmp = $Index2MsgId{$index}; - last REPLACESW; - } - if ($var eq 'MSGNUM') - { $tmp = $i_p0; last REPLACESW; } - if ($var eq 'NEXTFROM') { - $canclip = 1; $raw = 1; - $tmp = &dehtmlize($From{$nextindex}); - last REPLACESW; - } - if ($var eq 'NEXTFROMADDR') { - $canclip = 1; $raw = 1; - $tmp = &dehtmlize(&extract_email_address($From{$nextindex})); - last REPLACESW; - } - if ($var eq 'NEXTFROMNAME') { - $canclip = 1; $raw = 1; - $tmp = &dehtmlize(&extract_email_name($From{$nextindex})); - last REPLACESW; - } - if ($var eq 'NEXTMSG') - { $tmp = "msg${i_p1}.html"; last REPLACESW; } - if ($var eq 'NEXTMSGNUM') - { $tmp = $i_p1; last REPLACESW; } - if ($var eq 'NEXTSUBJECT') { - $canclip = 1; $raw = 1; - $tmp = &dehtmlize($Subject{$nextindex}); - last REPLACESW; - } - if ($var eq 'NUMFOLUP') - { $tmp = $FolCnt{$index}; last REPLACESW; } - if ($var eq 'NUMOFIDXMSG') { - $tmp = ($NumOfMsgs > $IDXSIZE ? $IDXSIZE : $NumOfMsgs); - last REPLACESW; - } - if ($var eq 'NUMOFMSG') - { $tmp = $NumOfMsgs; last REPLACESW; } - if ($var eq 'ORDNUM') - { $tmp = $i+1; last REPLACESW; } - if ($var eq 'OUTDIR') - { $tmp = $OUTDIR; last REPLACESW; } - if ($var eq 'PREVFROM') { - $canclip = 1; $raw = 1; - $tmp = &dehtmlize($From{$previndex}); - last REPLACESW; - } - if ($var eq 'PREVFROMADDR') { - $canclip = 1; $raw = 1; - $tmp = &dehtmlize(&extract_email_address($From{$previndex})); - last REPLACESW; - } - if ($var eq 'PREVFROMNAME') { - $canclip = 1; $raw = 1; - $tmp = &dehtmlize(&extract_email_name($From{$previndex})); - last REPLACESW; - } - if ($var eq 'PREVMSG') - { $tmp = "msg${i_m1}.html"; last REPLACESW; } - if ($var eq 'PREVMSGNUM') - { $tmp = $i_m1; last REPLACESW; } - if ($var eq 'PREVSUBJECT') { - $canclip = 1; $raw = 1; - $tmp = &dehtmlize($Subject{$previndex}); - last REPLACESW; - } - if ($var eq 'PROG') - { $tmp = $PROG; last REPLACESW; } - if ($var eq 'TIDXFNAME') - { $tmp = $TIDXNAME; last REPLACESW; } - if ($var eq 'TIDXTITLE') - { $canclip = 1; $tmp = $TTITLE; last REPLACESW; } - if ($var eq 'VERSION') - { $tmp = $VERSION; last REPLACESW; } - if ($var eq '') - { $tmp = '$'; last REPLACESW; } - if ($var eq 'NEXTBUTTON') { - $expand = 1; - $tmp = (($i < $maxnum) ? $NEXTBUTTON : $NEXTBUTTONIA); - last REPLACESW; - } - if ($var eq 'NEXTLINK') { - $expand = 1; - $tmp = (($i < $maxnum) ? $NEXTLINK : $NEXTLINKIA); - last REPLACESW; - } - if ($var eq 'PREVBUTTON') { - $expand = 1; - $tmp = (($i > 0) ? $PREVBUTTON : $PREVBUTTONIA); - last REPLACESW; - } - if ($var eq 'PREVLINK') { - $expand = 1; - $tmp = (($i > 0) ? $PREVLINK : $PREVLINKIA); - last REPLACESW; - } - if ($var eq 'YYMMDD') { - $tmp = &time2mmddyy((split(/$X/o, $index))[0], 'yymmdd'); - last REPLACESW; - } - warn qq|Warning: Unrecognized variable: "$val"\n|; - return ''; - } - - ## Check if string needs to expanded again - if ($expand) { - $tmp =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; - } - - ## Check if clipping string - if ($len > 0 && $canclip) { - $ret = substr($tmp, 0, $len); - } else { - $ret = $tmp; - } - - ## Check if URL text specifier is set - if ($isurl) { - $ret = &urlize($ret); - } else { - &htmlize(*ret) if $raw; - } - - ## Check for subject link - $ret = qq|$ret| if $var eq 'SUBJECT'; - $ret; -} ##--------------------------------------------------------------------------- ## Add mailto URLs to $str. ## @@ -1666,6 +1836,7 @@ sub mailto { $str =~ s|([\!\%\w\.\-+=/]+@[\w\.\-]+)|$1|g; } } + ##--------------------------------------------------------------------------- ## $sub, $msgid, $from come from read_mail_header() (ugly!!!!) ## @@ -1681,6 +1852,7 @@ sub mailUrl { $url =~ s/\$TO\$/$to/g; qq|$to|; } + ##--------------------------------------------------------------------------- sub newsurl { local(*str) = shift; @@ -1693,66 +1865,20 @@ sub newsurl { } $str = $h . join(', ', @groups); # Rejoin string } + ##--------------------------------------------------------------------------- -sub get_header_tags { - local($f) = shift; - local($ftago, $ftagc, $tago, $tagc); - - ## Get user specified tags (this is one funcky looking code) - $tag = (defined($HeadHeads{$f}) ? - $HeadHeads{$f} : $HeadHeads{"-default-"}); - $ftag = (defined($HeadFields{$f}) ? - $HeadFields{$f} : $HeadFields{"-default-"}); - if ($tag) { $tago = "<$tag>"; $tagc = ""; } - else { $tago = $tagc = ''; } - if ($ftag) { $ftago = "<$ftag>"; $ftagc = ""; } - else { $ftago = $ftagc = ''; } - - ($tago, $tagc, $ftago, $ftagc); -} -##--------------------------------------------------------------------------- +## Routine to add mailto/news links to a message header string. +## sub field_add_links { local($label, *fld_text) = @_; &mailto(*fld_text) if !$NOMAILTO && - $label =~ /^(to|from|cc|sender|reply-to)/i; + $label =~ /^(to|from|cc|sender|reply-to|resent-to|resent-cc)/i; &newsurl(*fld_text) if !$NONEWS && $label =~ /^newsgroup/i; } -##--------------------------------------------------------------------------- -## convert_line() translates a line to HTML. Checks are made for -## embedded URLs. -## -sub convert_line { - local($str) = $_[0]; - local($item, $item2, $item2h, @array); - - if (!$NOURL && - (@array = split(m%($Url[^\s\(\)\|<>"']*[^\.\?;,"'\|\[\]\(\)\s<>])%o, - $str)) - ) { - $str = ''; - while($#array > 0) { - $item = &entify(shift @array); # Get non-URL text - $item2 = shift @array; # Get URL - $item2h = &entify($item2); # Variable for content - - $str .= join('', - $item, - '', $item2h, ''); - - # The next line is needed since Perl's split function also - # returns extra entries for nested ()'s in the split pattern. - shift @array if $array[0] =~ m%^$Url$%o; - } - $item = &entify(shift @array); # Last item in array - $str .= $item; - } else { - &htmlize(*str); - } - $str; -} + ##--------------------------------------------------------------------------- ## ign_signals() sets mhonarc to ignore termination signals. This ## routine is called right before an archive is written/editted to @@ -1766,9 +1892,11 @@ sub ign_signals { $SIG{'QUIT'} = 'IGNORE'; $SIG{'TERM'} = 'IGNORE'; } + ##--------------------------------------------------------------------------- ## set_handler() sets up the quit() routine to be called when ## a termination signal is sent to mhonarc. +## sub set_handler { $SIG{'ABRT'} = 'quit'; $SIG{'HUP'} = 'quit'; @@ -1777,22 +1905,16 @@ sub set_handler { $SIG{'QUIT'} = 'quit'; $SIG{'TERM'} = 'quit'; } + ##--------------------------------------------------------------------------- -## create_lock_file() creates a file with zero permissions to act -## as a lock. Thanks to Walter_Hobbs@rand.org (Walt Hobbs) for -## giving me a way to achieve this in Perl without possible race -## conditions or the use of syscall. -## -## Note: There is yet to be a way to a single locking capability -## that works across mutliple operating systems: Unix, DOS, etc. +## create_lock_file() creates a directory to act as a lock. ## sub create_lock_file { local($file, $tries, $sleep, $force) = @_; local($umask, $ret); $ret = 0; - eval '$umask = umask(0777)' if $UNIX; while ($tries > 0) { - if (open(LCK_FILE, "> $file")) { + if (mkdir($file, 0777)) { $ISLOCK = 1; $ret = 1; last; @@ -1800,25 +1922,37 @@ sub create_lock_file { sleep($sleep) if $sleep > 0; $tries--; } - if ($force) { # Set lock files if force option set + if ($force) { $ISLOCK = 1; $ret = 1; } - eval 'umask($umask)' if $UNIX; $ret; } + ##--------------------------------------------------------------------------- +## Routine to clean up stuff +## sub clean_up { if ($ISLOCK) { - unlink ($LOCKFILE); + if (-d $LOCKFILE) { + rmdir($LOCKFILE); + } else { + unlink($LOCKFILE); + } $ISLOCK = 0; } } + ##--------------------------------------------------------------------------- +## Error routine. Clean up stuff and die. +## sub error { &clean_up(); - die @_, "\n"; + die @_; } + ##--------------------------------------------------------------------------- +## Quit execution +## sub quit { local($status) = shift; &clean_up(); @@ -1828,128 +1962,238 @@ sub quit { } exit $status; } + ##--------------------------------------------------------------------------- -## Create HTML for header -sub htmlize_header { - local(*fields, *l2o) = @_; - local($tmp, $key, $tago, $tagc, $ftago, $ftagc, $mesg, $item, @array, %hf); - %hf = %fields; - foreach $item (@FieldOrder) { - if ($item eq '-extra-') { - foreach $key (sort keys %hf) { - next if $FieldODefs{$key}; - delete $hf{$key}, next if &exclude_field($key); - - @array = split(/$'FieldSep/o, $hf{$key}); - foreach $tmp (@array) { - $tmp = &convert_line($tmp); - &field_add_links($key, *tmp); - ($tago, $tagc, $ftago, $ftagc) = &get_header_tags($key); - $mesg .= join('', "
  • \n", - $tago, $l2o{$key}, $tagc, ": ", - $ftago, $tmp, $ftagc, "\n", - "
  • \n"); +## Routine to compute the order messages are listed by thread. +## Main use is to provide the ability to correctly define +## values for resource variables related to next/prev thread +## message. +## +## NOTE: Thread order is determined by all the messages in an +## archive, and not by what is visible in the thread index page. +## Hence, if the thread index page size is less than number of +## messages, the next/prev messages of thread (accessible via +## resource variables) will not necessarily correspond to the +## actual physical next/prev message listed in the thread index. +## +## The call to do_thread() defines the TListOrder array for use +## in expanding thread related resource variables. +## +sub compute_threads { + local(%FirstSub2Index) = (); + local(%Counted) = (); + local(%stripsub) = (); + local(@refs); + local($index, $msgid, $refindex, $depth, $tmp); + + @TListOrder = (); # reset + %Index2TLoc = (); # reset + + @ThreadList = sort increase_index keys %Subject; + + ## Find first occurrances of subjects + foreach $index (@ThreadList) { + $tmp = $Subject{$index}; + 1 while (($tmp =~ s/^re[\[\]\d]*:\s*//i) || + ($tmp =~ s/\s*-\s*re[ply|sponse]\s*$//i)); + + $stripsub{$index} = $tmp; + $FirstSub2Index{$tmp} = $index + unless $FirstSub2Index{$tmp} || + grep($MsgId{$_}, split(/$X/o, $Refs{$index})); + } + + ## Compute thread data + TCOMP: foreach $index (@ThreadList) { + + # Check for explicit threading + if (@refs = split(/$X/o, $Refs{$index})) { + $depth = 0; + while ($msgid = pop(@refs)) { + if (($refindex = $MsgId{$msgid})) { + + $HasRef{$index} = $refindex; + $HasRefDepth{$index} = $depth; + if ($Replies{$refindex}) { + $Replies{$refindex} .= $bs . $index; + } else { + $Replies{$refindex} = $index; + } + next TCOMP; } - delete $hf{$key}; + ++$depth; } - } else { - if (!&exclude_field($item) && $hf{$item}) { - @array = (split(/$'FieldSep/o, $hf{$item})); - foreach $tmp (@array) { - $tmp = &convert_line($tmp); - &field_add_links($item, *tmp); - ($tago, $tagc, $ftago, $ftagc) = &get_header_tags($item); - $mesg .= join('', "
  • \n", - $tago, $l2o{$item}, $tagc, ": ", - $ftago, $tmp, $ftagc, "\n", - "
  • \n"); + } + } continue { + # Check for subject-based threading + if (!$HasRef{$index}) { + if (($refindex = $FirstSub2Index{$stripsub{$index}}) && + ($refindex ne $index)) { + + $HasRef{$index} = $refindex; + $HasRefDepth{$index} = 0; + if ($SReplies{$refindex}) { + $SReplies{$refindex} .= $bs . $index; + } else { + $SReplies{$refindex} = $index; } } - delete $hf{$item}; } } - if ($mesg) { $mesg = "
      \n" . $mesg . "
    \n"; } - $mesg; + + ## Calculate thread listing order + ## + if ($TREVERSE) { + @ThreadList = sort decrease_index keys %Subject; + } + foreach $index (@ThreadList) { + unless ($Counted{$index} || $HasRef{$index}) { + &do_thread($index, 0); + } + } } + ##--------------------------------------------------------------------------- -sub output_thread_index { - local($handle) = $_[0]; - local(%HasRef, %Replies, %Printed); - local(@array, @refs); - local($index, $msgid, $refindex, $level); +## do_thread() computes the order messages are listed by thread. +## Uses %Counted defined locally in compute_thread_from_list(). +## do_thread() main purpose is to set the TListOrder array and +## Index2TLoc assoc array. +## +sub do_thread { + local($idx, $level) = ($_[0], $_[1]); + local(@repls, @srepls); - ## Routine to print thread - ## - sub print_thread { - local($i) = @_; - local(@repls); - - &print_thread_entry($handle, $i); - $Printed{$i} = 1; - if (@repls = sort increase_index split(/$bs/o, $Replies{$i})) { - $level++; - print $handle "
      \n" if $level <= $TLEVELS; - foreach (@repls) { - &print_thread($_); - } - print $handle "
    \n" if $level <= $TLEVELS; - $level--; + ## Get replies + @repls = sort increase_index split(/$bs/o, $Replies{$idx}); + @srepls = sort increase_index split(/$bs/o, $SReplies{$idx}); + + ## Add index to printed order list (IMPORTANT SIDE-EFFECT) + push(@TListOrder, $idx); + $Index2TLoc{$idx} = $#TListOrder; + + ## Mark message + $Counted{$idx} = 1; + $ThreadLevel{$idx} = $level; + + if (@repls) { + foreach (@repls) { + &do_thread($_, $level + 1 + $HasRefDepth{$_}); } } + if (@srepls) { + foreach (@srepls) { + &do_thread($_, $level + 1 + $HasRefDepth{$_}); + } + } +} - ## Compute threads - ## - foreach $index (keys %Subject) { - next unless $Refs{$index}; - @refs = split(/$X/o, $Refs{$index}); - $msgid = $refs[$#refs]; ## get last (rfc1036) - if ($refindex = $MsgId{$msgid}) { - $HasRef{$index} = 1; - if ($Replies{$refindex}) { - $Replies{$refindex} .= $bs . $index; - } else { - $Replies{$refindex} = $index; +##--------------------------------------------------------------------------- +## Routine to print thread. +## Uses %Printed defined by caller. +## +sub print_thread { + local($handle, $idx, $top) = ($_[0], $_[1], $_[2]); + local(@repls, @srepls); + local($attop, $haverepls, $hvnirepls, $single, $depth, $i); + + ## Get replies + @repls = sort increase_index split(/$bs/o, $Replies{$idx}); + @srepls = sort increase_index split(/$bs/o, $SReplies{$idx}); + $depth = $HasRefDepth{$idx}; + $hvnirepls = (@repls || @srepls); + + @repls = grep($TVisible{$_}, @repls); + @srepls = grep($TVisible{$_}, @srepls); + $haverepls = (@repls || @srepls); + + ## $hvnirepls is a flag if the message has replies, but they are + ## not visible. $haverepls is a flag if the message has visible + ## replies. $hvnirepls is used to determine the $attop and + ## $single flags. $haverepls is used for determine recursive + ## calls and level. + + ## Print entry + #$attop = ($top && $haverepls); + #$single = ($top && !$haverepls); + $attop = ($top && $hvnirepls); + $single = ($top && !$hvnirepls); + + if ($attop) { + &print_thread_var($handle, $idx, *TTOPBEG); + } elsif ($single) { + &print_thread_var($handle, $idx, *TSINGLETXT); + } else { + ## Check for missing messages + if ($DoMissingMsgs) { + for ($i = $depth; $i > 0; $i--) { + $level++; + &print_thread_var($handle, $idx, *TLINONE); + &print_thread_var($handle, $idx, *TSUBLISTBEG) + if $level <= $TLEVELS; } } + &print_thread_var($handle, $idx, *TLITXT); } - ## Print index - ## - if ($TREVERSE) { - @array = sort decrease_index keys %Subject; - } else { - @array = sort increase_index keys %Subject; + ## Increment level count if their are replies + if ($haverepls) { + $level++; } - # Set messages that are shown in index - if ($IDXSIZE && (($i = ($#array+1) - $IDXSIZE) > 0)) { - if ($TREVERSE) { - splice(@array, $IDXSIZE); - } else { - splice(@array, 0, $i); + + ## Mark message printed + $Printed{$idx} = 1; + + ## Print sub-threads + if (@repls) { + &print_thread_var($handle, $idx, *TSUBLISTBEG) if $level <= $TLEVELS; + foreach (@repls) { + &print_thread($handle, $_); } + &print_thread_var($handle, $idx, *TSUBLISTEND) if $level <= $TLEVELS; } - if ($TSUBSORT) { - @array = sort increase_subject @array; + if (@srepls) { + &print_thread_var($handle, $idx, *TSUBLISTBEG) if $level <= $TLEVELS; + &print_thread_var($handle, $idx, *TSUBJECTBEG); + foreach (@srepls) { + &print_thread($handle, $_); + } + &print_thread_var($handle, $idx, *TSUBJECTEND); + &print_thread_var($handle, $idx, *TSUBLISTEND) if $level <= $TLEVELS; } - print $handle "
      \n"; - foreach $index (@array) { - &print_thread($index) unless $Printed{$index} || $HasRef{$index}; + + ## Decrement level count if their were replies + if ($haverepls) { + $level--; + } + ## Check for missing messages + if ($DoMissingMsgs && !($attop || $single)) { + for ($i = $depth; $i > 0; $i--) { + &print_thread_var($handle, $idx, *TLINONEEND); + &print_thread_var($handle, $idx, *TSUBLISTEND) + if $level <= $TLEVELS; + $level--; + } + } + + ## Close entry text + if ($attop) { + &print_thread_var($handle, $idx, *TTOPEND); + } elsif (!$single) { + &print_thread_var($handle, $idx, *TLIEND); } - print $handle "
    \n"; } + ##--------------------------------------------------------------------------- -sub print_thread_entry { - local($handle, $index) = @_; +## Print out text based upon resource variable referenced by *tvar. +## +sub print_thread_var { + local($handle, $index, *tvar) = @_; local($i_p0, $filename, $tmpl, $msgnum); - $msgnum = $IndexNum{$index}; - $i_p0 = &fmt_msgnum($msgnum); # Var for replace_li_var - $filename = &msgnum_filename($msgnum); # Var for replace_li_var - - $tmpl = $TLITXT; - $tmpl =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge; - print $handle "
  • ", $tmpl, "
  • \n"; + ($tmpl = $tvar) =~ s/$VarExp/&replace_li_var($1,$index)/geo; + print $handle $tmpl; } + ##--------------------------------------------------------------------------- ## Create Index2MsgId if not defined ## @@ -1960,126 +2204,54 @@ sub defineIndex2MsgId { } } } + ##--------------------------------------------------------------------------- -## create_routines is used to dynamically create routines that -## would benefit from being create at run-time. Routines -## that have to check against several regular expressions -## are candidates. +## Version routine ## -sub create_routines { - local($sub) = ''; - - ##----------------------------------------------------------------------- - ## exclude_field: Used to determine if field should be excluded from - ## message header - ## - $sub =<<'EndOfRoutine'; - sub exclude_field { - local($f) = shift; - local($pat, $ret); - $ret = 0; - EXC_FIELD_SW: { -EndOfRoutine - - # Create switch block for checking field against regular - # expressions (an large || statement could also work). - foreach $pat (keys %HFieldsExc) { - $sub .= join('', - 'if ($f =~ /^', - $pat, - '/i) { $ret = 1; last EXC_FIELD_SW; }', - "\n"); - } +sub version { + select(STDOUT); + print $VINFO; + exit 0; +} - $sub .=<<'EndOfRoutine'; - } - $ret; +##--------------------------------------------------------------------------- +## Routine to update 1.x data structures to 2.0. +## +sub update_data_1_to_2 { + local(%EntName2Char) = ( + 'lt', '<', + 'gt', '>', + 'amp', '&', + ); + #-------------------------------------- + sub entname_to_char { + local($name) = shift; + local($ret) = $EntName2Char{$name}; + if (!$ret) { + $ret = "&$name;"; } -EndOfRoutine - - eval $sub; - &error("ERROR: Unable to create exclude_field routine:\n\t$@") if $@; + $ret; + } + #-------------------------------------- + local($index); + foreach $index (keys %From) { + $From{$index} =~ s/\&([\w-.]+);/&entname_to_char($1)/ge; + } + foreach $index (keys %Subject) { + $Subject{$index} =~ s/\&([\w-.]+);/&entname_to_char($1)/ge; + } + delete $IndexNum{''}; + $TLITXT = '
  • ' . $TLITXT unless ($TLITXT) && ($TLITXT =~ /
  • /i); + $THEAD .= "
      \n" unless ($THEAD) && ($THEAD =~ m%
        \s*$%i); + $TFOOT = "
      \n" unless ($TFOOT) && ($TFOOT =~ m%^\s*
    %i); } + ##--------------------------------------------------------------------------- ## Usage routine ## sub usage { - select(STDOUT); - print <] ... - $PROG [] -rmm ... -Options: - -add : Add message(s) to archive - -dbfile : Name of MHonArc database file - (def: ".mhonarc.db") - -docurl : URL to MHonArc documentation - (def: "http://www.oac.uci.edu/indiv/ehood/ - mhonarc.html") - -editidx : Only edit/change index page and messages - -force : Perform archive operation even if unable to lock - -footer : File containing user text for bottom of index page - -genidx : Output index to stdout based upon archive contents - -header : User text to include at top of index page - -help : This message - -idxfname : Name of index page - (def: "maillist.html") - -idxsize <#> : Maximum number of messages shown in indexes - -lockdelay <#> : Time delay, in seconds, between lock tries - (def: "3") - -locktries <#> : Maximum number of tries in locking an archive - (def: "10") - -mailtourl : URL to use for e-mail address hyperlinks - (def: "mailto:\$TO\$") - -maxsize <#> : Maximum number of messages allowed in archive - -msgsep : Message separator expression for mailbox files - (def: "^From ") - -nodoc : Do not print link to doc at end of index page - -nomailto : Do not add in mailto links for e-mail addresses - -nonews : Do not add links to newsgroups - -noreverse : List messages in normal order - -nosort : Do not sort messages - -nothread : Do not create threaded index - -notsubsort : Do not sort threads by subject - -outdir : Destination/location of HTML mail archive - (def: ".") - -quiet : Suppress status messages during execution - -rcfile : Resource file for MHonArc - -reverse : List messages in reverse order - -rmm : Remove messages from archive - -savemem : Write message data while processing - -scan : List out archive contents to stdout - -single : Convert a single message to HTML - -sort : Sort by dates (this is the default) - -subsort : Sort message by subject - -thread : Create threaded index - -tidxfname : File name of threaded index page - (def: "threads.html") - -time : Print to stderr CPU time used to process mail - -title : Title of main index page - (def: "Mail Index") - -tlevels <#> : Maximum # of nested lists in threaded index - (def: "3") - -treverse : List threads with newest thread first - -tsubsort : Sort threads by subject - -ttitle : Title of thread index page - (def: "Mail Thread Index") - -umask : Umask of MHonArc process - -Description: - MHonArc is a highly customizable Perl program for converting e-mail into - HTML. MHonArc will convert UUCP style mailbox files or MH mail folders - into HTML with an index linking to each mail message. The -single option - can be used to convert a single mail message. - - Read the documentation for more complete usage information. - -Version: - $VERSION - Copyright (C) 1995,1996 Earl Hood, ehood\@isogen.com - MHonArc comes with ABSOLUTELY NO WARRANTY and MHonArc may be copied only - under the terms of the GNU General Public License, which may be found in - the MHonArc distribution. - -EndOfUsage - exit 0; + require 'mhusage.pl' || + die("ERROR: Unable to require mhusage.pl.\n", + "Did you install MHonArc properly?\n"); + &quit(0); }