-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Wrong line endings with PHP 8.1 and nullmailer #2870
Comments
Since all the |
Wow, thanks for the fast reply. Using the SMTP driver with localhost would most likely work yes, but also still apply CRLF endings, so I will check if the issue is still there or not. Thank you! |
That should not be a problem - the issue with line endings only occurs in the mail() function, and is a PHP peculiarity. Things that talk proper SMTP will expect CRLF endings regardless of platform. |
After more tests, I was not able to connect to nullmailer using SMTP - I am not even sure that is supported. However, I was able to use nullmailer with the Sendmail driver ( Thanks your support! |
We recently updated PHPMailer from an ancient 5.2 version to the latest, 6.7.1.
We have a bit of an exotic setup, with PHPMailer using the
mail
driver, thennullmailer
handles sending the email to a remote SMTP server. This is done for performance purposes, so we don't have to wait synchronously for PHPMailer to connect to the SMTP server and block the user while it is doing it.When sending multi
multipart/mixed
emails, the raw email looks as follows:Notice the extra new lines after the boundary between the two
Content
entries. It should be:We narrowed it down to this block in
preSend
:Because we are running the
mailer
driver and PHP 8.1,static::setLE(self::CRLF);
is triggered. But since we are using a legacy Linux CLI mailer, what we need isstatic::setLE(PHP_EOL);
.Now, I understand our setup is not ideal, convoluted and probably not common.
However, I would have appreciated more flexibility for setting the line endings. I had to overwrite
setLE
in a child class to prevent the CRLF call from modifying the line endings.Maybe this block could be extracted to a smaller, overwritable function? Or this could be an editable parameter somewhere? I had something like this in mind:
The text was updated successfully, but these errors were encountered: