aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_signatures.cpp
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-25 17:22:35 +0200
committerDanilo M. <danix@danix.xyz>2026-08-25 17:22:35 +0200
commit6ea6980d064d1a27470b077c17adab286e4510b1 (patch)
tree7a23b2c9b1da1b48272e494a1522e614e63c3f67 /tests/test_signatures.cpp
parenta46d28f940e58cf4c829ef7fc269dc2d22dea24a (diff)
downloadqtmaildir-6ea6980d064d1a27470b077c17adab286e4510b1.tar.gz
qtmaildir-6ea6980d064d1a27470b077c17adab286e4510b1.zip
fix(hooks): keep inbox on mail that was sent AND received
notmuch deduplicates by Message-ID, so mail the user sends to another of their own accounts is one message with two files: the sender's Sent copy and the recipient's Inbox copy. The carve-out matched on a file's path and tagged the message, so matching the Sent copy stripped inbox from the copy that had genuinely arrived and the mail was missing from the account that received it. sent_only() keeps a message only when EVERY file is inside a sent folder, which is what the docstring already claimed the predicate did. It is a loop because no query can express it: measured against a two-file message, `not path:` does not exclude it, and `count --output=files` reports every file of every matching message rather than the files that matched. Both read as if they worked, and are wrong for the same reason, that a notmuch term is a predicate over a message while this distinction is between its files. The root comes from database.mail_root rather than database.path, since this index is split and no message file is under the index directory. A test fixture with the index outside the mail root covers it; the ordinary layout cannot, because both keys return the same string there. Both mutations fail: all->any loses inbox on the self-addressed message, mail_root->path silently stops stripping anything. Verified read-only against the live index, tagging nothing: of 807 messages matching a sent path, 780 are still stripped and 27 are spared, every one of them two files with one in another account's inbox. No arrival is affected. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HFuRPtzFrSxCQjFk6tq7gD
Diffstat (limited to 'tests/test_signatures.cpp')
0 files changed, 0 insertions, 0 deletions