Commit 6b16ad04 6b16ad0412988d6473c9b543ee1c15649fb39bb3 by Sergey Poznyakoff

(mail_mbox_commit): Fixed typo. Thanks Matthew Whitworth,

(mail_mbox_close): Do not expunge mailboxes if readonly is set.
Helps in testing mail.
1 parent 0dd8fa2f
......@@ -37,12 +37,15 @@ mail_mbox_close ()
url_t url = NULL;
size_t held_count;
if (mail_mbox_commit ())
return 1;
mailbox_save_attributes (mbox);
mailbox_expunge (mbox);
if (!util_find_env ("readonly")->set)
{
if (mail_mbox_commit ())
return 1;
mailbox_save_attributes (mbox);
mailbox_expunge (mbox);
}
mailbox_get_url (mbox, &url);
mailbox_messages_count (mbox, &held_count);
fprintf (ofile, "Held %d messages in %s\n", held_count, url_to_string (url));
......@@ -72,7 +75,7 @@ mail_mbox_commit ()
mailbox_t mb;
url_t u;
mailbox_create_default (&mb, NULL);
mailbox_get_url (mbox, &u);
mailbox_get_url (mb, &u);
if (strcmp (url_to_string (u), url_to_string (url)) != 0)
{
/* The mailbox we are closing is not a system one (%). Raise
......