]> git.pond.sub.org Git - empserver/commitdiff
Change read and wire to never delete a corrupt mailbox
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 23 Nov 2011 19:24:51 +0000 (20:24 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 29 Dec 2011 10:47:07 +0000 (11:47 +0100)
Before, rea() deleted the mailbox regardless of errors.  Acceptable
only when the user gets a chance to avoid that after the problem is
reported.  Not the case for "read y".

Not an issue for announcements, but treat them the same for
simplicity.

src/lib/commands/rea.c

index 94ba14d4218104fa0361bb5a0fb684cd4d85b1cf..c4693db61ea5bb94ee7fdd0e1d14c3480c2acbaa 100644 (file)
@@ -68,7 +68,7 @@ rea(void)
     time_t now;
     time_t then;
     time_t delta;
-    int may_delete = 1; /* may messages be deleted? */
+    int may_delete = 1;
 
     now = time(NULL);
 
@@ -129,8 +129,10 @@ rea(void)
        if (res < 0)
            break;
     }
-    if (res < 0)
+    if (res < 0) {
        pr("\n> Mailbox corrupt, tell the deity.\n");
+       may_delete = 0;
+    }
 
     if (*kind == 'a')
        np->nat_ann = 0;