Skip to main content

Crate capy_mail

Crate capy_mail 

Source
Expand description

Transactional application mail. Queued sends are at-least-once, not exactly-once. Secrets and attachment contents belong in application-owned protected storage, never in generic plaintext job payloads. SMTP provider acceptance is not inbox delivery.

Re-exports§

pub use askama;
pub use lettre;

Modules§

notifications
Small mail notifications, with explicit synchronous or queued delivery at the call site.

Structs§

Attachment
An in-memory attachment. No path is opened implicitly; applications own file access.
CaptureTransport
Bounded in-memory test transport; runs real rendering, parsing and MIME construction.
CapturedMail
Explicitly inspectable message, redacted in Debug. Never include contents in logs.
DeliveryReceipt
Provider acceptance, not a guarantee of inbox delivery or exactly-once effects.
DevelopmentInbox
Private disk-backed development inbox shared by HTTP, workers and capy mail. Retains at most 100 messages/64 MiB until explicitly cleared; a full inbox fails delivery instead of silently evicting. No network listener or HTML renderer exists. Files contain plaintext development secrets: never use production recipient data.
Envelope
A typed mailable and parsed primary recipient. Debug is redacted.
LogTransport
Development sink: lifecycle metadata only, never body, subject or recipients.
Mail
Application-owned content. It is deliberately not serializable.
MailContext
HTTP extractor for the shared mail service installed by App::mail/with_mail.
MailObservation
A payload-free lifecycle observation for application telemetry.
MailSettings
Conventional outbound mail settings; activated by App::mail.
Mailbox
A parsed mailbox; debug output never reveals the address or display name.
Mailer
Cloneable mail service. Clones share transport policy and application observer hooks.
PreparedMail
MIME message and explicit metadata for a transport. Debug never includes contents.
SmtpSettings
SMTP settings. TLS is mandatory in production; no opportunistic downgrade.

Enums§

MailError
Safe error categories. Raw SMTP responses/credentials/content are never retained.

Traits§

MailObserver
Nonblocking application metrics hook. Contains no subject/body/recipient fields.
MailTransport
A small application-owned transport, independent of SMTP/Jobs implementation details.
Mailable
Typed application template/context; business code remains ordinary Rust.
QueueableMail
Explicit assertion that this mailable contains no secrets or private attachments. Implement only after reviewing rendered text/HTML, headers and addresses for storage in plaintext queue rows/backups. There is deliberately no blanket implementation. Implement as impl QueueableMail for WelcomeMail {} only after reviewing the complete rendered output. Use mailer.queue(&ctx, welcome.to(address)?).await? for ordinary content, or queue_in for transactionally safe enqueue. Secrets such as reset/activation links and private attachments must use direct delivery or an application-owned protected outbox instead. Queueing is at least once; a successful SMTP send can still be repeated after a worker crash.

Type Aliases§

MailResult
Mail-specific safe result.