On 05Jun2017 22:12, Andries E. Brouwer <andries.brou...@cwi.nl> wrote:
A moment ago I sent 8 images as attachment with mutt.
Three were garbled on arrival.

As it turns out, five of the images were sent using MIME type
application/octet-strteam, and the corrupted ones using text/plain.
The images were similar, with similar names and structure,
so it looks like a random effect.

Just for some more context, did the files lack a useful file extension? If not, was their file extension lacking from the mime.types file?

For all that improving the content sniffing heuristic might be a good thing, it will always be a little unreliable, and if you can get reliable and correct behaviour by improving your system's type inference with concrete things like the file extension you should pursue that as well.

Kevin, on the subject of the heuristic, would it be worth getting mutt to consult the user.mime_type xattr value? The freedesktop stuff (IIRC) recommends that as a place to store a content-type association for a file; it has the advantage of (if set) not being subject to the vagaries of file naming.

We could have mutt consult that at a suitable point when determining the content-type (ahead of any sniffing, and ahead of file extension inference) and for added points have mutt _set_ that value when saving attachements.

Cheers,
Cameron Simpson <c...@zip.com.au>

Reply via email to