nmh-workers
[Top] [All Lists]

Re: [nmh-workers] Formatting HTML to Text: netrik.

2019-06-30 20:06:24
Alright, now that I have some more free time ...

Ok, these things are not hard.

Speak for yourself!  My little pea brain is still trying to grok all
this.

Well, I meant that I think all of the TOOLS are there and mostly stuff
should work with a little help.

I don't know if the package for nmh on FreeBSD sets things up
correctly, but if you look at mhn.defaults (which should be in the
'etc' directory somewhere) you might see a line that looks like:

mhshow-show-text/html: [...]

I have *no* line in /usr/local/etc/nmh/mhn.defaults file that begins
with or even contains the literal string "mhshow-show-text/html".

Hm.  I suspect that if you installed it again, now that you have w3m
installed, it might add the appropriate line (assuming you compiled it
from source rather than installed a precompiled package).  It looks like
the maintainer of that port is Cy Schubert.  Maybe I will drop him a
line and suggest that w3m should be declared as a dependency for nmh so
the out-of-box experience is better.

So I
have tried to add what you posted to my test account ~/.mh_profile file,
but the line you sent got garbled in transmission because your posting
was:

   Content-Transfer-Encoding: quoted-printable

Um, I have to ask ... how did you even notice this?  Because nmh should
have decoded that transparently and you shouldn't have noticed.  I do
not notice at all if content is quoted-printable or base64 unless I really
look for it.  If that is not working then something fundamental is going
wrong and I would like to understand it.

I have tried my best to infer what you wrore. Please check and tell me
if this is exactly correct:

  https://pastebin.com/raw/MQLysN7U

That looks alright, but again, I don't understand why you aren't seeing the
decoded quoted-printable.

Mostly, it looks OK, but I keep on getting stuff like this at the top:

  [ part 1 - text/html - 1.3KB ]

Those are the part markers and you can turn them off if you REALLY want.

also (we have native support for iconv).  And just as a matter of
future-proofing, I'd recommend using a UTF-8 locale if you aren't
already.

How would I know, one way or the other?

Here is what I have set. is this what you are talking about?  Or do I
need to fiddle sonmething else entirely?

   % env | fgrep LOCALE
XTERM_LOCALE=en_US.UTF-8

Yeah, that's correct.  So, that's good.

It sure looks to me like *all* header types are *already* being
displayed when I just do "show", so why are you thinking that I need ot
do something additional in order to see the full headers?

Well, I am just going on what you said, where you said you needed to
make some changes to see the "full headers".

(The only problem is that the headers, as they are displayed with
"show", appear to have has some extra whitespace inserted... by
*something*... just after the colons in each case.  How do I shut THAT
off?)

Well, I DO have to ask ... did you happen to look at the mhl man page
at all?  I had kind of assumed that you did, but maybe that was a bad
assumption on my part.  Look at that man page, specifically the "compwidth"
variable.

Ummmm... Here is the /usr/local/etc/nmh/mhl.headers fle that is these
days being distributed & installed with nmh itself for FreeBSD:

  https://pastebin.com/raw/w7gmsWVJ

I'm not seeing any "ignore" lines in there.  So maybe, in my case, this
whole issue has been "pre-fixed" to my liking already (?)

Are you SURE you don't see an "ignores" line in that above link?  Are you
ABSOLUTELY sure?  Maybe between the line that begins with "leftadjust"
and the one that begins with "Date"?

Ohhhhhhh!  Wait! in the Mail/ directory of my "test" account it seems
that I already had a file called "mhl.headers" in there, and I guess
that is overriding the system default.  Here is the Mail/mhl.headers
that's already in my test account.  (Is this really no good?  Seems
perfectly servicable to me!)

   https://pastebin.com/raw/BdeQQjCF

Well, I mean ... it does exactly what it is supposed to do, which is
display the full message headers (honestly, I would have thought you
might want them in a particular order, but hey, it's your email).

Well, so I deleted the Mail/mhl.headers file for my test account and did
a "show" again on one piece of old spam that had been received back in
Feb. and this is what that looks like now when I do "show":

    https://pastebin.com/raw/JLAGbvbM

This seems fairly messed up to me.  I understand that the default
systemwide mhl.headers file is (somehow) preventing me from seeing the
Received: headers, but even ignoring that small fly in the ointment, why
the bleep am I now getting (what I assume are) the "important" headers,
shown at the top, followed by a blank line and then a bunch of *other*
header lines?  Is that really the effect that the default mhl.headers
file is *supposed* to produce??

Ummm ... yes.  That is exactly what it is supposed to do.  But that is
the beauty of nmh, you can change it to behave however you want.  That
practice is historical; the original MH 6.8 did something similar with
regards to header formatting and blank lines and that has been brought
forward.  But that is the great thing about nmh, you can change it to
do whatever you want.  I would humbly suggest that you might be happier
if you had some of the header fields decoded so you could see what they
look after MIME decoding; the bare-bones mhl format file you posted does
NOT do that.  I would look at the default mhl format files and spend
a little time with the mhl(1) man page and hopefully this will become
clearer.

With regards to repl, that was covered in my earlier email.

--Ken

-- 
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>