nx-webmail: fix full mailbox sync path for large inboxes
Some checks failed
Publish nx-webmail Image (Gitea) / publish (push) Has been cancelled
Some checks failed
Publish nx-webmail Image (Gitea) / publish (push) Has been cancelled
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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: ""
|
||||
|
||||
Reference in New Issue
Block a user