feat(smtp): allow separate auth username and From: address (Brevo sup…#12
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…port)
The "Gmail" provider path is really a generic SMTP transport — Brevo, Mailgun and Postmark all land here. But the single
config.userfield 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.comwith verified senderhello@thefoundersweb.com) couldn't send: every message either failed auth or was bounced for an unverified From:.Add an optional
fromEmailto 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 optionalfromEmail;fromAddressresolved fromfromEmail?.trim() || user; exposegetFromAddress()+close()for tests so the connection pool releases cleanly.providerFactory: passfromEmailthrough (not sensitive, no encryption).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.