scorpiox-server-email communication

linux-x64linux-arm64macos-arm64windows-x64

Description

A self-contained email server with full SMTP and IMAP support, TLS encryption via mbedtls, DKIM signing for deliverability, smart relay forwarding, and an integrated terminal UI. Run your own mail infrastructure from a single binary — no Postfix, no Dovecot, no configuration sprawl.

Flags & Options

Flag Short Description Takes Value
--help -h Show help message and exit No
--daemon Run as a background daemon process No
--no-tls Disable TLS encryption (plaintext only) Yes
--smtp-port Set SMTP listening port (default: 25) Yes
--submission-port Set mail submission port (default: 587) Yes
--imap-port Set IMAP listening port (default: 993) Yes
--domain Primary mail domain (e.g. example.com) Yes
--maildir Path to Maildir storage directory Yes
--tls-cert Path to TLS certificate file (PEM) Yes
--tls-key Path to TLS private key file (PEM) Yes
--accounts Path to accounts file (user:password per line) Yes
--dkim-key Path to DKIM private key for message signing Yes
--dkim-selector DKIM selector name (default: default) Yes
--dkim-domain DKIM signing domain (defaults to --domain) Yes
--aliases Path to aliases file for address mapping Yes
--relay-host Upstream SMTP relay hostname Yes
--relay-port Upstream SMTP relay port (default: 587) Yes
--relay-user Username for relay authentication Yes
--relay-pass Password for relay authentication Yes
--relay-tls Enable TLS for relay connections No
--no-relay-tls Disable TLS for relay connections Yes

Usage Examples

Start a basic mail server for your domain
# Minimal setup — SMTP on 25, submission on 587, IMAP on 993 $ scorpiox-server-email --domain example.com \ --tls-cert /etc/letsencrypt/live/example.com/fullchain.pem \ --tls-key /etc/letsencrypt/live/example.com/privkey.pem \ --accounts /etc/mail/accounts.txt ✓ SMTP listening on :25 ✓ Submission listening on :587 (STARTTLS) ✓ IMAP listening on :993 (TLS) ✓ Domain: example.com ✓ 3 accounts loaded
Run as a daemon with DKIM signing
# Enable DKIM for better deliverability to Gmail, Outlook, etc. $ scorpiox-server-email --daemon \ --domain mail.scorpiox.net \ --tls-cert /etc/tls/cert.pem \ --tls-key /etc/tls/key.pem \ --accounts /etc/mail/users.txt \ --dkim-key /etc/mail/dkim-private.pem \ --dkim-selector default \ --dkim-domain scorpiox.net ✓ Daemonized (PID 4821) ✓ DKIM signing enabled: default._domainkey.scorpiox.net
Custom ports and Maildir storage path
# Use non-standard ports and a custom mail storage directory $ scorpiox-server-email --domain dev.local \ --smtp-port 2525 \ --submission-port 2587 \ --imap-port 9993 \ --maildir /data/mail \ --accounts /data/mail/accounts.txt \ --tls-cert /data/tls/cert.pem \ --tls-key /data/tls/key.pem ✓ SMTP listening on :2525 ✓ Submission listening on :2587 (STARTTLS) ✓ IMAP listening on :9993 (TLS) ✓ Maildir: /data/mail
Relay outbound mail through an upstream provider
# Forward all outbound mail through a relay (e.g. SendGrid, AWS SES) $ scorpiox-server-email --domain company.com \ --tls-cert /etc/tls/cert.pem \ --tls-key /etc/tls/key.pem \ --accounts /etc/mail/accounts.txt \ --relay-host smtp.sendgrid.net \ --relay-port 587 \ --relay-user apikey \ --relay-pass SG.xxxxx \ --relay-tls ✓ Relay configured: smtp.sendgrid.net:587 (TLS) ✓ All outbound mail will be forwarded through relay
Plaintext mode for local development / testing
# No TLS — useful for local dev with tools like mailhog, swaks $ scorpiox-server-email --domain localhost \ --no-tls \ --smtp-port 2525 \ --imap-port 1143 \ --accounts ./test-accounts.txt \ --maildir ./tmp-mail ✓ TLS disabled (plaintext mode) ✓ SMTP listening on :2525 ✓ IMAP listening on :1143
Email aliases for address forwarding
# Map aliases to real accounts (aliases file: alias@domain user@domain) $ cat /etc/mail/aliases.txt info@example.com admin@example.com support@example.com admin@example.com sales@example.com team@example.com $ scorpiox-server-email --domain example.com \ --tls-cert /etc/tls/cert.pem \ --tls-key /etc/tls/key.pem \ --accounts /etc/mail/accounts.txt \ --aliases /etc/mail/aliases.txt ✓ 3 aliases loaded
Verify DNS records for deliverability
# Required DNS records for production deployment # MX record example.com. IN MX 10 mail.example.com. # SPF record example.com. IN TXT "v=spf1 a mx ip4:203.0.113.1 -all" # DKIM record (matches --dkim-selector) default._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIIBIj..." # DMARC record _dmarc.example.com. IN TXT "v=DMARC1; p=quarantine; rua=mailto:admin@example.com"

Source & Build Info

Source File
scorpiox/scorpiox-server-email.c
Lines of Code
1,309
Dependencies
libsxterm, libsxutil, mbedtls

Related Tools