• Viewing HTML attachments with embedded pictures

    From cjsmall@21:1/5 to All on Mon Oct 10 08:44:33 2022
    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. This 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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From cjsmall@21:1/5 to cjsmall on Mon Oct 10 10:51:47 2022
    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)
  • From Christian Ebert@21:1/5 to All on Mon Oct 24 23:09:57 2022
    * cjsmall on Monday, October 10, 2022:
    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.

    shameless plug: viewhtmlmsg of
    https://hg.phloxic.productions/muttils
    does this.

    Does not use munpack, I'm afraid, but python3.

    --
    LAST SHIP HOME --->> https://lastshiphome.de/en
    Official Selection DOK.fest Munich 2018
    German Ocean Film Award CineMare Kiel 2019
    Best Documentary Feature Wales International Film Festival 2020

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From cjsmall@21:1/5 to Christian Ebert on Mon Oct 24 16:15:14 2022
    On Monday, October 24, 2022 at 3:10:04 PM UTC-7, Christian Ebert wrote:
    * cjsmall on Monday, October 10, 2022:
    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.
    shameless plug: viewhtmlmsg of
    https://hg.phloxic.productions/muttils
    does this.

    Does not use munpack, I'm afraid, but python3.

    Thanks Christian. I was just starting to write my own tool. I'll
    download and try out yours! Much appreciated.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From cjsmall@21:1/5 to All on Thu Oct 27 13:48:54 2022
    I just wanted to publically thank Christian Ebert for sharing his
    python-based tool to view html attachments with embedded
    images. It works great and saved me a lot of time and headaches
    building my own.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)