laminas-mail icon indicating copy to clipboard operation
laminas-mail copied to clipboard

Update Sendmail.php

Open cloudseeder opened this issue 1 year ago • 3 comments

Remove the \r\n translation for mail headers per the PHP mail() page.

additional_headers (optional)

String or array to be inserted at the end of the email header.

This is typically used to add extra headers (From, Cc, and Bcc). Multiple extra headers should be separated with a CRLF (\r\n). If outside data are used to compose this header, the data should be sanitized so that no unwanted headers could be injected.

Q A
Documentation no
Bugfix yes
BC Break no
New Feature no
RFC no
QA no

Description

This is fully documented in osTicket BR https://github.com/laminas/laminas-mail/issues/230.

cloudseeder avatar May 03 '23 16:05 cloudseeder

Hi, can you add a test for the bugfix please?

Slamdunk avatar May 04 '23 05:05 Slamdunk

@Slamdunk

Sure. Can you point me to an example? Looks like there are a lot of good examples in MessageTest.php. Should I just copy/mod one of those tests? With all those tests I'm really surprised this wasn't caught earlier.

So what I think I need to do is:

  1. Edit MessageTest.php
  2. Copy and modify one of the existing tests to meet the needs of this PR
  3. Ensure it works
  4. Add the test to this PR (is that correct?)

I added a new file into my fork ([cloudseeder/laminas-mail/tree/2.23.x/test)/Storage/HeaderTest.php) and some ci event kicked off from the main branch. Just want to make sure I do this correctly. I'm more of a ops guy than a programmer.

cloudseeder avatar May 04 '23 13:05 cloudseeder

That's correct: go for it :muscle:

Slamdunk avatar May 24 '23 09:05 Slamdunk