-
-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error regex to getBoundary() passing by getAttachment() #126
Comments
This issues would solve #121 |
#27 is managed with this code 😁 |
After many tries, the problem is not just with the regex, because the current one (/boundary=(.*)/i) covers a larger amount of mails. Here is my suggestion:
|
Hi @MouMoutMan , RFCs are nice and all, but unfortunately almost no mail client follows it 100% - so in the end its all over the place.. I'm not sure how to handle this issue. Any additional comments or ideas are welcome :) Best regards, |
Hi @MouMoutMan , Best regards, |
Describe the bug
The getAttachment function cannot find the attachment because the returned boundary is not properly parsed.
Only using the getAttachment () function.
In the mail header, when there is a string after the boundary, the regex also takes that string. This creates a bad boundary, and the attachment is not found.
Code to Reproduce
The following code returns:
"----=EDF_mixed"; charset="ISO-8859-1"
and after clearBoundaryString, this code return the bad boundary:
----=EDF_mixed charset=ISO-8859-1
The following code returns:
"----=EDF_mixed"
and after clearBoundaryString, this code return the good boundary:
----=EDF_mixed
Expected behavior
Change the regex to:
/boundary=\"?([^\"]*)[\";\s]/i
like the example in the documentation:
https://www.php-imap.com/api/header
Desktop / Server (please complete the following information):
The text was updated successfully, but these errors were encountered: