diff options
author | Austin Clements <amdragon@MIT.EDU> | 2012-11-25 01:16:01 -0500 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2012-11-26 21:12:10 -0400 |
commit | 610f0e09929a5f351f7c1c3850ac7e0d83ffe388 (patch) | |
tree | 18dfd7072c95710d5f644808f06c486f71bc360e /lib/database.cc | |
parent | 079f5a138b685bb33bee86c0ed5b8d17f58b09af (diff) |
lib: Reject multi-message mboxes and deprecate single-message mbox
Previously, we would treat multi-message mboxes as one giant email,
which, besides the obvious incorrect indexing, often led to
out-of-memory errors for archival mboxes. Now we explicitly reject
multi-message mboxes. For historical reasons, we retain support for
single-message mboxes, but official deprecate this behavior.
Diffstat (limited to 'lib/database.cc')
-rw-r--r-- | lib/database.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/database.cc b/lib/database.cc index 4df32173..91d43298 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -1821,7 +1821,9 @@ 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); - _notmuch_message_index_file (message, filename); + ret = _notmuch_message_index_file (message, filename); + if (ret) + goto DONE; } else { ret = NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID; } |