Getting started

Install

One command installs mailrust on a Linux server with systemd. It takes about a minute and prints a link where you finish setup in the browser.

Requirements

  • Linux on x86_64 with systemd. A small virtual server is enough to start.
  • Root access, to install the program and the service.
  • A domain name, if you want mailrust to serve HTTPS on its own. It is optional when mailrust sits behind your web server.

Behind your web server

This is the usual way when the server already runs nginx, Caddy or a hosting panel.

curl -fsSL https://mailrust.com/install.sh | sh

mailrust listens on 127.0.0.1:8420. Point your web server at it the way you do for any application, and keep the Host header and the client's address. Examples for nginx and Caddy are in HTTPS and proxies.

HTTPS by itself

On a server with nothing else on ports 80 and 443, mailrust can answer on them and get a certificate from Let's Encrypt.

curl -fsSL https://mailrust.com/install.sh | sh -s -- --domain mail.example.com --email you@example.com

Point the domain's A and AAAA records at the server first: Let's Encrypt checks them before it issues the certificate.

What the installer does

WhatWhere
The program/usr/local/bin/mailrust, one file
A system usermailrust
Data/var/lib/mailrust
Settings/etc/mailrust/mailrust.env
The servicemailrust.service, started right away

At the end it prints a one-time link to the first run. Open it in the browser to create the first administrator and set the address people use to reach this installation.

Lost the link? Run sudo -u mailrust mailrust setup-link to print it again.

Options

OptionWhat it does
--domain NAMEServe HTTPS for NAME with a Let's Encrypt certificate
--email ADDRESSContact for Let's Encrypt notices
--listen ADDRAddress for the proxy mode, 127.0.0.1:8420 by default
--version VERInstall this version instead of the latest
--no-startInstall, but do not start the service
--uninstallRemove the program and the service, keep data and settings
--purgeWith --uninstall, also delete data and settings

Options go after sh -s --, for example:

curl -fsSL https://mailrust.com/install.sh | sh -s -- --version 0.9.0 --no-start

Running it again

Running the installer again updates the program and keeps your data and settings. For updates, sudo mailrust update does the same and also checks the signature of the release.