Feature #240

Rewrite URLs to inline images in HTML attachments

Added by Charles Lehner over 2 years ago.

Status:NewStart date:07/06/2015
Priority:NormalDue date:
Assignee:Hiroyuki Yamamoto% Done:


Category:LibSylphSpent time:-
Target version:-


This adds to procmime a function for retrieving a MIME attachment and its associated multipart/related attachments, while rewriting cid URLs. Specifically, if the attachment is text/html and in a multipart/related container, the attachment body is scanned and every instance of cid:X is replaced with the filename of the corresponding attachment with Content-ID X. The body with these replacements is written to a file and the attachments are saved to the temp directory. In MimeView, the actions to open the attachment or open it with an application are changed to use this feature.

This change makes it possible to view HTML emails with inline attached images when opening the HTML attachment in a browser (for multipart/related, not multipart/mixed with content-disposition inline). It is a bit of a hack, since it doesn't examine the HTML structure it could rewrite a cid: string that is not actually an image URL. However, it generally works. There are some cases in which it fails and produces some duplicate data, which I have not yet been able to fix.

0001-Detect-message-Content-ID.patch Magnifier (3.03 KB) Charles Lehner, 07/06/2015 05:35 AM

0002-Allow-fetching-multipart-body-while-rewriting-CIDs.patch Magnifier (7.64 KB) Charles Lehner, 07/06/2015 05:35 AM

Also available in: Atom PDF