Thomas Bruederli wrote: > I see one of your messages to the list where all the image attachments > having Content-Type: application/octet-stream instead of image/jpeg or > whatever. This is also the reason why those attachment are not detected as > images and thus no thumbnails are displayed and no inline viewing is offered. > > Roundcube tries to detect the mimetypes of uploaded attachment files and > this again depends on your server's environment and configuration: > > First, there is a mapping file in <roundcubedir>/config/mimetypes.php for > simple filename extension to mimetype mapping. > > Second, check the 'mime_magic' option which should point to a valid mime > description file on your server which is used by PHP fileinfo extension > (http://www.php.net/manual/en/book.fileinfo.php).
After reading through the docs and some forum entries, it seems best if you set the 'mime_magic' config option in Roundcube to null. This will let the fileinfo extension use its default mimetype config file. For debugging purposes, check your error logs for messages like this: PHP Warning: finfo_open(): Failed to load magic database ... That of course assumes that your PHP installation includes the fileinfo module. > > And third, Roundcube tries mime_content_type() which again is a function > provided by PHP. And fourth, as the ultimate fallback, the mimetype submitted by your browser when uploading the attachment file is used. > > An easy fix is to add entries for image file extensions to your local > config/mimetypes.php file. But try to fix the 'mime_magic' path first. I'd consider this the last option because usually filename extensions are not very reliable and can easily be faked. ~Thomas _______________________________________________ Roundcube Development discussion mailing list [email protected] http://lists.roundcube.net/mailman/listinfo/dev
