Skip to main content

Crate elektromail

Crate elektromail 

Source
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§

AuthConfig
Authentication configuration loaded from environment.
DsnPolicy
Rule-based delivery policy for DSN generation.
DsnRule
A DSN rule matched against recipient and sender addresses.
MailboxEvent
Event emitted when a mailbox changes (new message, etc.)
RunningServer
Handle for a running server instance.
Server
Entry point for starting an in-process server.
ServerConfig
Configuration for the SMTP/IMAP server endpoints and auth source.

Enums§

DsnAction
Action to take for a DSN rule.
StorageBackend
Storage backend configuration.

Traits§

DeliveryPolicy
Delivery policy hook for RCPT and DATA processing.
UserStore
Shared interface for runtime user provisioning and authentication.

Type Aliases§

MailboxNotifier
Sender for mailbox change notifications (used by SMTP/IMAP handlers)
SharedDeliveryPolicy
Shared, thread-safe delivery policy handle.
SharedUserStore
Shared, thread-safe user store handle.