[GH-ISSUE #412] Inline Images in emails #873

Closed
opened 2026-03-14 10:59:07 +03:00 by kerem · 7 comments
Owner

Originally created by @m42e on GitHub (Jan 6, 2023).
Original GitHub issue: https://github.com/anonaddy/anonaddy/issues/412

Hi,

I discovered that forwarded mails are not displayed correctly if they contain inline images. After looking into the source I discovered the content-id was missing. It seems to be an issue in the mail parser, as it simple declares the content-disposition as attachment whereas it was originally declared as inline.

I added a fix as a PR here. https://github.com/php-mime-mail-parser/php-mime-mail-parser/pull/409

I am not 100% sure if this is enough or if there is something happening in anonaddy in some cases.

Could someone have a look, too?

Best
m42e

Originally created by @m42e on GitHub (Jan 6, 2023). Original GitHub issue: https://github.com/anonaddy/anonaddy/issues/412 Hi, I discovered that forwarded mails are not displayed correctly if they contain inline images. After looking into the source I discovered the `content-id` was missing. It seems to be an issue in the mail parser, as it simple declares the `content-disposition` as `attachment` whereas it was originally declared as `inline`. I added a fix as a PR here. https://github.com/php-mime-mail-parser/php-mime-mail-parser/pull/409 I am not 100% sure if this is enough or if there is something happening in anonaddy in some cases. Could someone have a look, too? Best m42e
kerem closed this issue 2026-03-14 10:59:12 +03:00
Author
Owner

@m42e commented on GitHub (Jan 6, 2023):

I just recognised, that the multipart type is also changed from multipart/related to multipart/mixed.

<!-- gh-comment-id:1374090586 --> @m42e commented on GitHub (Jan 6, 2023): I just recognised, that the multipart type is also changed from `multipart/related` to `multipart/mixed`.
Author
Owner

@willbrowningme commented on GitHub (Jan 6, 2023):

Inline images are handled here - https://github.com/anonaddy/anonaddy/blob/master/app/Mail/ForwardEmail.php#L217

This sets the correct Content-Id for each inline image.

The Content-Type may be something that needs looking at though, do you have an .eml example that replicates the issue?

<!-- gh-comment-id:1374149699 --> @willbrowningme commented on GitHub (Jan 6, 2023): Inline images are handled here - https://github.com/anonaddy/anonaddy/blob/master/app/Mail/ForwardEmail.php#L217 This sets the correct `Content-Id` for each inline image. The `Content-Type` may be something that needs looking at though, do you have an `.eml` example that replicates the issue?
Author
Owner

@willbrowningme commented on GitHub (Jan 6, 2023):

Just tested with your .eml in the pull request and can reproduce this, you're right. Will try to do some debugging shortly.

<!-- gh-comment-id:1374158513 --> @willbrowningme commented on GitHub (Jan 6, 2023): Just tested with your `.eml` in the pull request and can reproduce this, you're right. Will try to do some debugging shortly.
Author
Owner

@m42e commented on GitHub (Jan 6, 2023):

I already discovered the issue is not part of anonaddy, but Symphony. I raised a PR there, too: https://github.com/symfony/symfony/pull/48901

<!-- gh-comment-id:1374160091 --> @m42e commented on GitHub (Jan 6, 2023): I already discovered the issue is not part of anonaddy, but Symphony. I raised a PR there, too: https://github.com/symfony/symfony/pull/48901
Author
Owner

@m42e commented on GitHub (Jan 9, 2023):

As the change may take a while to hit this project, there would be a workaround. Replacing the cid with the name upfront. Not a great one to be honest. What do you think?

<!-- gh-comment-id:1375518364 --> @m42e commented on GitHub (Jan 9, 2023): As the change may take a while to hit this project, there would be a workaround. Replacing the cid with the name upfront. Not a great one to be honest. What do you think?
Author
Owner

@willbrowningme commented on GitHub (Jan 10, 2023):

Hmm, might just wait as it seems your PR has now been merged in Symfony, thanks for finding this!

<!-- gh-comment-id:1376911137 --> @willbrowningme commented on GitHub (Jan 10, 2023): Hmm, might just wait as it seems your PR has now been merged in Symfony, thanks for finding this!
Author
Owner

@willbrowningme commented on GitHub (Jun 8, 2023):

Okay Symfony have released version 6.3 so as soon as a new release of php-mime-mail-parser comes out that includes your fix from above then it will all work as expected.

Thanks again for finding this and creating the fixes.

<!-- gh-comment-id:1582400493 --> @willbrowningme commented on GitHub (Jun 8, 2023): Okay Symfony have released version 6.3 so as soon as a new release of [php-mime-mail-parser](https://github.com/php-mime-mail-parser/php-mime-mail-parser) comes out that includes your [fix from above](https://github.com/php-mime-mail-parser/php-mime-mail-parser/pull/409) then it will all work as expected. Thanks again for finding this and creating the fixes.
Sign in to join this conversation.
No labels
bug
pull-request
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/anonaddy#873
No description provided.