Skip to content

Function: resolveEmailConfig()

resolveEmailConfig(config?): ResolvedEmailConfig

Resolve plugin config over environment defaults.

When SMTP host + user + password are all present, returns mode: "smtp" for real delivery (and throws if no sender source - domain, from, or systemFrom - is configured, since SMTP can’t derive one from nothing; domain alone is the intended minimum). When all three are absent and EMAIL_OUTBOX_MODE is enabled, returns mode: "file" so the runtime writes messages to the outbox directory for local testing; in that mode a sender source is optional (the outbox falls back to the OBO user’s own address). Partial SMTP configuration or a send with no credentials and no outbox opt-in throws.

The sender allow-list is resolved here too: under the default "allowlist" policy an empty list is filled in from the sender source, so a deployment that only sets EMAIL_DOMAIN still rejects a From on any other domain. See SenderPolicy.

EmailPluginConfig = {}

ResolvedEmailConfig