openship icon indicating copy to clipboard operation
openship copied to clipboard

[Bug] Email app (desktop v0.3.0): three bugs break the mail-server flow out of the box (engine missing, webmail auto-deploy crash, iRedMail version check)

Open tizerluo opened this issue 4 months ago • 2 comments

Summary

While deploying a mail server with the Email app from the macOS desktop (v0.3.0), we hit three independent bugs that each break the out-of-the-box flow. All three were confirmed on a fresh Ubuntu 26.04 server, and we had to work around every one of them manually.

Bug 1 — The iRedMail engine never materializes on disk

After adding the Email app in the desktop UI, the engine directory ~/Library/apps/email/engine is never actually populated — the wizard then fails because the engine files it tries to run don't exist.

Workaround we used: sparse-checkout apps/email/engine from the oblien/openship monorepo into ~/Library/apps/email/engine by hand. After that the wizard could run.

Expected: installing the Email app from the UI should place a working engine under ~/Library/apps/email/engine with no manual git surgery.

Bug 2 — Webmail auto-deploy crashes 100% of the time (no workaround)

The bundled webmail (Zero, from the openship-email v0.3.0 dist) cannot boot when auto-deployed:

  • In the bun-built server bundle, API_ROOT = resolve(__dirname, "../..") evaluates to / at runtime.
  • On startup readApiVersion() then tries to read /package.json, which throws ENOENT and kills the process.
  • Since this resolves to the filesystem root (read-only), there is no user-side workaround — the auto-deployed webmail simply cannot start.

Workaround we used: deployed the official v0.3.0 dist manually on the mail server (bun on 127.0.0.1:4080 via systemd, behind an OpenResty reverse proxy on 443). That has been running fine in production, so the dist itself is OK — it's the bundled/auto-deployed build that's broken.

Side note for the manual-deploy docs: DEFAULT_IMAP_HOST / DEFAULT_SMTP_HOST must be set to the public hostname (e.g. mail.example.com), not 127.0.0.1 — otherwise the TLS certificate hostname mismatch surfaces to users as a misleading "wrong password" error at login.

Bug 3 — The engine's own version check rejects its pinned iRedMail 1.8.1

With the engine in place, the install aborts because check_new_iredmail() in pkgs/get_all.sh rejects the iRedMail 1.8.1 the engine itself pins/downloads. We had to patch the function to return 0 locally to let the install proceed. After patching, iRedMail 1.8.1 installed and has been running cleanly (Postfix 3.10.6, Dovecot, Amavis 2.13.0, ClamAV, iRedAPD, fail2ban, PostgreSQL — all green).

Environment

  • OpenShip desktop v0.3.0 on macOS
  • Target server: Ubuntu 26.04 LTS, fresh minimal install, root over SSH key
  • openship-email v0.3.0 (engine + webmail dist)

Happy to provide full logs or test a fix — the server is still up and we can reproduce any of the three.

tizerluo avatar Jul 26 '26 09:07 tizerluo

The first bug (engine missing from appdata) has also appeared in the windows desktop app.

kosaroland96 avatar Jul 28 '26 13:07 kosaroland96

is it fixed or not yet ? 0.4.8

Hydralerne avatar Jul 29 '26 14:07 Hydralerne