On September 23, 2003 at 17:48, Peter Davis wrote:
1) Does anyone already have some tools for this? I didn't see anything
in my admittedly brief scan of the documentation.
I've seen nothing for MH/nmh. But I think some would be interested
in a web-based interface to MH mail folders.
I've toyed with idea of creating one (I'm a MH/nmh user), utilizing
the underlying MH/nmh commands for most operations (like scan).
I think if you are serious in your efforts, we can move discussion
to mhonarc-dev list and possible collaborate in development.
2) When I convert single messages with:
mhonarc -single `mhpath cur` > $TEMP/mailmsg.html
the non-text MIME parts get put in my current working directly, but
the HTML references them in the $TEMP directory (I'm on Windows XP,
so it's C:\TEMP). This means non of the images, etc. show up in
the messages. Is this a known issue?
The output is assumed to be directed to a file in the current
working directory. Your command above should be changed to:
(cd $TEMP; mhonarc -single `mhpath cur` > mailmsg.html)
BTW, the -outdir option can be used to place attachments in
a separate directory, but it should be a relative pathname from
the current working directory for attachment links to be set properly.
Also, you can use the -stdout option to specify the output filename
vs relying on shell I/O redirection:
(cd $TEMP; mhonarc -single `mhpath cur` -stdout mailmsg.html)
I'm open to suggestions on improving -single mode.
3) The process_input function of the API seems not to be geared for
processing single messages. I was not able to get the output to go
anywhere except stdout, even when calling from a Perl script. I
finally had to resort to:
$html = `mhonarc -single $curmsg`;
and then write the output to a file myself. Perhaps I'm
overlooking something, but I didn't see anything in the
documentation about how to direct the output to a file from within
a script.
Use -stdout. Now, if you want the output to goto a predefined
filehandle instead of a file, you could dup STDOUT to the desired
filehandle.
My initial thoughts on implementing a web-based interface to MH/nmh is
to have a converted message cache to avoid the overhead of conversion
each time a message is viewed, especially if there are attachments.
Cached data can be removed if older than a specified time.
I would also implement the CGI in Perl so you can call mhonarc without
making shell calls. I would also write the program so it is re-entrant
so it could be used with Apache::Registry for usage with mod_perl.
The handling of attachments would require some thought since you
want to keep overhead to a minimum. I would see if mhstore and mhlist
could be pre-dominately used for attachment handling.
If you want discuss ideas and technical matters, feel free to subscribe
to the mhoanrc-dev(_at_)mhonarc(_dot_)org mailing list. Depending on how things
go, what is developed could be added to the extras directory of
the MHonArc distribution. I already include mha-mhedit,
<http://www.mhonarc.org/MHonArc/extras/mha-mhedit/mha-mhedit.html>, for
formatting MIME messages for repl.
--ewh