Skip to main content

Module email_config

Module email_config 

Source
Expand description

Per-tenant email-sender configuration.

Tenants pick one of three modes: Managed (default), Smtp, or Webhook. The CRUD layer encrypts SMTP passwords and webhook secrets at rest using AES-256-GCM via [crate::social_provider_encrypt], mirroring the allowthem_social_providers precedent (see plan §2.8 of docs/superpowers/plans/2026-05-04-managed-email.md).

Validation that the right override block is populated for each mode is enforced by Db::set_email_config; the SQL schema only constrains the discriminator and TLS values.

Structs§

EmailConfig
Decrypted, runtime-form per-tenant email config.
ManagedOverride
SetEmailConfig
Plaintext setter input. Mirrors EmailConfig minus timestamps; the Db method encrypts secrets before binding to the SQL columns.
SmtpOverride
WebhookOverride

Enums§

EmailConfigMode
Discriminator for the per-tenant email path.
SmtpTlsMode
SMTP TLS mode. Mirrors crate::email_smtp::SmtpTls but lives in email_config so the storage form can derive(sqlx::Type) without pulling email_smtp into a sqlx context.