Sirup [](https://matrix.to/#/#pimalaya:matrix.org) [](https://fosstodon.org/@pimalaya)

May 30, 2026 · View on GitHub

CLI to spawn pre-authenticated IMAP/SMTP sessions and expose them via Unix sockets

Table of contents

Features

  • Remote backend support: IMAP, SMTP, JMAP
  • Simple auth support for IMAP/SMTP: anonymous, login, plain, oauthbearer, xoauth2, scram-sha-256
  • HTTP auth support for JMAP: basic, bearer
  • TLS support:
    • Rustls with ring crypto
    • Rustls with aws crypto (requires rustls-aws feature)
    • Native TLS (requires native-tls feature)
  • Discovery support:
  • Pre-authenticated IMAP/SMTP session proxied to a Unix socket via sirup start
  • REPL that interacts with the Unix-socket-backed session via sirup repl
  • Partial JSON support with --json

Tip

Sirup is written in Rust and uses cargo features to gate backend support. The default feature set is declared in Cargo.toml.

Installation

Pre-built binary

Sirup is not yet released, therefore the only way to get a pre-built binary is to check out the releases GitHub workflow and look for the Artifacts section.

Note

Such binaries are built with the default cargo features. If you need specific features, please use another installation method.

cargo install --locked --git https://github.com/pimalaya/sirup.git

With only IMAP support:

cargo install --locked --git https://github.com/pimalaya/sirup.git \
  --no-default-features \
  --features imap,rustls-ring

Nix

If you have the Flakes feature enabled:

nix profile install github:pimalaya/sirup

Or run without installing:

nix run github:pimalaya/sirup

Sources

git clone https://github.com/pimalaya/sirup
cd sirup
nix run

Configuration

Run sirup. With no configuration file on disk the wizard prompts for an email address, a server URL or a bare domain, runs provider discovery, asks for SASL credentials, then keeps the resulting account in memory for that session only (Sirup does not write to disk).

A persistent configuration is loaded from the first valid path among:

  • $XDG_CONFIG_HOME/sirup/config.toml
  • $HOME/.config/sirup/config.toml
  • $HOME/.siruprc

Override the path with -c <PATH> or SIRUP_CONFIG=<PATH>; multiple paths can be passed at once, separated by :. The first one is the base and the rest are deep-merged on top.

Pass --no-config to ignore both, even when a file is present: useful for testing another account in memory without exposing stored credentials.

Usage

Start a pre-authenticated session

$ sirup start [--account <name>]

This command spawns a blocking daemon that connects to your IMAP or SMTP server (depending on the account's URL scheme), performs the TLS negociations if necessary, authenticates you, then exposes this session via a Unix socket.

Any client that can connect to, read responses from and write commands into Unix sockets can interact with the session.

The protocol-level greeting is replaced by:

  • IMAP: * PREAUTH [CAPABILITY…] Sirup IMAP pre-auth session ready
  • SMTP: 220 Sirup SMTP pre-auth session ready

The IMAP EHLO-equivalent capability list reflects whatever the upstream server advertised after authentication.

Launch a REPL

$ sirup repl [--account <name>]

S: * PREAUTH [CAPABILITY…] Sirup IMAP pre-auth session ready

C: <Enter your IMAP raw command>

The REPL is a simple client that connects to the Unix socket and forwards raw commands. It picks IMAP or SMTP framing based on the account's URL scheme. Mostly useful for testing and as a demonstration on how to implement clients.

FAQ

How to debug Sirup CLI?

The simplest way is to pass --log-level=<level> (alias --log=<level>), where <level> is one of off, error, warn, info, debug, trace.

The advanced way is based on environment variables:

  • RUST_LOG=<filter>: determines the log level filter (per-target syntax supported, see the env_logger documentation). Consulted only when --log-level is not passed.
  • RUST_BACKTRACE=1: enables the full error backtrace, which includes source lines where the error originated from.

Logs are written to stderr, which means that you can redirect them easily to a file:

sirup start example --log-level=debug 2>/tmp/sirup.log

You can also send logs straight to a file via --log-file=<path>:

sirup start example --log-level=debug --log-file=/tmp/sirup.log

AI disclosure

This project is developed with AI assistance. This section documents how, so users and downstream packagers can make informed decisions.

  • Tools: Claude Code (Anthropic), Opus 4.7, invoked locally with a persistent project-scoped memory and a small set of repo-specific rules.

  • Used for: Refactors, mechanical multi-file edits, boilerplate (feature gates, error enums, derive macros, trait impls), test scaffolding, doc polish, exploratory design conversations.

  • Not used for: Engineering, critical code, git manipulation (commit, merge, rebase…), real-world tests.

  • Verification: Every AI-assisted change is read, compiled, tested, and formatted before commit (nix develop --command cargo check / cargo test / cargo fmt). Behavioural correctness is verified against the relevant RFC or upstream spec, not assumed from the model output. Tests are never adjusted to fit AI-generated code; the code is adjusted to fit correct behaviour.

  • Limitations: AI models occasionally produce code that compiles and passes tests but is subtly wrong: off-by-one errors, missed edge cases, plausible but nonexistent APIs, stale RFC references. The verification workflow catches most of this; it does not catch all of it. Bug reports are welcome and taken seriously.

  • Last reviewed: 30/05/2026

Social

Sponsoring

nlnet

Special thanks to the NLnet foundation and the European Commission that have been financially supporting the project for years:

If you appreciate the project, feel free to donate using one of the following providers:

GitHub Ko-fi Buy Me a Coffee Liberapay thanks.dev PayPal