Skip to content

fix(drafts): preserve Bcc header when saving drafts#13182

Open
ChristophWurst wants to merge 2 commits into
mainfrom
fix/bcc-draft
Open

fix(drafts): preserve Bcc header when saving drafts#13182
ChristophWurst wants to merge 2 commits into
mainfrom
fix/bcc-draft

Conversation

@ChristophWurst

@ChristophWurst ChristophWurst commented Jun 30, 2026

Copy link
Copy Markdown
Member

Somewhat related to #13180.

How to test

  1. Start a new email
  2. Enter a bcc recipient
  3. Save the draft
  4. Open the draft mailbox
  5. Open the new draft email

main: empty Bcc
here: restored Bcc

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

return [$account, $draftsMailbox, $newUid];
}

private function buildMimeHeaders(Address $from, AddressList $to, AddressList $cc, AddressList $bcc, ?string $subject): Horde_Mime_Headers {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new function replaces entirely buildHeaders(), which is no longer used and can be suppressed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Missed because I opened this PR when #13180 wasn't in either.

Horde_Mime_Mail::getRaw() omits the Bcc header (same root cause as the
sent mailbox fix). Reopening a saved draft therefore lost all Bcc
recipients silently.

Add buildMimeHeaders() returning Horde_Mime_Headers directly, and use
$mail->getBasePart()->toString() with those headers instead of
$mail->getRaw() in saveLocalDraft() and saveDraft().

Assisted-by: Claude:claude-sonnet-4-6
Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 🏗️ In progress

Development

Successfully merging this pull request may close these issues.

2 participants