-
Notifications
You must be signed in to change notification settings - Fork 1
Home
To get started, you'll need an internet-connected server as well as a DNS name pointing to it. DNS is a requirement for getting letsencrypt certificates.
See the set-up instructions for more.
Operations include adding and removing users as well as managing aliases. The documentation also covers location of the service configuration files and renewing letsencrypt certificates. See the operations instructions for details.
The server supports plain SMTP (enforces STARTTLS), SMTP over SSL, IMAP, and IMAP over SSL.
- The server name (for both sending and receiving) is
HOSTNAME
. - SMTP:
- Port 25 w/ STARTTLS
- Port 465 w/ SSL/TLS
- IMAP:
- Port 143 (STARTTLS)
- Port 993 w/ SSL/TLS
Either "plain" or "login" login is supported. Username is the full user@domain
name supplied to user.sh add ...
. Password is the password provided (or generated).
The Mailserver includes pre-configured services:
- Postfix for handling SMTP[S]
- Dovecot for IMAP[S]
- Caddy for HTTP (letsencrypt) and optionally HTTPS for monitoring / Grafana
- Fail2ban for monitoring Postfix, Dovecot, and (optionally) Grafana logs. Fail2ban runs inside the Mailserver container in a separate network namespace and therefore should not affect connections on the Host.
More details are available on the Mailserver architecture page.
The Mailserver ships with a comprehensive monitoring suite. The suite uses stock Grafana and Prometheus containers and wires these up to the mailserver container. A Pushserver is included to allow the mailserver container to publish additional statistics from a script.
The followong stats are exported:
- Dovecot statistics via Dovecot's built-in OpenMetrics server
- Postfix stats via postfix_exporter
- Fail2ban metrics via fail2ban-prometheus-exporter
- Additional stats via pushgateway using a custom script
- inbox sizes
- postmaster unread emails
- DNS health and SPF, DMARC, DKIM example entries for copy+pasting
A number of dashboards are shipped and provisioned to Grafana, including:
- A main dashboard with most important metrics from all service dashboards below
- SMTP server dashboard (Postfix)
- IMAP server dashboard (Dovecot)
- Fail2Ban dashboard
- Server DNS health dashboard w/ copy-paste-able text for creating SPF. DKIM, and DMARC text records
More details at the monitoring page.
- Use custom HTTP / HTTPS ports e.g. when the mailserver's host system already runs a web server
Check out the repository layout to get started. If you'd like to work on a feature please state so in the corresponding feature issue. Please create a new issue if none exists for the feature you're aiming to implement.
A Dockerfile
is provided with this repo. (Re-)Build the container by issuing
$ docker build -t myemailserver .
Then update start_mailserver.sh
and replace ghcr.io/t-lo/mailserver
with myemailserver
(or any other tag you've used in the docker build
command above). Start your build:
./start_mailserver.sh