x386.org

ISPMailInstall

A multi-domain mail server installer for Debian and Ubuntu.

ISPMailInstall is a Python tool I wrote to automate the installation and configuration of a mail server based on Christoph Haas's ISPmail tutorial.

The tutorial explains how the pieces fit together. ISPMailInstall handles the installation steps, using the hostname, domains, and settings you supply. The tutorial remains a useful reference for understanding and maintaining the resulting server.

Get ISPMailInstall · Read the documentation

What it sets up

The installer brings together the services needed to host mail for multiple domains and users:

  • Postfix and Dovecot for mail delivery and mailbox access.
  • Rspamd for spam filtering and spam/ham training.
  • Roundcube for webmail.
  • ISPMailAdmin for managing mail domains and users.
  • MariaDB and Adminer for the mail database and its administration.
  • Apache and PHP for the web interfaces.
  • Certbot for TLS certificates.

The configuration includes virtual mail domains and users, mailbox quotas, and the DNS records needed for SPF, DKIM, and DMARC. Users can read their mail through Roundcube or connect with Thunderbird and other compatible mail clients.

Supported systems

The current release, v0.4.0, supports:

  • Debian 12 and 13
  • Ubuntu 24.04 and 26.04

The installer handles the different configuration requirements of these releases, including Dovecot 2.4 on Debian 13 and Ubuntu 26.04.

Before you begin

Use a freshly installed server. This installer installs packages, creates database users and tables, replaces service configuration files, and restarts services. It requires root privileges; it is intended for setting up a new mail server.

You will need:

  • A supported Debian or Ubuntu installation with Python 3.
  • A fully qualified mail hostname, such as mail.example.org.
  • A forward A record and a reverse PTR record for that hostname, plus an AAAA record if you publish IPv6.
  • At least one domain to host.
  • A real contact email address for certificate notifications.

Arrange the hostname and DNS records before installation where possible. Correct DNS is necessary for certificate issuance and reliable mail delivery.

Getting started

Download the source from Disroot:

git clone https://git.disroot.org/Enatsek/ISPMailInstall.git
cd ISPMailInstall

Review and edit ispmail.conf for your server, then run:

sudo python3 ispmail.py

Empty configuration values are requested interactively. Passwords can be supplied in the configuration or generated securely by setting their values to auto. Generated passwords are saved in ispmailpasswords.txt, accessible only to root.

The installer validates configuration values before changing the server and stops on the first failed operation. If installation fails, review ispmail.log and ispmail.error.log before trying again.

See the README for the configuration fields, password options, and full requirements.

After installation

For each hosted domain, the installer produces a <domain>.dns.config file containing MX, SPF, DMARC, and DKIM records. Add these records at your DNS provider before accepting production mail.

Your web interfaces use the configured mail hostname:

Interface Address
Roundcube webmail https://mail.example.org
Domain and user administration https://mail.example.org/admin
Database administration https://mail.example.org/adminer
Spam administration https://mail.example.org/rspamd

Replace mail.example.org with your own hostname. Login details are explained in the README.

Verify mail delivery, mailbox access, certificates, and DNS before relying on the server. Installation is the starting point; operating a mail server also means maintaining updates, backups, and its configuration.

What remains outside the installer

Three optional ISPmail tutorial topics are intentionally excluded:

  • Malware blocking
  • Firewalling and brute-force mitigation
  • Server-side mail encryption

Consider these separately when planning your server. The ISPmail tutorial provides the background for the setup and its optional features.

Source and license

ISPMailInstall is free software under the GNU General Public License, version 3 or later.

The project repository contains the source, configuration example, documentation, and tests. The installation checklist describes verification on fresh servers.

x386.org