[mdlug] (no subject)

David Favro mdlug at meta-dynamic.com
Wed Jan 10 07:40:07 EST 2007


Michael Corral wrote:
> Same thing in Opera. I anxiously await your code fixes for Firefox
> and Opera. :)
>   
Well, since Opera is closed-source, that would be tough, but anyhow,
like Wolfger said, this is not a mail-user-agent problem, but in how the
archived HTML is created from RFC822 (or whatever is the latest update),
apparently "pipermail".

One very intriguing option is to just archive the raw RFC822 and have
the server identify it in the HTTP headers as MIME type
"message/rfc822"... how would browsers react?

Well, I tried it and the answer is, "not perfectly out of the box, but
can be configured": you can test yours here:
http://meta-dynamic.com/pdocs/mdlug-long-lines.eml

Both Opera and Firefox initially threw up a "how to handle" dialog, but
after I told them to open such MIME types in Thunderbird, it showed me a
nicely displayed message in its own window... and with lines wrapped. :-)
This is most easily configured by just clicking on the above link and
using the dialog, but if you like config files:
For opera, this is in .opera/opera6.ini, in the [File Types] section,
you want a line like:
message/rfc822=3,thunderbird,,,eml,|
And for Firefox, it is in a file called "mimeTypes.rdf" in your profile
directory -- you need an entry similar to:
  <RDF:Description
RDF:about="urn:mimetype:externalApplication:message/rfc822"
                   NC:path="/usr/bin/thunderbird"
                   NC:prettyName="thunderbird" />

Otherwise, it would seem that pipermail needs to be configured not to
use <PRE> tags, nor to just lay the text/plain message body out there
with no tags (resulting in whitespace collapse), but rather to replace
each newline (hard line break) with a <BR> or <P> tag.  This will still,
unfortunately, collapse whitespace internal to the line (CSS2 only
defines the 'pre', 'normal', and 'nowrap' values for the 'whitespace'
property, but what is needed is a fourth option which preserves internal
whitespace but wraps lines -- perhaps a web-designer amongst us could
say how to better accomplish this), but will come closer to the
formatting of the original RFC822 source.

I don't know anything about GreaseMonkey, but I wrote up a small gawk
script to accomplish this (of course this is not the right way --
pipermail should be fixed.  Always fix problems at the source --
otherwise you haven't really fixed them and they will come back to haunt
you.  This is why closed-source software is so pernicious).  I will
attach the script.  You feed it an entire pipermail web-page as input
and it makes the fixed page as output.  I went through some gyrations to
keep the internal whitespace from getting collapsed, it's not perfect,
but not bad -- it still may not render tab characters faithfully to how
they looked in RFC822.  Had I not done that, it would be even simpler. 
You can see the results of running it on the page in question:
Input: http://mdlug.org/pipermail/mdlug/2007-January/000481.html
Output: http://meta-dynamic.com/pdocs/mdlug-long-lines-converted.html
If the fixed-width font from the <PRE> block is preferred, that is
obviously easily added, just let me know.

I tried running it on a few other randomly selected archived messages
and it seemed to generate OK output, but let me know if there's a
problem.  I used this CL:
tmp="$(mktemp)" ; wget -O - --user-agent="FOO"
'http://mdlug.org/pipermail/mdlug/2007-January/000497.html' |
./pipermail-fix.gawk >| "${tmp}" && opera -newpage "${tmp}" ; rm -f "${tmp}"

It can be applied either on the server or client side... alors, Michael,
il ne faut plus attendre avec impatience! :-)

A final thought: all of this might be less of an issue if we could also
dump that other "rule of netiquette" and give me the option to code my
emails in HTML (or some better formatting/markup language, please
suggest one).  Then presumably pipermail could just lay my source-code
out there in the archives.

Hope that helps
-- David

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pipermail-fix.gawk
URL: <http://mdlug.org/pipermail/mdlug/attachments/20070110/3e41951c/attachment.ksh>


More information about the mdlug mailing list