Skip to content

Set To header to undisclosed-recipients when using BCC#521

Draft
alexander-akhmetov wants to merge 1 commit intomainfrom
alexander-akhmetov/fix-bcc-empty-to-header
Draft

Set To header to undisclosed-recipients when using BCC#521
alexander-akhmetov wants to merge 1 commit intomainfrom
alexander-akhmetov/fix-bcc-empty-to-header

Conversation

@alexander-akhmetov
Copy link
Copy Markdown
Contributor

@alexander-akhmetov alexander-akhmetov commented Mar 26, 2026

When UseBCC is enabled, the To header was left empty, which looks odd to recipients and may cause some mail servers to flag the message as spam. Set it to undisclosed-recipients:; per RFC 2822.


Note

Low Risk
Low risk: small header change limited to the UseBCC && !SingleEmail path, with tests updated to lock in the new To/Bcc behavior.

Overview
When EmailSenderConfig.UseBCC is enabled (and SingleEmail is false), outgoing emails now set the To header to undisclosed-recipients:; while placing actual recipients in Bcc, instead of leaving To empty.

Tests in email_sender_test.go were updated to expect the new To header value in this scenario.

Written by Cursor Bugbot for commit 4da7d68. This will update automatically on new commits. Configure here.

When UseBCC is enabled, the To header was left empty, which looks
odd to recipients and may cause some mail servers to flag the message
as spam. Set it to "undisclosed-recipients:;" per RFC 2822.
@alexander-akhmetov
Copy link
Copy Markdown
Contributor Author

bugbot review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@aifraenkel
Copy link
Copy Markdown
Collaborator

If I may to chip-in, the PR looks good for a try. I would just evaluate having, or not a FT to rollback quick in case of unexpected issues.

@alexander-akhmetov
Copy link
Copy Markdown
Contributor Author

The tests break because gomail.Send doesn't like this address in To and fails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

3 participants