-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Issue when parsing header if the from field contains a semicolon #300
Comments
I have the same problem with subjects containing a semicolon. The subject content is removed after the semicolon. Sample:
Results in:
|
The problem originates here: Lines 654 to 686 in 45843e1
Im not very versed in email handling, but when reading this (altough not an authoritative source ofcourse) it seems to me, that certain fields including subject ... should maybe be excluded from extension parsing, and additionally to checking for semicolons, the parser should actually only parse a field, if it finds a key=value pair after the semicolon. Can you maybe comment on this @Webklex? I can also do a PR otherwise in the weekend. |
I have the same problem with subjects containing a semicolon. The subject content is removed after the semicolon. |
Describe the bug
When parsing the header of an email where the from field contains a semicolon ";", the from field will not be parsed correctly. Minimal example of such an email:
The raw email is appended to avoid issues with linebreaks (I changed the extension to
.txt
as Github doesn't support.eml
).semicolon_test.txt
Used config
Default.
Code to Reproduce
Output when running this via
php test.php
:Expected behavior
When we remove the semicolon from the from-header, we get the expected result:
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop / Server (please complete the following information):
OS: Linux Mint 21 (= Ubuntu 22.04)
PHP: 7.4 and 8.1
Version 4.0.2
Provider: The mail which triggered the issue was sent through the "Contact Form 7" plugin on a Wordpress instance.
EDIT:
I am not actually sure that a semicolon in the header fields confroms to the spec, but Gmail, Thunderbird and also phpmailer do handle these mails correctly.
The text was updated successfully, but these errors were encountered: