php-imap icon indicating copy to clipboard operation
php-imap copied to clipboard

"----boundary..." is a part of the attachment

Open nnnicolay opened this issue 8 months ago • 6 comments

This was reproduced with the latest version 6.1.0

Describe the bug The attachment is saved with the wrong name, without file extension, and with "----boundary..." inside

Code to Reproduce To reproduce the problem please use this EML

fake.eml.zip

Screenshots I assume that the problem could be caused by incorrect parts detection when we have a nested 'boundary'. This is what we can see inside the Attachment Image

Additional context The attachment name and the content Image

Thank you

nnnicolay avatar Mar 20 '25 16:03 nnnicolay

Hello @Webklex, were you able to reproduce the problem?

nnnicolay avatar Mar 27 '25 15:03 nnnicolay

Same issue as I just report in #582

PR in #455 and commit fad09ad altered Structure::parsePart so it only handles multipart blocks with more than one part, in a case of a single part it falls through and assumes it just a single text block

Hence your content is the actual part and your filename/name is set to be the generated hash as it could not find name headers as it did not actually returned a raw block.

mrhewitt avatar May 29 '25 08:05 mrhewitt

Will try to validate the fix

nnnicolay avatar Jun 06 '25 11:06 nnnicolay

@mrhewitt Still doesn't work for my case. But it works on https://github.com/inFreeRED/php-imap

nnnicolay avatar Jun 06 '25 15:06 nnnicolay

One more issue with boundary

When at the end of the line there 2 spaces

Content-Type: multipart/mixed; boundary="--=_Next_Part_04_Jun_2025_12.10.44"  

nnnicolay avatar Jun 11 '25 11:06 nnnicolay

Hello @Webklex, do you have any updates on this issue? Please let me know if you have any questions. Thanks

nnnicolay avatar Sep 03 '25 06:09 nnnicolay