[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: Ken Hornstein
Subject: Re: [Nmh-workers] mhfixmsg on a pathological mail
Date: Tue, 29 Aug 2017 15:12:32 -0400

>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: <address@hidden>
>    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.


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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]