nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] corruption when attaching all-null files

2014-05-07 11:40:00
ken wrote:
in testing the marker line format, i created a bunch of files of
varying sizes in order to attach them.  by chance, i used dd from
/dev/zero to create the files, so they all consist of null characters.

it turns out that when i attach such a file, something goes wrong, and
i end up with the mime header for the attachment, but an empty part, and
mhlist complains about "bogus multipart content"

So, we handle text that contain NULs generally pretty lousy ... but
AFAICT, a NUL is not valid in a RFC 5322 (or MIME) text part.  The
specifics of that are something I'm not sure about, through; it might be
valid in some circumstances.  AFAIK, if a NUL is in a non-text part, we
should (and as far as I know, we do) handle that properly, becuase that
gets encoded with base64.

it gets assigned a type of application/octet-stream, but no encoding
gets done.  after using Attach:, and then running mime on the draft,
it looks like this:  (copy/pasted from my edit buffer, where the nulls
show up as '^@')

----cut-here----
    To: pgf-mhparts
    Subject: yat
    From: Paul Fox <pgf(_at_)foxharp(_dot_)boston(_dot_)ma(_dot_)us>
    Cc:
    Fcc: outbox
    MIME-Version: 1.0
    Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
    Content-ID: <22475.1399480415.0@grass>

    ------- =_aaaaaaaaaa0
    Content-Type: text/plain; charset="us-ascii"
    Content-ID: <22475.1399480415.1@grass>

    ----------------------
     paul fox, pgf(_at_)foxharp(_dot_)boston(_dot_)ma(_dot_)us (arlington, ma, 
where it's 63.1 degrees)

    ------- =_aaaaaaaaaa0
    Content-Type: application/octet-stream; name="19900"
    Content-Description: 19900
    Content-Disposition: attachment; filename="19900"

    
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^>

    ------- =_aaaaaaaaaa0--
----cut-here----



If you could give specifics on what went wrong that would be useful.

should be able to in a day or three.  if no one gets there first.

paul


--Ken

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

----------------------
 paul fox, pgf(_at_)foxharp(_dot_)boston(_dot_)ma(_dot_)us (arlington, ma, 
where it's 64.0 degrees)

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