<<< Date Index >>>     <<< Thread Index >>>

Re: mime type of tbz2



Hello,

 On Thursday, October 20, 2005 at 11:22:40 -0700, none none wrote:

> I hope I found the right place for making a couple of small
> suggestions for improvements to mutt. :)

    Thanks for the suggestions, always very welcome. Yes, MD is a right
place, even if BTS bugs.mutt.org would have been yet righter. A Bug
Tracker has the tremendous advantage to not let us forget something we
don't do immediatly.


> Chapter 5 of the online mutt manual says "If Mutt can not determine
> the mime type by the extension of the file you attach, it will look at
> the file. If the file is free of binary information, Mutt will assume
> that the file is plain text, and mark it as text/plain. If the file
> contains binary information, then Mutt will mark it as
> application/octet-stream."

    The <F1> is right. But simplified: Doesn't explain the details of
the used statistical heuristic. See sendlib.c:update_content_info() and
mutt_make_file_attach(), or grep for "(hi|lo)bin".


> I recently sent a .tbz2 file (tar archive compressed with bzip2) to a
> friend, and mutt did not handle it too well. It (apparently did not
> think that the file contained "binary information" and sent it as
> plain text (with quoted-printable encoding - ugh!)

    That's quite strange for a tbz2, but admitedly can happen for
specific files, containing a low ratio of bytes below 32, like texts.


> one can fix this with an appropriate entry to the mime.types file (I
> think that the file should contain this entry by default)

    Yes, agreed. Modeled after gzip entries, and unless someone knows
more official types, what about adding to sample mime.types:

| application/x-bunzip2         bz2
| application/x-tar-bz2         tbz2 tar.bz2


> the code that sees this as plain text maybe could use a little
> tweaking, as well. :)

    Warning: Touching a carefully crafted heuristic could do harm. It's
a delicately equilibrated compromise. Could you please make the tbz2
available to us somewhere?


Bye!    Alain.
-- 
He even put in one of the stinkin smilies (you know: yellow, round,
happy... my personal preference is the one with a bleeding bullet hole
in is happy yellow forehead)...
        Greg K. in « Scarface IV -- I Hate Them All »