mailpipe 0.1.0

A unified, high-level SMTP and IMAP email engine backend library for Rust.
Documentation

mailpipe

Crates.io Docs.rs Rust Status

A unified, high-level SMTP and IMAP email engine backend library for Rust, built on top of async-imap and lettre. It's the email backend that powers magpipe.


Features

  • IMAP — Connect, authenticate, and manage sessions over TLS (port 993)
  • SMTP(coming soon)
  • Async-first via Tokio
  • Credentials are never stored — passwords are passed transiently at connection time

Installation

[dependencies]
mailpipe = "0.1.0"

Usage

IMAP

use mailpipe::imap::ImapConnector;

#[tokio::main]
async fn main() {
    let connector = ImapConnector::new("imap.example.com", "user@example.com");

    let session = connector
        .connect("your-password")
        .await
        .expect("failed to connect");

    // ... use session ...

    session.logout().await.expect("failed to logout");
}

Custom port

let mut connector = ImapConnector::new("imap.example.com", "user@example.com");
connector.port = 143;

Security

Passwords are accepted as a transient &str and are never stored on any struct. It is recommended to source credentials from environment variables or a secrets manager rather than hardcoding them.

let pass = std::env::var("IMAP_PASS").expect("IMAP_PASS not set");
connector.connect(&pass).await?;

Dependencies

Crate Purpose
tokio Async runtime
async-imap IMAP protocol implementation
tokio-native-tls TLS encryption
lettre SMTP (upcoming)