Simple NixOS Mailserver
Complete mailserver solution leveraging the Nix Ecosystem.
Alternatives
Tech stack
No tech stack added yet. Sign in to suggest some
Note: Fetching the official site (the GitLab project page) failed. The content below is based on prior knowledge of the project, so please refer to the official repository and documentation for the exact options and supported versions.
Introduction
Simple NixOS Mailserver (SNM for short) is a community-maintained open-source project hosted on GitLab. It provides a complete mail server solution in the form of a NixOS module. Its goal is to let people set up and maintain their own email service with simple, declarative configuration, without having to configure and wire together multiple mail components by hand.
Key Features
- SMTP sending and receiving: Based on Postfix, with support for SMTP submission and TLS encryption.
- IMAP / POP3 access: Based on Dovecot, so mail clients can sync mailboxes normally.
- Anti-spam: Integrates Rspamd to filter spam.
- Sender authentication: Supports DKIM signing, and works with DNS records such as SPF and DMARC to improve deliverability.
- Automatic certificates: Can obtain and renew TLS certificates automatically through Let's Encrypt (ACME).
- Mail filtering rules: Supports Sieve scripts and ManageSieve, so users can define their own server-side filtering rules.
- Multiple domains and account management: You can declare multiple domains, mailbox accounts, aliases and catch-all addresses in the configuration, and set quotas for accounts.
- Full-text search: Full-text mail search can be enabled.
Target Users and Use Cases
- Individuals and small teams who already use NixOS and want to self-host their email.
- Users who want to control their own email data and not depend on large mail providers.
- Providing mailboxes for a personal domain, a household or a small organization.
- Administrators who want to put their mail server configuration under version control and achieve reproducible deployments.
Core Advantages
- Declarative and reproducible: The entire mail service is written in Nix configuration, which makes migration, rebuilding and rollback easy.
- Works out of the box: The mainstream mail components are already integrated and security-related defaults are preconfigured, so it requires significantly less configuration than a manual setup.
- Easy to maintain: It follows NixOS release branches, so the mail service is upgraded along with the system.
Deployment
- Prepare a NixOS server with a public IP address, and make sure port 25 can communicate normally.
- Import the SNM module in your NixOS configuration. You can do this with a Flake, or with
fetchTarballusing the branch that matches your system version. - Enable
mailserver.enablein your configuration and fill infqdn,domainsandloginAccounts. Account passwords are entered as hashes, which you can generate withmkpasswd. - Configure how certificates are obtained, for example automatically through ACME.
- Run
nixos-rebuild switchto apply the configuration. - Add MX, SPF, DKIM and DMARC records in DNS, and set up reverse DNS (PTR).
Technical Requirements
- A server (VPS or physical machine) running NixOS.
- A domain whose DNS you can manage yourself.
- A server IP with a good reputation, the ability to set a PTR record, and a provider that does not block port 25.
Notable Points
- It is released under an open-source license (usually listed as GPL-3.0).
- The project provides online documentation covering configuration options, backup methods and frequently asked questions.
- Self-hosting email requires ongoing attention to deliverability, IP reputation and security updates, so it is best suited to users with some operations experience.
Discover more
Courier MTA
Fast, scalable, enterprise mail/groupware server providing ESMTP, IMAP, POP3, webmail, mailing list, basic web-based calendaring and scheduling services.
DebOps
Your Debian-based data center in a box. A set of general-purpose Ansible roles that can be used to manage Debian or Ubuntu hosts.
EmailRelay
A small and easy to configure SMTP and POP3 server for Windows and Linux.
Exim
Message transfer agent (MTA) developed at the University of Cambridge.
GNUnet
Software framework for decentralized, peer-to-peer networking.
Glowing Bear
A web frontend for WeeChat.