nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] I need to learn more about MIME

2014-09-13 10:55:27
Ken Hornstein <kenh(_at_)pobox(_dot_)com> writes:

The above referenced file, Chart.pj, contains only ASCII characters,
and has no line longer than 63 characters. Why did nmh use a
Content-Transfer-Encoding of quoted-printable instead of text/plain?

That decision is made in scan_content() in uip/mhbuildsbr.c.  Well, let
me rephrase that.  For MIME _bodies_, that's where the decision is made.
For headers that happens in sbr/encode_rfc2047.c.

The exact decision is here:

int wants_q_p = (containsnul || linelen || linespace || checksw);

containsnul means the content contains at least one byte of '0x00'.
linelen means 'longer than maxunencoded', which defaults to 78.
linespace means blanks at the end of the line.
checksw means you're generating an MD5 checksum (which honestly,
we should get rid of that code).

I suspect you're running afowl of the 'linespace' test.

The problem was that, for reasons I do not remember, Chart.pj had Microsoft
line endings and your "blanks", above includes '\r', and probably other white
space. Confession: It took me an hour to figure that out.

In the unlikely event, that you care, norms-cool-editor, will, by default,
never write a file with lines ending with white space, except that by default,
if a file had any Microsoft line endings it will write it with all Microsoft
line endings. There are interactive options to override both of those
defaults.


    Norman Shapiro

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

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