[GH-ISSUE #96] Images not displaying when multiple cid names overlaps #66

Closed
opened 2026-03-15 12:22:17 +03:00 by kerem · 3 comments
Owner

Originally created by @lpotherat on GitHub (Apr 21, 2023).
Original GitHub issue: https://github.com/axllent/mailpit/issues/96

Hi, there is an issue when two cid share a common part in their name.

Create a mail with two images, with these cid :

Content-ID:
Content-ID:

And a body with this:
<img src="cid:logo"/>
<img src="cid:logofooter"/>

Expected behaviour :

<img src="http://mailpit:8025/api/v1/message/f2e15ca6-9701-4786-aadc-93d9419081b4/part/2.2 "/>
<img src="http://mailpit:8025/api/v1/message/f2e15ca6-9701-4786-aadc-93d9419081b4/part/2.2 "/>

Actual behaviour :

<img src="http://mailpit:8025/api/v1/message/f2e15ca6-9701-4786-aadc-93d9419081b4/part/2.2 "/>
<img src="http://mailpit:8025/api/v1/message/f2e15ca6-9701-4786-aadc-93d9419081b4/part/2.2footer "/>

I think the problem is located here :
/server/ui-src/App.vue#L228
/server/ui-src/App.vue#L247

maybe the regex should assume a terminating character like one of [whitespace]'"> to avoid those overlaps ?

Thank for the awesome work by the way :)

Originally created by @lpotherat on GitHub (Apr 21, 2023). Original GitHub issue: https://github.com/axllent/mailpit/issues/96 Hi, there is an issue when two cid share a common part in their name. Create a mail with two images, with these cid : Content-ID: <logo> Content-ID: <logofooter> And a body with this: &lt;img src="cid:logo"/> &lt;img src="cid:logofooter"/> Expected behaviour : &lt;img src="http://mailpit:8025/api/v1/message/f2e15ca6-9701-4786-aadc-93d9419081b4/part/2.2 "/> &lt;img src="http://mailpit:8025/api/v1/message/f2e15ca6-9701-4786-aadc-93d9419081b4/part/2.2 "/> Actual behaviour : &lt;img src="http://mailpit:8025/api/v1/message/f2e15ca6-9701-4786-aadc-93d9419081b4/part/2.2 "/> &lt;img src="http://mailpit:8025/api/v1/message/f2e15ca6-9701-4786-aadc-93d9419081b4/part/2.2**footer** "/> I think the problem is located here : [/server/ui-src/App.vue#L228](https://github.com/axllent/mailpit/blob/develop/server/ui-src/App.vue#L228) [/server/ui-src/App.vue#L247](https://github.com/axllent/mailpit/blob/develop/server/ui-src/App.vue#L247) maybe the regex should assume a terminating character like one of _[whitespace]_'"> to avoid those overlaps ? Thank for the awesome work by the way :)
kerem 2026-03-15 12:22:17 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@axllent commented on GitHub (Apr 21, 2023):

Hi there! I remember when I wrote this functionality, having a huge issue specifically with older Outlook-generated emails (Word), not too mention all the other broken web clients etc. There is so much inconsistency between them - some did not enclose the SRC in quotes at all, others had the CID followed by an actual filename, etc. Really inconsistent. But your issue is a valid one, this shouldn't be happening.

I'm just about to leave for a short holiday, so will only be able to look into this later next week. In the meantime, could you please construct an example email that demonstrates this issue (removing any personal data), and attach it to this issue? That will save me heaps of time to replicate what you are experiencing. Thanks!

<!-- gh-comment-id:1518251025 --> @axllent commented on GitHub (Apr 21, 2023): Hi there! I remember when I wrote this functionality, having a huge issue specifically with older Outlook-generated emails (Word), not too mention all the other broken web clients etc. There is so much inconsistency between them - some did not enclose the SRC in quotes at all, others had the CID followed by an actual filename, etc. Really inconsistent. But your issue is a valid one, this shouldn't be happening. I'm just about to leave for a short holiday, so will only be able to look into this later next week. In the meantime, could you please construct an example email that demonstrates this issue (removing any personal data), and attach it to this issue? That will save me heaps of time to replicate what you are experiencing. Thanks!
Author
Owner

@axllent commented on GitHub (Apr 24, 2023):

I have adjusted the regex to (hopefully) eliminate overlapping CID names, which should address your problem. This has been released in v1.6.4. Please feel free to re-open this issue if you still experience issues, thank you.

<!-- gh-comment-id:1519872976 --> @axllent commented on GitHub (Apr 24, 2023): I have adjusted the regex to (hopefully) eliminate overlapping CID names, which should address your problem. This has been released in v1.6.4. Please feel free to re-open this issue if you still experience issues, thank you.
Author
Owner

@lpotherat commented on GitHub (Apr 26, 2023):

It works like a charm, thank you for the quick fix 👍
Sorry for the delay !

<!-- gh-comment-id:1523481656 --> @lpotherat commented on GitHub (Apr 26, 2023): It works like a charm, thank you for the quick fix 👍 Sorry for the delay !
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mailpit#66
No description provided.