Skip to content

feat(email): configurable display name in outbound From header - #105662

Open
kokhlo wants to merge 1 commit into
NousResearch:mainfrom
kokhlo:feat/email-sender-display-name
Open

kokhlo wants to merge 1 commit into
NousResearch:mainfrom
kokhlo:feat/email-sender-display-name

Conversation

@kokhlo

@kokhlo kokhlo commented Sep 8, 2026

Copy link
Copy Markdown

Summary

Implements #105657.

Outbound email carried a bare address in From:, so mail clients showed no sender name and Gmail→Outlook delivery suffered in spam filtering. The header now carries a configurable display name.

Changes

  • plugins/platforms/email/adapter.py:
    • EmailAdapter.__init__ resolves self._sender_name env-first: EMAIL_SENDER_NAME → platforms.email.extra.sender_name → default "Hermes"
    • new _from_header() helper built on email.utils.formataddr (RFC 2047 encoding for non-ASCII names)
    • both outbound paths use it: _new_reply() (threaded replies) and _standalone_send() (one-shot SMTP)
  • tests/gateway/test_email_sender_name.py (new): default name, env override, extra-config fallback, RFC 2047 encoding of a non-ASCII name, reply header shape
  • tests/gateway/test_email.py: the standalone-send test now expects Hermes <hermes@test.com> instead of the bare address

Tests

tests/gateway/test_email_sender_name.py ... 5 passed
tests/gateway/test_email.py .................. 39 passed (incl. updated pin)
charset fallback + imap id protocol .......... green

Closes #105657

Outbound mail went out with a bare address, which renders nameless
in clients and worsens spam-filter placement (Gmail to Outlook in
particular). The From header now carries a display name resolved
env-first (EMAIL_SENDER_NAME), then platforms.email.extra.sender_name,
defaulting to Hermes; formataddr keeps non-ASCII names RFC 2047-safe.
Both outbound paths use it: threaded replies and the standalone
SMTP sender.
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins platform/email Email (IMAP/SMTP) adapter duplicate This issue or pull request already exists labels Sep 8, 2026
@alt-glitch

Copy link
Copy Markdown

This was generated by AI during triage.

Competing with #105661 (same fix for #105657, same env/config precedence and formataddr helper; that PR is from the issue author and landed first, this one adds tests). Also overlapping: open #63659 and #82544 already carry a configurable From: display name. Maintainer to pick one; consider consolidating.

This branch has not been deployed

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

Labels

comp/plugins Plugin system and bundled plugins duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have platform/email Email (IMAP/SMTP) adapter type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Configurable display name in outbound email From: header (EMAIL_SENDER_NAME)

2 participants