X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fdatabase.cc;h=1efb14d4a0bdc2327a366870069867ba392ad1aa;hp=aef748f75b5d61ca6f2f34c35a2af93d0bd81f70;hb=473930bb6fb167078a9428ad85f53accf7d4559f;hpb=6812136bf576d894591606d9e10096719054d1f9 diff --git a/lib/database.cc b/lib/database.cc index aef748f7..1efb14d4 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -1971,15 +1971,10 @@ notmuch_database_add_message (notmuch_database_t *notmuch, if (ret) goto DONE; - notmuch_message_file_restrict_headers (message_file, - "date", - "from", - "in-reply-to", - "message-id", - "references", - "subject", - "to", - (char *) NULL); + /* Parse message up front to get better error status. */ + ret = _notmuch_message_file_parse (message_file); + if (ret) + goto DONE; try { /* Before we do any real work, (especially before doing a @@ -2066,7 +2061,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch, date = notmuch_message_file_get_header (message_file, "date"); _notmuch_message_set_header_values (message, date, from, subject); - ret = _notmuch_message_index_file (message, filename); + ret = _notmuch_message_index_file (message, message_file); if (ret) goto DONE; } else {