nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] mhfixmsg on a pathological mail

2017-08-29 14:12:52
Well, at least it does if I'm doing comp, whatnow, mime, edit.  If I run
mhbuild(1) then it always gives quoted-printable.

   $ mhbuild -
   #<text/plain *b64
   a£d
   w£z
   MIME-Version: 1.0
   Content-Type: text/plain; charset="UTF-8"
   Content-ID: 
<17591(_dot_)1504001563(_dot_)1(_at_)orac(_dot_)inputplus(_dot_)co(_dot_)uk>
   Content-MD5: wrfRnlkZxzaLuNL9h63JVA==
   Content-Transfer-Encoding: quoted-printable

   a=C2=A3d
   w=C2=A3z

That does not look like a valid mhbuild composition file?  Specifically,
you're missing some headers; I suspect it didn't read the directive at all.

Also, it SEGVs without the `/plain'.  Probably because get_ctinfo()'s

   685     if (*cp != '/') {
   686         if (!magic)
   687             ci->ci_subtype = mh_xstrdup("");
   688         goto magic_skip;
   689     }

skips 687 because "It's magic!".

Whoops!  Yeah, will fix that for 1.7.

We don't insist on CRLF when receiving RFC 5322, right.

Right ... I was just musing that maybe we should.

My inner facist system administrator says yes.  Postel's maxim is wrong.
https://tools.ietf.org/html/draft-thomson-postel-was-wrong-00

Sigh.

I understand where you are coming from, really.  But ... practical concerns
raise their ugly heads, again.

First ... when we get invalid input, how should we react?  It's a fair
question.  Secondly, we seem to be alone in terms of strictness with regards
to parsing MIME messages; other MUAs seem to handle MIME content with
slightly irregular grammar just fine.  I'm not suggesting we be able to
handle anything that /dev/urandom puts out, but it seems that erroring out
and refusing to parse email makes it difficult for us to operate in the
real world.

If we did that, a regular expression to handle a line ending with \r\n
would be trivial.

If it were to allow /\r?\n/ then I think it should insist on consistency
for all the lines based on the first.  But really, the lexer should be
told which one of the two is valid at the start.

Another switch to add to all programs?  Ugh.  I also understand why you ask
about that, but it seems like that might make the lexer more complicated
than it needs to be.

--Ken

_______________________________________________
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>