A.L.E.C wrote:
On 12/26/2012 09:38 PM, Michael Heydekamp wrote:
Our system is returning "text/x-mail" (rather than "message/rfc822", how it would be expected) when we throw the PHP function 'finfo_open' against a valid e-mail file, which has been saved locally with Roundcube, starting with a line "Return-path:". Therefore and logically Roundcube is declaring ""text/x-mail" when attaching this .eml to an e-mail, which does prevent Roundcube from handling and rendering the attchment as an e-mail.
In my opinion fileinfo result is correct. Return-path is not RFC-compliant, that's the reason why it chooses text/x-mail. So, "fixing" fileinfo is not a good way.
I think fileinfo is a bit too picky about the message/rfc822 detection and maybe it's worth the effort to forward this report to them.
both mimetypes as message/rfc822 in Roundcube. Open a ticket. There will be still a question if we should change detected mimetype of uploaded file. In my opinion we should not.
The easiest way for us would be to add an alias for text/x-mail => message/rfc822 after uploaded file type detection. The more sustainable solution would be to consider both mimetypes when parsing the message structure and rendering the contents. Maybe run all message part mimetypes through rcmail_fix_mimetype()?
~Thomas