Skip to content

feat(smtp): allow separate auth username and From: address (Brevo sup…#12

Merged
pulkitpareek18 merged 1 commit into
mainfrom
feat/smtp-separate-sender
May 22, 2026
Merged

feat(smtp): allow separate auth username and From: address (Brevo sup…#12
pulkitpareek18 merged 1 commit into
mainfrom
feat/smtp-separate-sender

Conversation

@pulkitpareek18

Copy link
Copy Markdown
Owner

…port)

The "Gmail" provider path is really a generic SMTP transport — Brevo, Mailgun and Postmark all land here. But the single config.user field was used both as the SMTP login AND the visible From: address, so relays that issue a synthetic SMTP username (e.g. 9abc12@smtp-brevo.com with verified sender hello@thefoundersweb.com) couldn't send: every message either failed auth or was bounced for an unverified From:.

Add an optional fromEmail to the gmail/SMTP config. When present and non-blank it becomes the From: (and Reply-To default); when absent the behaviour is unchanged so every existing Gmail account keeps working.

  • GmailProvider: new optional fromEmail; fromAddress resolved from fromEmail?.trim() || user; expose getFromAddress() + close() for tests so the connection pool releases cleanly.
  • providerFactory: pass fromEmail through (not sensitive, no encryption).
  • Settings UI: split the Gmail form into "Auth Email / SMTP Username" and optional "Sender Email", with helper text calling out Brevo. Account list now shows the sender address and, when different, the auth identity on a secondary line. Edit form gains the same field.
  • New unit tests (gmailProvider.test.ts) pin the resolution rules: default → user, override → fromEmail, fromName wraps either, blank/ whitespace fromEmail treated as absent.

Server: tsc clean, 31/31 jest pass. Client: tsc clean, vite build clean.

…port)

The "Gmail" provider path is really a generic SMTP transport — Brevo,
Mailgun and Postmark all land here. But the single `config.user` field
was used both as the SMTP login AND the visible From: address, so
relays that issue a synthetic SMTP username (e.g. `9abc12@smtp-brevo.com`
with verified sender `hello@thefoundersweb.com`) couldn't send: every
message either failed auth or was bounced for an unverified From:.

Add an optional `fromEmail` to the gmail/SMTP config. When present and
non-blank it becomes the From: (and Reply-To default); when absent the
behaviour is unchanged so every existing Gmail account keeps working.

- `GmailProvider`: new optional `fromEmail`; `fromAddress` resolved from
  `fromEmail?.trim() || user`; expose `getFromAddress()` + `close()` for
  tests so the connection pool releases cleanly.
- `providerFactory`: pass `fromEmail` through (not sensitive, no encryption).
- Settings UI: split the Gmail form into "Auth Email / SMTP Username" and
  optional "Sender Email", with helper text calling out Brevo. Account
  list now shows the sender address and, when different, the auth identity
  on a secondary line. Edit form gains the same field.
- New unit tests (`gmailProvider.test.ts`) pin the resolution rules:
  default → user, override → fromEmail, fromName wraps either, blank/
  whitespace fromEmail treated as absent.

Server: tsc clean, 31/31 jest pass. Client: tsc clean, vite build clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 22, 2026 19:12
@pulkitpareek18 pulkitpareek18 merged commit 3eb8abe into main May 22, 2026
@pulkitpareek18 pulkitpareek18 removed the request for review from Copilot May 22, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant