On Monday, October 10, 2022 at 8:44:34 AM UTC-7, cjsmall wrote:
I have a shell script filter called "attach_view" that handles a number
of different attachment types, including HTML, PDF, Microsoft
documents and various images. I bind "|attach_view\n" to an
attachment key and can press it to see the selected attachment.
his works fine for me.
However, I'm getting HTML emails that have embedded images.
These come in as an HTML attachment, and a set of additional
image attachments which are often in random order. Is there a
method of being able to view the HTML with the attached images
as you can with most GUI email readers? Has anyone tackled
this very typical problem?
Thanks.
Following up to my own post, here is an example. From the decoded
html file there is this line:
<img src="cid:183b8408554dbcb66d71" style="width:1364px;max-width:100%">
And from the original email message:
Content-Type:
image/jpeg; name="6674A791-428C-450F-9D38-F93951FD796D.jpeg" Content-Disposition: inline;
filename="6674A791-428C-450F-9D38-F93951FD796D.jpeg" Content-Transfer-Encoding: base64
Content-ID: <183b8408554dbcb66d71>
X-Attachment-Id: 183b8408554dbcb66d71
.... encoded image ...
Which, when saved, produces the file:
19F23E05-3F36-474E-AF64-54594565D171.jpeg
Short of writing a complex program that:
* creates a temporary directory
* filters the entire email, using munpack(1) to export all the image files
* extracts the HTML portion and then edits it to replace all <img> tags
with absolute paths to the actual image file
It's certainly doable, but I hope there is a tool that does this already! In my searching I haven't found any suitable tool.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)