Expand description
§Elektromail
A minimal, Rust-based IMAP + SMTP mail server for local development and testing.
§Overview
Elektromail provides a lightweight mail server that can be embedded in tests or run standalone for local development. It supports:
- SMTP for receiving emails
- IMAP for reading emails
- STARTTLS for encrypted connections
- PLAIN authentication
§Quick Start
use elektromail::{Server, ServerConfig};
#[tokio::main]
async fn main() -> std::io::Result<()> {
let server = Server::start(ServerConfig::default()).await?;
println!("SMTP listening on {}", server.smtp_addr());
println!("IMAP listening on {}", server.imap_addr());
// Server runs until stopped
server.stop().await
}Structs§
- Auth
Config - Authentication configuration loaded from environment.
- DsnPolicy
- Rule-based delivery policy for DSN generation.
- DsnRule
- A DSN rule matched against recipient and sender addresses.
- Mailbox
Event - Event emitted when a mailbox changes (new message, etc.)
- Running
Server - Handle for a running server instance.
- Server
- Entry point for starting an in-process server.
- Server
Config - Configuration for the SMTP/IMAP server endpoints and auth source.
Enums§
- DsnAction
- Action to take for a DSN rule.
- Storage
Backend - Storage backend configuration.
Traits§
- Delivery
Policy - Delivery policy hook for RCPT and DATA processing.
- User
Store - Shared interface for runtime user provisioning and authentication.
Type Aliases§
- Mailbox
Notifier - Sender for mailbox change notifications (used by SMTP/IMAP handlers)
- Shared
Delivery Policy - Shared, thread-safe delivery policy handle.
- Shared
User Store - Shared, thread-safe user store handle.