Skip to content

claytongentry/mail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mail

Small IMAPrev1-style Rust server.

Development

This repo uses Apple's container CLI for a local Rust 1.96 environment. Start the container service once before using these commands:

container system start

Common commands:

just build
just test
just start
just smoke

just start builds the image, runs the server in a container, and publishes it on 127.0.0.1:1143. By default it uses the in-memory fixture mail store. Override the local port or JWT secret with environment variables:

MAIL_PORT=2143 JWT_SECRET=local-secret just start

In another terminal, run the scripted imaptest compliance smoke suite against the running server:

JWT_SECRET=local-secret just smoke

just smoke runs the Dovecot imaptest binary inside the running mail-dev container. The target generates an XOAUTH2 initial response from the running container's JWT_SECRET and runs the scripts copied into /app/tests/imaptest. Use IMAPTEST_ARGS for additional imaptest flags.

By default, just smoke reports all scripted failures. To stop at the first failure while debugging one issue, run:

IMAPTEST_ARGS=error_quit JWT_SECRET=local-secret just smoke

To use the SQLite mail store, opt in with MAIL_STORE=sqlite:

MAIL_STORE=sqlite just start

The default database path is /data/mail.sqlite3. just start mounts the Apple container named volume mail-data at /data, so the SQLite database persists across container restarts. Create the volume explicitly if you want to see setup failures before starting the server:

just volume

Override the volume or database path when needed:

MAIL_VOLUME=my-mail-data MAIL_DB_PATH=/data/dev.sqlite3 MAIL_STORE=sqlite just start

To reset the local SQLite state, stop the server and delete the named volume:

just stop
container volume delete mail-data

About

A fiddly effort at an IMAPrev1 mail server https://tools.ietf.org/html/rfc2060

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors