]> git.notmuchmail.org Git - notmuch/commitdiff
add_message: Properly handle missing Message-ID once again.
authorCarl Worth <cworth@cworth.org>
Fri, 20 Nov 2009 18:31:00 +0000 (19:31 +0100)
committerCarl Worth <cworth@cworth.org>
Fri, 20 Nov 2009 18:36:01 +0000 (19:36 +0100)
There's been a fair amount of fallout from when we changed
message_file_get_header from returning NULL to returning "" for
missing headers. This is yet more fallout from that, (where we were
accepting an empty message-ID rather than generating one like we want
to).

lib/database.cc

index 726c5a98a02b1e153358c0daff820dac8cac3cc3..294247e22cf938526abd041d9411509707ffa651 100644 (file)
@@ -908,7 +908,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch,
         * is to find a message ID (or else create one ourselves). */
 
        header = notmuch_message_file_get_header (message_file, "message-id");
         * is to find a message ID (or else create one ourselves). */
 
        header = notmuch_message_file_get_header (message_file, "message-id");
-       if (header) {
+       if (header && *header != '\0') {
            message_id = _parse_message_id (message_file, header, NULL);
            /* So the header value isn't RFC-compliant, but it's
             * better than no message-id at all. */
            message_id = _parse_message_id (message_file, header, NULL);
            /* So the header value isn't RFC-compliant, but it's
             * better than no message-id at all. */