Skip to content

Titlani

Misfin(C) mail protocol client and server library for Python.

Titlani is a complete implementation of the Misfin(C) mail transport protocol — a lightweight, privacy-focused mail protocol influenced by Gemini that uses mandatory TLS with self-signed identity certificates and Trust-On-First-Use (TOFU) validation.


  • Protocol


    Full Misfin(C) wire format implementation with request/response parsing, status codes, and size limits.

  • Identity


    Generate and manage Misfin identity certificates with custom layouts (USER_ID, CN, SAN DNS).

  • TOFU


    Built-in Trust-On-First-Use certificate validation with persistent database and revocation support.

  • Asyncio


    Fully async client and server built on asyncio.Protocol with middleware, rate limiting, and access control.


Quick Example

# Generate an identity
titlani identity generate alice example.com --blurb "Alice Smith"

# Send a message
titlani send bob@remote.host "Hello from Misfin!" \
    --cert alice.pem --key alice.key --subject "Greetings"
# Start with defaults (auto-generates certs)
titlani serve --hostname example.com --mailbox-dir ./mailboxes

# Or use a config file
titlani serve --config server.toml
from titlani import MisfinClient

async with MisfinClient(
    client_cert="alice.pem",
    client_key="alice.key",
) as client:
    response = await client.send(
        to="bob@remote.host",
        body="Hello from Misfin!",
        subject="Greetings",
    )
    print(f"{response.status} {response.meta}")

Install

uv add titlani

Or with pip:

pip install titlani

See the Installation guide for more options.


Learn More