unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Duplicate message ids  
@ 2017-08-27  9:45 Mark Walters
  2017-08-27 13:19 ` [PATCH] test: check for subject consistency between search and show David Bremner
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Walters @ 2017-08-27  9:45 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 756 bytes --]


Hi

A concern for notmuch is some form of attack via someone sending a
message with a duplicate message id. I think I have seen it asserted
that it is not so much of a problem as the first message received by
notmuch will have priority.

However, I believe that this is not the case. The script below gives a
demonstration (on my system at least). I have written it as a "test" so
(I hope) it doesn't mess up the system. It should work if you put it in
the test directory and execute it.

It adds a message, runs notmuch new, adds a message with the same id,
runs notmuch new, and then runs notmuch search <id> and notmuch show
<id>. The former shows the subject of the first message, and the latter
the subject of the second message.

Best wishes

Mark


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: T710-duplicate-id.sh --]
[-- Type: text/x-sh, Size: 602 bytes --]

#!/usr/bin/env bash
test_description='Do duplicate message ids get shown in arrival order'
. ./test-lib.sh || exit 1


find ${MAIL_DIR}
generate_message [id]=duplicate-id [subject]=first [body]=first
mkdir "${MAIL_DIR}"/b
mv "$gen_msg_filename" "${MAIL_DIR}"/b
notmuch new
generate_message [id]=duplicate-id [subject]=second [body]=second
mv "$gen_msg_filename" "${MAIL_DIR}"/a
notmuch new
find ${MAIL_DIR}

echo
echo SEARCH: observe \"first\" is the subject
notmuch search id:duplicate-id

echo
echo SHOW: observe \"second\" is the subject and body
notmuch show --format=json id:duplicate-id |json_pp

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-09-06  1:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-27  9:45 Duplicate message ids Mark Walters
2017-08-27 13:19 ` [PATCH] test: check for subject consistency between search and show David Bremner
2017-08-27 18:48   ` [PATCH] test: duplicate mids: add an extra broken search test Mark Walters
2017-08-27 23:58     ` [PATCH 1/5] test: make fallback to duplicate test more robust David Bremner
2017-08-27 23:58       ` [PATCH 2/5] test/duplicate-mid: clarify index order vs filename order David Bremner
2017-08-27 23:58       ` [PATCH 3/5] test: known broken test for subject after reindexing David Bremner
2017-08-27 23:58       ` [PATCH 4/5] lib: enforce that n_message_reindex takes headers from first file David Bremner
2017-08-27 23:58       ` [PATCH 5/5] test/duplicate-mid: check for subject with notmuch-show David Bremner
2017-09-06  1:29       ` [PATCH 1/5] test: make fallback to duplicate test more robust David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).