fix(MailTransmission): Handle clients/servers picky about empty headers#12420
fix(MailTransmission): Handle clients/servers picky about empty headers#12420joshtrichards wants to merge 1 commit intomainfrom
Conversation
|
Thanks a lot @joshtrichards for flagging it 👍 I've noticed that while working on The CC/BCC headers are |
ff8e777 to
0753046
Compare
There was a problem hiding this comment.
Pull request overview
This pull request fixes an issue where some email clients and servers reject messages containing empty Cc or Bcc headers. The fix refactors the header building logic to only include Cc and Bcc headers when they actually contain recipients.
Changes:
- Introduced a new
buildHeaders()method that conditionally adds Cc and Bcc headers only when they contain recipients - Removed the unnecessary detour through
ModelMessageclass - Removed the Date header from draft operations (handled automatically by Horde_Mime_Mail)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| lib/Service/MailTransmission.php | Added buildHeaders() method and refactored sendMessage(), saveLocalDraft(), and saveDraft() to use it; removed ModelMessage usage and Date header from drafts |
| tests/Unit/Service/MailTransmissionTest.php | Added two new tests to verify Cc headers are included when present and omitted when empty |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Josh <josh.t.richards@gmail.com>
0753046 to
0035ff9
Compare
Came up on the forum:
Changes: