-
Notifications
You must be signed in to change notification settings - Fork 48
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
Invalid mail seperator #646
Comments
When Alex, Alfie and I reworked the e-mail creation code to support e-mails in UTF-8 (around 12 years ago, the discussion took place in my meanwhile closed MLF-1-test-forum) we encountered several problems in several corners. One was the codeline separator for e-mail-headers. We was aware of the standard, that says, the line separator has to be Meanwhile 12 years have passed. I don't know, if one of the clients breaks nowadays when the script would use the standard line separator At the end this is a problem on the recipients side. We tried to circumvent the problem but your example shows, that the bypass can break. We should change to use the standard line break and tell the forum operators, that problems at this point are problems of the e-mail-clients and are not solvable in the script. |
In my case, I believe the problem is the host and not the client. I don't change the mail client but the problem occurs after maintenance of my provider. Is it possible to configure the accepted separator of a mail server? |
If you are the operator of the e-mail server and you have access to the configuration it might be possible to configure the accepted separators. But this is my pure speculation. At that point a next question (that may not influence the issue at all) comes into my mind. What, if the server can change the line separators itself? Storybook: the server gets an e-mail to be sent and the server accepts only Long story short: As far as I am aware, the line breaks for the e-mail-headers are configured in a few functions (encode_mail_name, my_mb_encode_mimeheader, overwritten in my_mail, currently in line 2057). The previous listing is valid for the use of the scripts own e-mail-handling functions. If you use the PHP-Mailer class, the handling will differ. As example, I see no setting for the line separator and also no handling of self defined e-mail headers. |
No, I don't operate a server, so my provider manged the settings of the mail-server. In PHP-Mailer, afaik \r\n is used. |
For documentation There is a problem with PHP in the versions 8.0 and 8.1. The PHP-developers decided to follow the RFC 2822 when executing PHPs own function The function Cited from the bug report for PHP 4.1.2:
Cited from a comment in the bug report for PHP 8.0 and 8.1:
I have added the highlights. PHP 8.2.4 and 8.3.4RC1 introduced a setting in the php.ini to switch back to the old behaviour with mixed line breaks ( Long story short: separating the e-mail-headers with |
Hej,
I have noticed that the mail separator (currently '\n') has not been working for me for some time. The mail header is corrupted, cf. attached screenshot. According to RFC 2047, I changed the separator to '\r\n' which solves the issue. However, even the separator is correct, there is a comment "\r\n" complies with RFC 2822 but might cause problems in some cases and, thus, the change may lead to some side effects. So, can anyone try the modified code?
$mail_header_separator = "\r\n";
/Micha
The text was updated successfully, but these errors were encountered: