]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dbox: Don't set dbox file corrupted twice
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 20 Jun 2023 20:34:14 +0000 (23:34 +0300)
committermarkus.valentin <markus.valentin@open-xchange.com>
Wed, 21 Jun 2023 12:51:59 +0000 (12:51 +0000)
The file is set to be corrupted immediately when dbox file reading detects
corruption, which causes the code path to return 0. This can happen all over
the place.

src/lib-storage/index/dbox-common/dbox-mail.c

index 0e9696c302cc3190ecb3c42efcb23bf4de6ecd07..088cfc6609b8d153bc26179cd8609d852d0c8718 100644 (file)
@@ -299,11 +299,6 @@ int dbox_mail_get_stream(struct mail *_mail, bool get_body ATTR_UNUSED,
 
                ret = get_mail_stream(mail, offset, &input);
                if (ret <= 0) {
-                       if (ret < 0)
-                               return -1;
-                       dbox_file_set_corrupted(mail->open_file,
-                               "uid=%u points to broken data at offset="
-                               "%"PRIuUOFF_T, _mail->uid, offset);
                        i_stream_unref(&input);
                        return -1;
                }