Skip to main content

rullst_mail/
lib.rs

1//! # `rullst-mail` — High-Performance Transactional Email & Mailables Engine
2//!
3//! Provides typed, bounded primitives for transactional emails with built-in:
4//! - **RFC 8058 One-Click List-Unsubscribe** headers
5//! - **Automatic Plain-Text Fallback** derivation
6//! - **In-Memory MailTrap & Fluent Assertions**
7//! - **Outbound DLP Secret Scanner** (AWS keys, passwords, bearer tokens)
8//! - Multiple delivery drivers (**SMTP**, **Resend**, **SendGrid**, **Postmark**, **AWS SES**, **ACS**, **SendPulse**, **Mailjet**, **Mailtrap**, **Log**, **Memory**, **Failover**)
9//! - **Dynamic Multi-Tenancy Resolver** (`TenantMailResolver`)
10//! - **Resilient Circuit Breaker & Automatic Failover** (`FailoverDriver`)
11//! - Opt-in attachment inspection, recipient suppression, and minimized observations
12
13// The test harness registers the unit tests of the driver modules deprecated in
14// 12.3 from the crate root, where no item-level allow can reach them.
15#![cfg_attr(test, allow(deprecated))]
16
17pub mod account;
18pub mod action;
19pub mod attachment;
20pub mod drivers;
21mod entities;
22pub mod error;
23pub mod facade;
24pub mod factory;
25pub mod feedback;
26pub mod inspection;
27pub mod message;
28pub mod observability;
29#[cfg(feature = "capital-invoice")]
30pub mod paid_invoice;
31pub mod pipeline;
32pub mod resolver;
33pub mod security;
34pub mod suppression;
35pub mod tracking;
36pub mod validator;
37pub mod worker;
38
39/// Official AWS SES v2 SDK re-export used by native driver configuration.
40#[cfg(feature = "aws-ses")]
41pub use aws_sdk_sesv2 as aws_ses_sdk;
42
43pub use account::{AccountEvent, AccountMail, MailLocale, MailPurpose};
44pub use action::ActionLink;
45pub use attachment::*;
46pub use drivers::*;
47pub use error::*;
48pub use facade::*;
49pub use factory::*;
50pub use feedback::{
51    MailFeedbackError, MailFeedbackKind, ResendFeedbackVerifier, VerifiedMailFeedback,
52};
53pub use inspection::*;
54pub use message::*;
55pub use observability::*;
56#[cfg(feature = "capital-invoice")]
57pub use paid_invoice::*;
58pub use pipeline::*;
59pub use resolver::*;
60pub use security::*;
61pub use suppression::*;
62pub use tracking::*;
63pub use validator::*;
64pub use worker::*;
65
66/// Backwards compatibility alias for `rullst_mail::mail::*`
67pub mod mail {
68    pub use crate::*;
69}
70
71#[cfg(test)]
72#[path = "lib_tests.rs"]
73mod tests;
74
75#[cfg(kani)]
76#[cfg_attr(mutants, mutants::skip)]
77mod kani_proofs {
78    use super::*;
79
80    #[kani::proof]
81    fn proof_message_builder_recipient() {
82        let msg = Message::new().to("user@rullst.dev").subject("Hello");
83        assert!(!msg.to.is_empty());
84        assert!(!msg.subject.is_empty());
85    }
86}