Mail-in-a-box fork for Ubuntu 26.04 online

Hi everyone,

Mail-in-a-Box officially supports Ubuntu 22.04, whose standard support ends in April 2027. On 22.04 it still runs PHP 8.0, which has been end-of-life since November 2023. Our own box was in the same position. We had put off a real upgrade for too long, because there
was no supported path to a newer Ubuntu.

The PHP remote code execution vulnerability disclosed in October 2026 was the push we needed. After patching around it by hand, we decided to finally upgrade the whole stack properly. We built and tested an unofficial fork for Ubuntu 26.04, based on v78 and on the
26.04 port in PR #2603. We think others may find it useful:

GitHub - LM1337/Mail-in-a-box-26: Unofficial Mail-in-a-Box fork for Ubuntu 26.04: current packages (PHP 8.5, Nextcloud 34, Dovecot 2.4, Roundcube 1.7), full-text search, adaptive fail2ban, in-place upgrade and migration tools · GitHub (current release: v78-r2604.1)

What it is

  • Mail-in-a-Box v78 on Ubuntu 26.04: Dovecot 2.4, Postfix 3.10, PHP 8.5 from Ubuntu, Nextcloud 34, Roundcube 1.7, and Z-Push 2.7.7 with fixes for PHP 8.5.
  • Three ways to get there:
    • a fresh install;
    • a migration tool that moves a 22.04 box to a new 26.04 server;
    • an in-place upgrade tool for boxes on 22.04 or 24.04. It runs do-release-upgrade for you, resumes after the reboots, and keeps a fallback SSH server open while the release upgrade runs.
  • A few additions: full-text search (fts_xapian), adaptive fail2ban with ActiveSync protection and its own control panel page, and an update-check tool that records the box’s state before and after an update and compares them.

How it was tested

  • Every release went through a matrix of test runs from snapshots of seeded boxes: fresh install, migration, in-place upgrades from 22.04 and 24.04, and updates from earlier fork releases under client load.
  • For the final release we also did a fresh install on the Internet, with real DNS, Let’s Encrypt certificates and mail to and from an external provider.
  • Our own production box has run the fork since the release candidates. It was upgraded in place from 24.04 and then updated to each release.

What’s next: Punk-in-a-Box
This fork is the first step. It stays close to Mail-in-a-Box, so that it remains a drop-in way to get existing boxes onto 26.04, and we will keep maintaining it.

On top of it we are building Punk-in-a-Box, a fork of our fork with more features and a redesign. It will reuse the parts that this fork’s test matrix has already proven: the install, migration and upgrade paths, and the testing. What we are planning:

  • a redesigned control panel;
  • a modern webmail client as the main web interface;
  • DMARC reporting and more admin tools;
  • a path to newer Nextcloud versions without depending on user_external.

We will announce it here when there is something to try.

Please note

  • This is not an official Mail-in-a-Box release and is not affiliated with the project.
  • We spent many hours testing it: fresh installs, migrations, in-place upgrades and updates, across Ubuntu 22.04, 24.04 and 26.04 and many different situations. Even so, every box is different, so please make a full backup before you try it, and keep it somewhere
    other than the box itself.
  • The README explains each path step by step, including how long an in-place upgrade takes. Plan 1–3 hours of mail downtime for it.
5 Likes

-reserved for future purpose-

For the in-place upgrade from 22.04/24.04, how does it handle boxes with local customisations—e.g. edited Postfix/Dovecot config or extra Roundcube plugins? Does the tool detect and preserve them, or is migration to a fresh server recommended? And if do-release-upgrade fails midway, what rollback path remains beyond keeping the fallback SSH server open?

Hey damianocorliss87, what changes have you done?

The tool does not silently carry every customisations over:

  • Dovecot, systemd drop-ins for the mail units, extra files in /etc/nginx/conf.d: the preflight check detects them and blocks the upgrade unless you pass --keep-local. Dovecot 2.4 cannot read a 2.3 configuration, so /etc/dovecot is replaced by a pristine copy before setup. The old files stay in /root/upgrade-2604/old-etc (and moved/). To bring an extension back in 2.4 syntax, put a hook script in /etc/mailinabox/upgrade-2604.d/*.sh; it runs after setup, and doveconf -n must then pass without warnings. Hooks in before/ and after/ can stop and start services that use the mail.

  • Postfix: the release upgrade keeps existing configuration files (–force-confold), but setup re-applies the parameters it manages. The verify phase writes etc-report.txt with the postconf -n settings that differ, the restrictions that are gone (each counts as a failed check: redo it or accept with --finish), the changed and removed files, and the units that were enabled before and are disabled now.

  • Extra Roundcube plugins are not detected or preserved. The upgrade moves Roundcube to 1.7.6: setup builds a new tree and writes its own plugin list. Save your plugins and their configuration beforehand and re-add them in a hook; they must work with Roundcube 1.7 and PHP 8.5.

=> If the box carries substantial local changes, migrating to a fresh 26.04 server (tools/migrate-to-2604.sh) is the safer route; the in-place tool is meant for boxes that cannot move. Either way, run --check first.
And If you want to keep all modifications, one of the easiest possibilities would be to take Claude Opus and tell Opus to do the upgrade with our resources but it should integrate all your modifications.

Kind Regards

Hello, great progress with the 26.04 fork, many thanks!

There is one immediate issue regarding DNSSEC: in the System Status Checks page, there is “This domain’s DNSSEC DS record is not set. The DS record is optional. The DS record activates DNSSEC. See below for instructions.”, but no instructions, i.e. the DNSSEC records to be setup at registrar are simply not there, "below instructions" are missing.