pub struct MailSettings {Show 13 fields
pub backend: Option<String>,
pub smtp_host: Option<String>,
pub smtp_port: Option<u16>,
pub smtp_username: Option<String>,
pub smtp_password: Option<String>,
pub smtp_tls: Option<String>,
pub smtp_timeout_secs: Option<u64>,
pub from_address: Option<String>,
pub server_email: Option<String>,
pub email_subject_prefix: Option<String>,
pub admins: Vec<String>,
pub managers: Vec<String>,
pub file_email_dir: Option<PathBuf>,
}Expand description
Mailer config. Slice 10.2 lights up.
Fields§
§backend: Option<String>"smtp", "console" (default for dev), "memory" (tests).
smtp_host: Option<String>SMTP host. Required when backend = "smtp".
smtp_port: Option<u16>SMTP port. Defaults vary by TLS mode — 25 for none, 587 for
starttls, 465 for implicit. Issue #48.
smtp_username: Option<String>SMTP AUTH username. Set alongside smtp_password to enable
PLAIN/LOGIN auth — both must be present, otherwise the
transport connects anonymously. Issue #48.
smtp_password: Option<String>SMTP AUTH password. Prefer reading from an env var rather than
committing to TOML — the config loader’s env-overlay (see
crate::config) makes RUSTANGO_MAIL__SMTP_PASSWORD Just
Work. Issue #48.
smtp_tls: Option<String>TLS mode: "none", "starttls" (default — RFC 3207 upgrade
on port 587), "implicit" (SMTPS — TLS from byte one on
port 465). Unknown values fall back to "starttls" with a
warning. Issue #48.
smtp_timeout_secs: Option<u64>Django-shape EMAIL_TIMEOUT — SMTP connection timeout in
seconds. None defers to lettre’s default (no explicit
timeout). Set this on every prod deployment — a wedged
SMTP relay otherwise stalls request workers waiting on the
transport for the kernel-default TCP timeout (several
minutes).
from_address: Option<String>Django-shape DEFAULT_FROM_EMAIL — the From: address on
regular outgoing mail (send_pool, send_many_pool).
from_address is the historical alias rustango shipped
first; both names read the same field — default_from_email
wins when both are set.
server_email: Option<String>Django-shape SERVER_EMAIL — the From: address on
server-generated mail (mail_admins, mail_managers,
future error-mail paths). Falls back to from_address
when unset (Django’s default behavior). Setting it
separately lets ops surface admin mail under a distinct
sender — noreply@example.com for users, alerts@example.com
for ops.
email_subject_prefix: Option<String>Django-shape EMAIL_SUBJECT_PREFIX — string prepended to
subjects sent via mail_admins / mail_managers. Django
default is "[Django] "; rustango omits it by default so
projects opt into branded prefixes consciously. Set to
"[Acme] " (note trailing space) to match Django’s shape.
admins: Vec<String>Django-shape ADMINS — list of email addresses that
email::mail_admins(...) sends to. Typically the project’s
site operators (the “5xx pages me at 3am” cohort). Issue #416.
managers: Vec<String>Django-shape MANAGERS — list of email addresses that
email::mail_managers(...) sends to. Conventionally a
broader-but-less-urgent ops list than admins. Issue #416.
file_email_dir: Option<PathBuf>Django-shape EMAIL_FILE_PATH — directory the "file" mail
backend writes outgoing .eml files to (instead of sending).
Set alongside backend = "file"; if backend = "file" is
requested but this is unset, the resolver falls back to
ConsoleMailer with a tracing warning. Issue #417.
Trait Implementations§
Source§impl Clone for MailSettings
impl Clone for MailSettings
Source§fn clone(&self) -> MailSettings
fn clone(&self) -> MailSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MailSettings
impl Debug for MailSettings
Source§impl Default for MailSettings
impl Default for MailSettings
Source§fn default() -> MailSettings
fn default() -> MailSettings
Source§impl<'de> Deserialize<'de> for MailSettingswhere
MailSettings: Default,
impl<'de> Deserialize<'de> for MailSettingswhere
MailSettings: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for MailSettings
impl PartialEq for MailSettings
impl StructuralPartialEq for MailSettings
Auto Trait Implementations§
impl Freeze for MailSettings
impl RefUnwindSafe for MailSettings
impl Send for MailSettings
impl Sync for MailSettings
impl Unpin for MailSettings
impl UnsafeUnpin for MailSettings
impl UnwindSafe for MailSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more