Skip to content

XeinTDM/Cortel

Repository files navigation

Cortel - Your Own Disposable Email Service

Cortel is a high-performance, easy-to-deploy temporary email service built with Rust, Leptos, and Axum. It's designed to be fully customizable, allowing you to host your own "temp-mail" style service in minutes.

Features

  • Blazing Fast: Built with Rust for maximum performance and low memory footprint.
  • Easy Branding: Change colors, names, and SEO metadata via environment variables.
  • Responsive UI: Modern interface that works on mobile and desktop.
  • Private & Secure: In-memory storage (no database required) with automatic cleanup of old messages.
  • Attachment Support: Receive and download email attachments.
  • Recovery Links: Bookmark or share access to an inbox.

Quick Start

1. Prerequisites

  • Rust (latest stable)
  • A domain name (or several)
  • Port 25 (SMTP) and 3000 (HTTP) open on your firewall

2. Configuration

Copy the example environment file:

cp .env.example .env

Edit .env and set your domains and branding:

CORTEL_SITE_NAME=MyService
CORTEL_DOMAINS=mail.example.com,temp.example.net
CORTEL_BRAND_COLOR=#6366f1

3. DNS Setup

For each domain in CORTEL_DOMAINS, you need to set up an MX Record pointing to your server's IP address.

  • Type: MX, Host: @, Value: your-server-ip.com, Priority: 10

4. Build and Run (Windows)

# Build the WASM client + Tailwind
powershell -ExecutionPolicy Bypass -File build.ps1

# Build the server
cargo build --release -p cortel-server

# Run the server (Axum + SMTP)
./target/release/cortel-server

5. Build and Run (Linux/macOS)

rustup target add wasm32-unknown-unknown
cargo install wasm-bindgen-cli

# Tailwind (Linux x64)
curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64
chmod +x tailwindcss-linux-x64

# Build the WASM client
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' \
  cargo build --release --lib --target wasm32-unknown-unknown -p cortel-web --no-default-features --features hydrate

# Generate JS bindings
mkdir -p target/site/pkg
wasm-bindgen --target web --no-typescript --out-dir target/site/pkg --out-name cortel-web target/wasm32-unknown-unknown/release/cortel_web.wasm

# Compile Tailwind CSS
./tailwindcss-linux-x64 -i cortel-web/style/main.css -o target/site/pkg/cortel-web.css --bundle --minify

# Build the server
cargo build --release -p cortel-server

# Run the server (Axum + SMTP)
./target/release/cortel-server

Docker Deployment

You can also run Cortel using Docker:

docker build -t cortel .
docker run -p 3000:3000 -p 25:25 --env-file .env cortel

Customization

Cortel is built with modularity in mind.

  • Logo/Icon: The mail icon is an SVG hardcoded in cortel-web/src/components/home.rs and inbox.rs. Search for <svg to find and replace it with your own.
  • Frontend: Check cortel-web/src/components to modify the UI.
  • Styles: We use Tailwind CSS. Modify cortel-web/style/main.css.
  • Backend: SMTP logic is in cortel-server/src/smtp.rs.

License

MIT License - feel free to use it for your own projects!

About

A fast, self‑hosted disposable email service built in Rust.

Topics

Resources

License

Stars

Watchers

Forks

Contributors