mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 00:35:51 +03:00
[GH-ISSUE #379] Inline images are listed among the attachments #247
Labels
No labels
awaiting feedback
bug
docker
documentation
enhancement
github_actions
invalid
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mailpit#247
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tkoop on GitHub (Oct 25, 2024).
Original GitHub issue: https://github.com/axllent/mailpit/issues/379
If an email has an image in it with a disposition of "inline", it shows up in Mailpit as an attachment. The UI will say there is an attachment, but there isn't really.
Other email clients don't consider "inline" files to be attachments, so they shouldn't show up in Mailpit as attachments either.
For example, the html of the email may contain an inline png, like this:
When it does, there should also be a file included that matches the cid ("Content-id"), like this. (Also notice the Content-Disposition is "inline").
When this happens, the web UI shows this as an attachment, but it shouldn't. No other email client considers files like this to be attachments, so Mailpit shouldn't either.
If we really like the idea of listing all included files in the email, we should at least differentiate between attached files and inline files. Perhaps we could have two lists: a list of "Attachments", and a list of all "Included Files".
For the sake of completeness, this is what an actual attachment looks like. Notice the value of "Content-Disposition".
@tkoop commented on GitHub (Oct 25, 2024):
Also note this. On the home page, the paper clip icon does show up correctly, only when disposition is "attachment", not when it is "inline".
@axllent commented on GitHub (Oct 25, 2024):
@tkoop Thanks for the details. You are correct, there is a discrepancy between the message list attachment indicator (paper clip) and the message view (
Attachment (1)) which I will fix.Backstory: Unfortunately there are actually huge discrepancies between mail clients, mainly in the generation of messages containing inline images. A number of clients do not actually use the
Content-Disposition: inline;/Content-IDattributes - they just attach the file (like a regular attachment) and reference the filename as<img src="cid:<filename>" />. Because of this, many (most?) clients support displaying inline images even when they are attachments (and so does Mailpit).Originally I catered for this in Mailpit by referring to both attachments and inline images as "attachments" in the web UI as well as the search, however that is wrong and at some point I decided this was a bad idea and changed it to the current behaviour. But, as you pointed out, there is still one artefact from that (...in the current versions of Mailpit, you're using an older version < v1.20.0 based on hour screenshots) - that being the
Attachment (1)in the message view in your screenshot.I need to give this a little more thought as to whether I just exclude inline images from that count, or whether I add a new
Inline (1)tag to the message view (eg: a message with one attachment and two inline images could showAttachment (1)andInlines (2)).@axllent commented on GitHub (Nov 1, 2024):
This change has been included in v1.21.1 👍 In relation to this clear(er) separation, there is also a new search filter
has:inlinewhich will filter by messages containing inline images. I'll close this issue now, but please feel free to re-open if you encounter and issues, thanks.