From 08a8ae182e9359ce70d096ebcecdee1692941d18 Mon Sep 17 00:00:00 2001 From: Flamur Veliqi Date: Mon, 23 Feb 2026 14:24:51 +0100 Subject: [PATCH] nx-webmail: fix full mailbox sync path for large inboxes --- nx-webmail/README.md | 4 ++-- nx-webmail/docker-compose.yml | 2 +- nx-webmail/server.js | 16 ++++++++++------ nx-webmail/umbrel-app.yml | 4 ++-- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/nx-webmail/README.md b/nx-webmail/README.md index 5fafe51..f22bc60 100644 --- a/nx-webmail/README.md +++ b/nx-webmail/README.md @@ -30,7 +30,7 @@ Umbrel installation is most reliable when your app uses a prebuilt image from a - `git.weektab.org/nexus/nx-webmail:latest` 3. The workflow then pins `nx-webmail/docker-compose.yml` to `tag@sha256:digest` automatically. 4. Manual fallback: - docker buildx build --platform linux/amd64,linux/arm64 -t git.weektab.org/nexus/nx-webmail:1.0.6 --push . + docker buildx build --platform linux/amd64,linux/arm64 -t git.weektab.org/nexus/nx-webmail:1.0.7 --push . ## Umbrel app packaging @@ -55,7 +55,7 @@ This repository is prepared for Umbrel app-store usage. Notes: - Umbrel uses the `app_proxy` service in `docker-compose.yml`. - Internal app port is `3001`. -- `server` uses a prebuilt registry image (`git.weektab.org/nexus/nx-webmail:1.0.6`). +- `server` uses a prebuilt registry image (`git.weektab.org/nexus/nx-webmail:1.0.7`). - If your store prefix changes, update `id` in `umbrel-app.yml` and `APP_HOST` in `docker-compose.yml`. ## Notes diff --git a/nx-webmail/docker-compose.yml b/nx-webmail/docker-compose.yml index 679bf94..6195b93 100644 --- a/nx-webmail/docker-compose.yml +++ b/nx-webmail/docker-compose.yml @@ -7,7 +7,7 @@ services: APP_PORT: 3001 server: - image: git.weektab.org/nexus/nx-webmail:1.0.6@sha256:7967020f4c24b5d8ba61d069bcb3fb951db7e65568f71782d44e54c8d230fc5b + image: git.weektab.org/nexus/nx-webmail:1.0.7@sha256:01dfba4f671f490f3dddf9b5ddc3a98bfff7f10e8a87aa47b4873f8ac1a3d332 init: true restart: on-failure stop_grace_period: 1m diff --git a/nx-webmail/server.js b/nx-webmail/server.js index 2d07aac..7f5edbc 100644 --- a/nx-webmail/server.js +++ b/nx-webmail/server.js @@ -159,8 +159,12 @@ app.post('/api/webmail/inbox', async (req, res) => { return res.json({ sync: true, total, newEmails, deletedUids }); } + let results = []; let targetUids = sortedUids; - if (!loadAll) { + if (loadAll) { + // For full mailbox sync, use ALL to avoid oversized UID query strings. + results = await connection.search(['ALL'], fetchOptions); + } else { if (oldest) { const start = safeOffset; const end = Math.min(total, start + safeLimit); @@ -170,13 +174,13 @@ app.post('/api/webmail/inbox', async (req, res) => { const start = Math.max(0, end - safeLimit); targetUids = sortedUids.slice(start, end); } - } - if (targetUids.length === 0) { - return res.json({ emails: [], total, hasMore: false, nextOffset: safeOffset }); - } + if (targetUids.length === 0) { + return res.json({ emails: [], total, hasMore: false, nextOffset: safeOffset }); + } - const results = await connection.search([['UID', targetUids.join(',')]], fetchOptions); + results = await connection.search([['UID', targetUids.join(',')]], fetchOptions); + } const emails = results.map(parseHeaderRow).sort((a, b) => Number(a.id || 0) - Number(b.id || 0)); const nextOffset = loadAll ? total : Math.min(total, safeOffset + targetUids.length); const hasMore = loadAll ? false : nextOffset < total; diff --git a/nx-webmail/umbrel-app.yml b/nx-webmail/umbrel-app.yml index 9aa1816..2a39889 100644 --- a/nx-webmail/umbrel-app.yml +++ b/nx-webmail/umbrel-app.yml @@ -4,7 +4,7 @@ name: Webmail tagline: Self-hosted IMAP/SMTP webmail client icon: https://git.weektab.org/nexus/umbrel-apps/raw/branch/main/gallery/webmail/icon.png category: utilities -version: "1.0.6" +version: "1.0.7" port: 3001 description: >- Webmail is a lightweight, self-hosted webmail app for connecting to external @@ -17,7 +17,7 @@ repo: https://git.weektab.org/nexus/webmail support: https://git.weektab.org/nexus/webmail/issues gallery: [] releaseNotes: >- - Fixed login background overflow and improved initial mailbox synchronization behavior. + Improved IMAP full-sync reliability for large inboxes in container deployments. dependencies: [] path: "" defaultUsername: ""