[dev] MIME_Magic::

Anil Madhavapeddy anil@recoil.org
Tue, 18 Dec 2001 01:06:49 +0000


On Tue, Dec 18, 2001 at 12:51:41AM +0000, Michael Cochrane wrote:
> I'd be quite keen to see this implemented. even if only an off by default
> option. As alot of attachments from windows users don't have the correct mime
> types but we have viewers that can deal with them.
> 

It's actually the IMAP server that determines the MIME type of a particular
sub-part of a message, from the point of view of IMP.

The thing is, if the server cannot determine a MIME type, it falls back to
a default type of text/plain or application/octet-stream which aren't much
use to viewers.  We are then saying that we know better based on other 
criteria in the attachment (such as filename), and overriding that default
type based on the "best guess".

I must say this strikes a note of alarm in my head regarding security,
although I'm not quite sure how it could be wrong.  

Hmm, it just occurred to me ... if we _dont_ have a MIME_Viewer configured
for that MIME type, we would pass it straight through to the end browser,
which could then have all kinds of nastiness done to it by the usual windows
means.

> On the note of viewers, i have a word file word for windows servers that uses
> the word COM component. I did this after not being able to find a win32 copy of
> wvWare a while back. Still testing enscript, All others (tar, xlhtml, rar, zip)
> are no worries on win32 system.

That sounds like a pretty good candidate for an OS-specific MIME_Viewer
class ...

Anil