Skip to content

Inlining images #22

Open
Open
@MaxGfeller

Description

@MaxGfeller

First of all, thanks a lot for this library and the great amount of work that went into it🙏🏻

As far as i can tell images that are appended as inline attachments are not automatically inlined in the resulting body HTML string.

For example, this element is in an email by Confluence:

<img style=3D"vertical-align: top; display: block;" src=3D"cid:page-icon" alt=3D"page icon" title=3D="page icon" height=3D"16" width=3D"16" border=3D"0">

This references an attachment, page-icon, by Content-ID which is appended later in the email body:

------=_Part_565_1697167297.1654852801463
Content-Type: image/png; name=page-icon.png
Content-Transfer-Encoding: base64
Content-ID: <page-icon>
Content-Disposition: inline; filename=page-icon.png

iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAPFBMVEX///+1tbWwsLCtra3////5
+fmLi4vZ2dnT09P8/PzPz8+rq6uhoaHR0dFycnJwcHB6enp4eHiDg4OAgIBog/vRAAAADnRSTlMA
IiJV3e7u7u7u7u7u7rDOyYEAAABUSURBVHhepcpLDoAwCABRqkBbP9Dq/e9qLYS1ibN8GQBYWFVG
fQWLWyFEJG0uknGmuz+CDnjYEzDqDpF8BrV+HBRHNThjyBP42qpBufmFxOIpJ3gAPTUGaYiilrsA
AAAASUVORK5CYII=
------=_Part_565_1697167297.1654852801463

Now when i get the HTML body of the email like this:

message.get_html_body(0).unwrap()

...the image source still says cid:page-icon. Is there a way to automatically inline those attachments? Or is this something that should be handled by the user?

Other libraries, such as the Nodemailer mailparser do this automatically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions