]> granicus.if.org Git - neomutt/commit
notmuch: ensure message_id is correct 1797/head
authorAustin Ray <austin@austinray.io>
Sat, 3 Aug 2019 20:34:32 +0000 (16:34 -0400)
committerRichard Russon <rich@flatcap.org>
Mon, 5 Aug 2019 09:17:52 +0000 (10:17 +0100)
commit32aec0c46fd16a6d7fb5537cb60870bd29314125
tree49cd94d8f0f2fb1d397279a365b45ccdb961f0e0
parent55392f6c7c8ca4b40e16ce6fed1944f20d322c19
notmuch: ensure message_id is correct

The notmuch-backend initializes a provided email struct with content
from notmuch. In rare instances, a provided email struct has a
message_id that does not match the one from notmuch. No validation to
ensure message_ids match is performed.

An issue occurs when running nm_mbox_check(), which stores all messages
in a hash table. The incorrect message_id is the key so our email is
considered missing, reloaded into the mailbox, and a duplicate appears
in the index. This triggers a warning from neomutt regarding external
modification.

Instead, validate the message_ids to ensure a match so our hash table
keys are correct. As a result, a reload is no longer performed and
neomutt's warning need not occur.

Fixes #1793
notmuch/mutt_notmuch.c