+notmuch_message_t *
+notmuch_database_find_message (notmuch_database_t *notmuch,
+ const char *message_id)
+{
+ Xapian::PostingIterator i, end;
+
+ find_messages_by_term (notmuch->xapian_db,
+ "msgid", message_id, &i, &end);
+
+ if (i == end)
+ return NULL;
+
+ return _notmuch_message_create (notmuch, notmuch, *i);
+}
+