//! Outbound delivery: smarthost relays and direct-to-MX. //! //! Two paths behind one interface: //! //! - **relay** — hand the message to SES / OCI Email Delivery / any smarthost //! on submission (587). Someone else's IP reputation. Works everywhere, //! including hosts that block outbound :25. //! - **direct** — resolve MX, apply [`mail_mta_sts`] and [`mail_dane`], deliver //! ourselves. Our reputation, our control, and impossible on a host that //! blocks outbound :25 (see `docs/adr/0005-oracle-cloud.md`). pub mod providers; pub use providers::{PROVIDERS, RelayProvider, provider, resolve_host, spf_include}; #[derive(Debug, thiserror::Error)] pub enum Error { #[error("no usable MX for {0}")] NoMx(String), #[error("relay rejected: {code} {text}")] Rejected { code: u16, text: String }, #[error("TLS policy violation: {0}")] TlsPolicy(String), #[error("transient failure, retry: {0}")] Transient(String), }