aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md6
-rw-r--r--docs/superpowers/plans/2026-08-03-post-0.1.0-usability-closed.md18
-rw-r--r--docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md20
-rw-r--r--docs/superpowers/specs/2026-10-31-rule-apply-and-archive-design.md8
-rw-r--r--docs/superpowers/specs/2026-11-16-rule-move-design.md5
-rw-r--r--translations/qtmaildir_it_IT.ts36
6 files changed, 69 insertions, 24 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 736fca0..d76a249 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,12 @@ point at which they are stable.
### Added
+- A tagging rule can move the mail it matches into the spam or trash
+ folder, through a new **Move to** field in the rules dialog. Each message
+ goes to the folder its own account configures (`spam` / `trash`), never to
+ a folder named in the rule, and leaves the inbox while staying unread. It
+ applies to mail as it arrives; Restore and Not spam work on it as on a
+ message moved by hand.
- `--account`, `--thread` and `--message` on the command line, so another
program can open qtmaildir at a particular account's view, conversation or
message. The three combine, and Qt's own options are accepted beside them.
diff --git a/docs/superpowers/plans/2026-08-03-post-0.1.0-usability-closed.md b/docs/superpowers/plans/2026-08-03-post-0.1.0-usability-closed.md
index c83e41c..7769c51 100644
--- a/docs/superpowers/plans/2026-08-03-post-0.1.0-usability-closed.md
+++ b/docs/superpowers/plans/2026-08-03-post-0.1.0-usability-closed.md
@@ -10912,3 +10912,21 @@ while moves report through another signal. An error bumps the same ticket, so
a late "done" cannot cover the error message. Tested by
`aWriteSaysItIsApplyingUntilTheWorkerHasRunIt`, which fails when the reply is
dropped.
+
+## 214. A rule cannot move mail to the spam or trash folder
+
+**Observed (user, 2026-11-16):** "the filters window doesn't allow to set
+actions like 'move to spam folder'. It was built before we introduced the
+moves in the code."
+
+**Cause.** Verified: a rule is `(add, remove, query, stage)` in both readers
+(`TagRule` in `src/tagrules.h`, `KNOWN_KEYS` in `assets/hooks/mailrules.py`),
+and the `post-new` hook only ever runs `notmuch tag`. The rules predate items
+103 and 187, which made Delete and Mark spam move files.
+
+**Approach.** `specs/2026-11-16-rule-move-design.md`.
+
+**Constraints.** A rule-format change: both readers, both suites, and the hand
+round trip under "Changing the rule format". The hook would now rename files
+on real mail every ten minutes, and a wrong destination reaches the server
+(item 103), so the destination is an account role, never a folder name.
diff --git a/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md b/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md
index 119f557..262f0c5 100644
--- a/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md
+++ b/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md
@@ -151,7 +151,7 @@ taking that too literally.
| 211 | Archiving thousands of selected rows freezes the window | defect | S | **done** 2026-10-31, unreleased. Cubic optimistic-update path made linear: a lazily rebuilt id index in `ThreadListModel` and `MainWindow::batchModelWrites()` refreshing the action labels once per loop. A write now reads "applying…" until the worker has run it, then "done". Hand-tested on a 10158-message archive |
| 212 | A rule edit reaches only new mail; applying it to the backlog is a hand-typed `notmuch tag` | workflow | M | open, designed: `specs/2026-10-31-rule-apply-and-archive-design.md` Part A. Apply saves, counts what would change, confirms with the count (a new documented exception to the no-confirmation rule), writes through `applyTags` for exact undo |
| 213 | A rule removing `inbox` is skipped whole by the hook, so promo mail arrives untagged | defect | S-M | open, designed: same spec, Part B. Optional per-rule `allow_archive`, both readers, no version bump; `unread` stays refused; the dialog warns about rules the hook will skip |
-| 214 | A rule can tag mail spam but cannot move it to the spam or trash folder | workflow | M | open, designed: `specs/2026-11-16-rule-move-design.md`. Optional `move` field, `spam` or `trash` (an account role, never a folder name), both readers, no version bump; the hook moves on arrival, strips `inbox`, keeps `unread`; Apply (212) inherits it later. First task: verify `notmuch new` can run inside `post-new` |
+| 214 | A rule can tag mail spam but cannot move it to the spam or trash folder | workflow | M | **done** 2026-11-16, unreleased, on `rule-move`. Spec: `specs/2026-11-16-rule-move-design.md`. The nesting assumption held: `notmuch new --no-hooks` runs inside `post-new`. Review fixes: a bad `move` is kept raw rather than dropped (the rule-id lesson), a nested account without the role resolves to itself, and `_quote` doubles quotes (it never matched an id holding one, on the carve-out path too). Section in the closed file. Original note: Optional `move` field, `spam` or `trash` (an account role, never a folder name), both readers, no version bump; the hook moves on arrival, strips `inbox`, keeps `unread`; Apply (212) inherits it later. First task: verify `notmuch new` can run inside `post-new` |
| 73 | This backlog is past four thousand lines | maintenance | S | **done** 2026-08-13; 5056 lines to 578, closed sections moved to `2026-08-03-post-0.1.0-usability-closed.md` |
| 74 | "Searching..." keeps claiming a query is running while rows are already arriving | feedback | XS | **done** 2026-08-15, unreleased. The status-bar half only: the bar now counts threads per batch. The cold-cache delay itself was measured in 2026-08-11 and is not fixable here |
| 75 | The tagging rules window forgets its size and its column widths | persistence | S | **done** 2026-08-13, shipped in 0.17.0. The window-kind question is left open, see the closed-items file |
@@ -1734,21 +1734,3 @@ applied without the removal. The rules dialog says nothing about it.
**Constraints.** A rule-format change: both readers, both suites, and the hand
round trip under "Changing the rule format". The hook runs every ten minutes
on real mail.
-
-## 214. A rule cannot move mail to the spam or trash folder
-
-**Observed (user, 2026-11-16):** "the filters window doesn't allow to set
-actions like 'move to spam folder'. It was built before we introduced the
-moves in the code."
-
-**Cause.** Verified: a rule is `(add, remove, query, stage)` in both readers
-(`TagRule` in `src/tagrules.h`, `KNOWN_KEYS` in `assets/hooks/mailrules.py`),
-and the `post-new` hook only ever runs `notmuch tag`. The rules predate items
-103 and 187, which made Delete and Mark spam move files.
-
-**Approach.** `specs/2026-11-16-rule-move-design.md`.
-
-**Constraints.** A rule-format change: both readers, both suites, and the hand
-round trip under "Changing the rule format". The hook would now rename files
-on real mail every ten minutes, and a wrong destination reaches the server
-(item 103), so the destination is an account role, never a folder name.
diff --git a/docs/superpowers/specs/2026-10-31-rule-apply-and-archive-design.md b/docs/superpowers/specs/2026-10-31-rule-apply-and-archive-design.md
index 247cfd5..6a1af9c 100644
--- a/docs/superpowers/specs/2026-10-31-rule-apply-and-archive-design.md
+++ b/docs/superpowers/specs/2026-10-31-rule-apply-and-archive-design.md
@@ -215,3 +215,11 @@ the user looks at it.
- **Relaxing `unread`.** Nothing asks for it.
- **A dry-run list** of the affected messages. *Preview in list* already shows
which mail a rule collects.
+
+## Addendum, 2026-11-16: rules that move (item 214)
+
+A rule may now carry `"move": "spam" | "trash"`. When Apply is built it must
+honour that field by sending the matched ids through
+`NotmuchWorker::moveMessages()` with the same tags Mark spam / Delete use
+(minus `unread`, matching the hook), so the move lands on the undo stack.
+The count in the confirmation names the move as well as the tag change.
diff --git a/docs/superpowers/specs/2026-11-16-rule-move-design.md b/docs/superpowers/specs/2026-11-16-rule-move-design.md
index 95bac9c..37dd51b 100644
--- a/docs/superpowers/specs/2026-11-16-rule-move-design.md
+++ b/docs/superpowers/specs/2026-11-16-rule-move-design.md
@@ -46,7 +46,10 @@ One optional field on a rule:
- The "adds and removes nothing" check becomes "adds, removes and moves
nothing": a move-only rule is valid.
- An unknown value is an invalid rule in `TagRules::validate()` (the dialog
- cannot write one). The Python reader logs it and ignores the `move` while
+ cannot write one). The C++ reader keeps a bad value from the file RAW in
+ `unknown` and still loads the rule, even when the move was its only action,
+ so a save writes it back rather than deleting it (the rule-id lesson in
+ `AGENTS.md`); a role chosen in the dialog replaces it. The Python reader logs it and ignores the `move` while
still applying the rule's tags, since the tags are harmless and the hook must
never guess a destination.
diff --git a/translations/qtmaildir_it_IT.ts b/translations/qtmaildir_it_IT.ts
index 7a57598..ad833c8 100644
--- a/translations/qtmaildir_it_IT.ts
+++ b/translations/qtmaildir_it_IT.ts
@@ -2333,8 +2333,12 @@ protocollo di rete: il recupero e l'invio sono comandi esterni.
<translation>&apos;%1&apos;: nessuna ricerca</translation>
</message>
<message>
- <source>&apos;%1&apos;: adds and removes nothing</source>
- <translation>&apos;%1&apos;: non aggiunge né rimuove nulla</translation>
+ <source>&apos;%1&apos;: move &apos;%2&apos; is not spam or trash</source>
+ <translation>&apos;%1&apos;: lo spostamento &apos;%2&apos; non è spam né cestino</translation>
+ </message>
+ <message>
+ <source>&apos;%1&apos;: adds, removes and moves nothing</source>
+ <translation>&apos;%1&apos;: non aggiunge, non rimuove e non sposta nulla</translation>
</message>
<message>
<source>Cannot read %1: %2</source>
@@ -2361,8 +2365,12 @@ protocollo di rete: il recupero e l&apos;invio sono comandi esterni.
<translation>Regola &apos;%1&apos;: nessuna ricerca; scartata</translation>
</message>
<message>
- <source>Rule &apos;%1&apos;: adds and removes nothing; dropped</source>
- <translation>Regola &apos;%1&apos;: non aggiunge né rimuove nulla; scartata</translation>
+ <source>Rule &apos;%1&apos;: move &apos;%2&apos; is not spam or trash; ignored</source>
+ <translation>Regola &apos;%1&apos;: lo spostamento &apos;%2&apos; non è spam né cestino; ignorato</translation>
+ </message>
+ <message>
+ <source>Rule &apos;%1&apos;: adds, removes and moves nothing; dropped</source>
+ <translation>Regola &apos;%1&apos;: non aggiunge, non rimuove e non sposta nulla; scartata</translation>
</message>
<message>
<source>The account %1 has no address configured, so no message can be sent from it.</source>
@@ -2721,6 +2729,22 @@ protocollo di rete: il recupero e l&apos;invio sono comandi esterni.
<translation>separate da virgole</translation>
</message>
<message>
+ <source>Don&apos;t move</source>
+ <translation>Non spostare</translation>
+ </message>
+ <message>
+ <source>Spam folder</source>
+ <translation>Cartella spam</translation>
+ </message>
+ <message>
+ <source>Trash folder</source>
+ <translation>Cestino</translation>
+ </message>
+ <message>
+ <source>Moves matching new mail into the spam or trash folder of the account it arrived in, and takes it out of the inbox. It stays unread.</source>
+ <translation>Sposta la posta nuova corrispondente nella cartella spam o nel cestino dell&apos;account in cui è arrivata, e la toglie dalla posta in arrivo. Resta da leggere.</translation>
+ </message>
+ <message>
<source>Name</source>
<translation>Nome</translation>
</message>
@@ -2733,6 +2757,10 @@ protocollo di rete: il recupero e l&apos;invio sono comandi esterni.
<translation>Rimuovi etichette</translation>
</message>
<message>
+ <source>Move to</source>
+ <translation>Sposta in</translation>
+ </message>
+ <message>
<source>Match &amp;all</source>
<translation>Corrispondono &amp;tutte</translation>
</message>