chasd, 09.03.04 18:58:
On Mar 4, 2009, at 10:56 AM, till wrote:

  
Maybe we need a wiki page.

@Charles, would you be so kind and start on one? I'd contribute some
findings as well.
    

Tell me where you'd like it, looking at the existing structure, a  
logical place doesn't pop out at me.
  

till, chasd

To the wiki, and to better understading of the problem I recommend this
blog post:
http://gaarai.com/2009/02/14/generating-mime-type-in-php-is-not-magic/

The guy is still working on it, I gave hime some hints, and will give more
after I experiment with the info on fileinfo provided by chasd. (Hey man, how do
you know that? I couldn't find that info in any documentation!)

I mentioned a patch:
http://trac.roundcube.net/attachment/ticket/1485311/mime-detect.patch
this was the base, but in the meantime I started using Trac more extensively, so:

The same proposal I made, and description of problem:
http://trac.roundcube.net/ticket/1485311

And the resolution by thomasb
http://trac.roundcube.net/changeset/2313
with a hard-coded map, they way I was thinking.

So as I said I'll start digging deeper and experimenting with fileinfo,
to get the best solution we can.


chasd, you wrote
"Hmmm, that made my security radar do a beep. Trusting user input isn't always safe."
"First, trusting the mime-type from the client is very dangerous. "


But guys, the security part of this is out of the scope of RC I think...
If the user sends something bogus by playing with the extension, who cares?
There are so many ways to do that without RC. Okay, we should try helping
SPAM and VIRUS filters, but this is their task IMHO.


Balazs