MCPSERV.CLUB
Emailwiz

Emailwiz

Self-Hosted

Automated self‑hosted mail server setup

Stale(68)
2.1kstars
0views
Updated May 4, 2025

Overview

Discover what makes Emailwiz powerful

`emailwiz` is a lightweight, self‑hosted mail stack designed for developers who prefer a minimal, Unix‑centric environment over bloated webmail suites. At its core the script provisions an SMTP/IMAP service powered by **Postfix** and **Dovecot**, respectively, while wiring them together with secure authentication via PAM. The stack is intentionally *stateless* in terms of user data: mailboxes are mapped to system users, eliminating the need for a dedicated SQL database and simplifying backup/restore workflows.

Postfix

Dovecot

OpenDKIM

SpamAssassin

Overview

emailwiz is a lightweight, self‑hosted mail stack designed for developers who prefer a minimal, Unix‑centric environment over bloated webmail suites. At its core the script provisions an SMTP/IMAP service powered by Postfix and Dovecot, respectively, while wiring them together with secure authentication via PAM. The stack is intentionally stateless in terms of user data: mailboxes are mapped to system users, eliminating the need for a dedicated SQL database and simplifying backup/restore workflows.

Technical Stack & Architecture

  • Postfix – the MTA responsible for accepting inbound mail on ports 25/465/587, performing SPF/DKIM checks, and routing to local delivery agents.
  • Dovecot – the IMAP/POP3 server that presents user mailboxes to clients such as Thunderbird, K‑9, or command‑line tools.
  • OpenDKIM – provides domain signing to improve deliverability and integrates with Postfix via a shared socket.
  • SpamAssassin – runs as a content filter, exposing a local API that developers can hook into for custom scoring rules.
  • Certbot – automates the acquisition of Let’s Encrypt TLS certificates for mail.yourdomain.tld.
  • fail2ban – protects all services by monitoring logs and banning IPs that exhibit suspicious behavior.

The script orchestrates configuration files for each component, ensuring tight coupling: Postfix uses Dovecot’s auth socket for authentication, and DKIM signing is applied before the message exits the server. All services run under their own systemd units, allowing fine‑grained control and easy integration with container runtimes.

Core Capabilities & APIs

  • PAM‑based authentication: developers can plug in any PAM module (e.g., LDAP, GSSAPI) without touching the mail stack.
  • SMTP/IMAP over TLS: full support for STARTTLS and SMTPS, with automatic certificate renewal via Certbot.
  • DKIM signing & verification: the public key is published as a TXT record (mail._domainkey) and can be rotated programmatically.
  • SpamAssassin API: exposes a http://localhost:7835/ endpoint for score queries, enabling custom dashboards or automated rule updates.
  • fail2ban filters: pre‑configured jails for Postfix, Dovecot, and SpamAssassin that can be extended with custom regex patterns.

While the script does not ship a webmail interface, it includes guidance for integrating third‑party clients like Rainloop or Roundcube if a UI is desired.

Deployment & Infrastructure

emailwiz targets Debian/Ubuntu servers, but the components are available on most Linux distributions. The script opens necessary ports (25, 587, 993, 995) and optionally provides a self‑signed cert for isolated environments. For containerization, each service can be packaged into its own Docker image; the script’s configuration files are small and portable, making it straightforward to compose a multi‑container deployment with Docker Compose or Kubernetes. Scaling horizontally is achievable by adding more SMTP relay nodes and using a shared NFS or object store for mail storage, though the default setup is intended for single‑node deployments.

Integration & Extensibility

  • DNS record automation: the script outputs MX, SPF, DMARC, and DKIM TXT records, simplifying domain authentication.
  • Custom filter hooks: developers can drop .cf files into SpamAssassin’s local.d directory to add rules.
  • PAM modules: swap authentication backends by changing /etc/pam.d/dovecot and /etc/postfix/main.cf.
  • Webhooks: while not built in, Postfix’s header_checks and mime_filter can be used to trigger external scripts on message receipt or send.

The modular nature of the stack encourages experimentation: replace Postfix with Exim, swap Dovecot for Courier, or integrate a mail‑archiving service without touching the core script.

Developer Experience & Community

The project’s README is concise yet thorough, outlining prerequisites, DNS requirements, and post‑install steps. Documentation is hosted on GitHub with clear sections for troubleshooting and advanced configuration. Community support is modest but active; the author maintains a mailing list and responds to issues promptly. Licensing is permissive (MIT), allowing commercial use without royalties.

Use Cases

  1. Private domain email for small teams – no need for a full‑featured webmail; clients can use native mail apps.
  2. IoT notification hub – the isolated, self‑signed mode is ideal for sending logs or alerts from devices on a VPN.
  3. Educational labs – students learn SMTP/IMAP internals without the overhead of a GUI interface.
  4. Custom mail processors – developers can hook SpamAssassin or DKIM into automated workflows (e.g., webhook‑based ticketing).

Advantages Over Alternatives

  • Zero database overhead – eliminates SQL tuning and backup complexity.
  • High deliverability out of the box – built‑in DKIM/SPF/DMARC support with automatic certs.
  • Lightweight footprint – suitable for low‑resource VPS or edge devices.
  • Open‑source, permissive license – no licensing costs for commercial deployments.

In summary, emailwiz offers a developer‑friendly, fully functional mail server that prioritizes security, configurability, and minimalism. It is an

Open SourceReady to get started?

Join the community and start self-hosting Emailwiz today

Weekly Views

Loading...
Support Us
Most Popular

Infrastructure Supporter

$5/month

Keep our servers running and help us maintain the best directory for developers

Repository Health

Loading health data...

Information

Category
apis-services
License
GPL-3.0
Stars
2.1k
Technical Specs
Pricing
Open Source
Database
None
Docker
None
Supported OS
Linux
Author
LukeSmithxyz
LukeSmithxyz
Last Updated
May 4, 2025