2 Commits
Author SHA1 Message Date
Lauri Ojansivu 1e342170b9 Compact finished rule email commands after 90 days.
Maintainer decision of 2026-09-30: receipts are compacted after 90 days
to a permanent minimal id and outcome, as the notification outbox does.
A rule email command keeps the whole mail - body and attachments up to
12 MB - and its outcome row keeps recipient addresses, forever. Now,
once an attempt is sent or dropped, is older than
SYNC_RECEIPT_METADATA_DAYS (90), and its rule invocation has a receipt
- after which no replay reads the mail - the command is replaced in
place by its _id, checksum, invocation, plan and effect ids, and the
outcome row is removed. The attempt row, already minimal, stays as the
receipt a late retry finds. A command whose checksum no longer matches
its attempt, or that has no receipt yet, is left for a later pass.

The recovery detail returns an empty recipient list for a compacted
command (only finished attempts are compacted, and none can be resolved
again), and the legacy review no longer counts compacted rows. The
sweep runs hourly (SYNC_RECEIPT_SWEEP_INTERVAL_MS).

A MongoDB test compacts only the old finished command with a receipt,
leaves the one without a receipt, the recent one and the unconfirmed one,
repeats without change, reads the compact form in both readers, and
refuses a command that no longer matches its attempt.

Thanks to xet7 !
2026-09-30 10:23:15 +03:00
Lauri Ojansivu 252f27986b Let administrators resolve partially accepted rule emails.
When SMTP accepts a rule email for only some recipients, or its answer is
lost, the attempt stays unconfirmed and WeKan never sends it again by
itself. Admin Panel -> Problems -> Recovery now shows each recipient as
accepted or not confirmed, and an administrator can resend to the
unconfirmed recipients only (same headers, narrowed SMTP envelope), mark
the attempt sent, or drop it. A drop completes the rule stage without
mail. Decisions wait ten minutes after the attempt started, longer than
any SMTP send can last, are one immutable record per attempt, and are
serialized per command across server processes. A resend records its
intent before SMTP, so an interrupted one is shown as in progress rather
than repeated silently. The offline acceptance tool and the online
decision exclude each other.

Unit, MongoDB integration and source tests cover resend, partial resend,
mark sent, drop, the quarantine and the refusals; a Playwright case
covers review and drop in the Admin Panel. New interface text is in
English, pending translation.

Thanks to xet7 !
2026-09-30 01:46:04 +03:00