[horde] client mime-type mismatch

Andrew Morgan morgan at orst.edu
Thu Jan 21 20:46:05 UTC 2010


On Thu, 21 Jan 2010, Michael M Slusarz wrote:

> Quoting Michael Rubinsky <mrubinsk at horde.org>:
>
>> Quoting Andrew Morgan <morgan at orst.edu>:
>> 
>>> Funny story...
>>> 
>>> Our Exchange admin contacted me with an attachment problem that he thought 
>>> was originating in Horde.  Apparently messages sent to Exchange containing 
>>> attachments with the wrong mime-type were getting stuck in the message 
>>> transport system.  They were not being delivered to a mailbox nor bounced 
>>> to the sender.  When he rebooted the Exchange server recently to apply 
>>> patches, suddenly all these ancient messages were bounced to sender.
>>> 
>>> The attachments were PDF files that had the mime-type 
>>> "application/applefile".
>>> 
>>> I was able to replicate this problem on my own computer and started 
>>> searching in Horde for some problem with mime-type detection.  Finally I 
>>> realized that it was my own browser sending the wrong mime-type!  When I 
>>> looked in Firefox's content-type handling, I saw:
>>> 
>>> PDF File (application/applefile)	Always Ask
>>> PDF File (application/pdf)		Open with xpdf
>>> 
>>> Once I edited the mimeTypes.rdf file to remove all applefile references, 
>>> the problem was fixed (for me).
>>> 
>>> Obviously, Horde is using the mime-type reported by the client browser. Is 
>>> that still a good idea, or would it be better if Horde used it own mime 
>>> detection (or fileinfo) on all uploaded files?
>>> 
>>> Finally, does anyone know how I got that crazy mime-type in Firefox?
>> 
>> Yup. This is a known issue with FF and has been discussed a few times on 
>> our mailing lists. In fact, there was a recent discussion about replacing 
>> client side with server side detection. See the following for the start of 
>> the thread:
>> 
>> http://lists.horde.org/archives/dev/Week-of-Mon-20100111/024651.html
>
> ...or just skip ahead and see the solution (IMP 5 only):
>
> http://lists.horde.org/archives/commits/2010-January/002854.html

Well, I agree that is *a* solution, although if I'm reading it right, the 
default hook code won't fix my problem.  If the browser supplies a 
mime-type that is not application/octet-stream, it won't do the 
server-side detection.

Obviously, I can modify the hook to force server-side detection, or at 
least override it for application/applefile, so that seems good to me!

Eagerly awaiting IMP5, then.  :)

 	Andy


More information about the horde mailing list