]> git.notmuchmail.org Git - notmuch/blobdiff - database.cc
Don't forget the "to" header when restrict parsing to certain headers
[notmuch] / database.cc
index 578dce4b70c2d1740bb57f5c34a6f4a7b0c10214..2fc783e74e689a50f286be50afe6368a4ed93720 100644 (file)
@@ -502,6 +502,10 @@ notmuch_database_add_message (notmuch_database_t *notmuch,
     unsigned int i;
 
     message = notmuch_message_file_open (filename);
+    if (message == NULL) {
+       ret = NOTMUCH_STATUS_FILE_ERROR;
+       goto DONE;
+    }
 
     notmuch_message_file_restrict_headers (message,
                                           "date",
@@ -510,6 +514,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch,
                                           "message-id",
                                           "references",
                                           "subject",
+                                          "to",
                                           (char *) NULL);
 
     try {