Commit 58cf1c6b 58cf1c6bdbdbfd26816211b594a1954a117fc460 by Sergey Poznyakoff

Use mailbox_flush before closing the mailbox

1 parent 74f306ab
......@@ -34,7 +34,7 @@ imap4d_bye0 (int reason, struct imap4d_command *command)
if (mbox)
{
mailbox_save_attributes (mbox);
mailbox_flush (mbox, 0);
mailbox_close (mbox);
mailbox_destroy (&mbox);
}
......@@ -48,7 +48,7 @@ imap4d_bye0 (int reason, struct imap4d_command *command)
case ERR_SIGNAL:
if (ofile)
util_out (RESP_BYE, "Quitting on signal");
util_out (RESP_BYE, "Quitting on signal");
syslog (LOG_ERR, "Quitting on signal");
break;
......
......@@ -30,7 +30,7 @@ imap4d_close (struct imap4d_command *command, char *arg)
/* The CLOSE command permanently removes from the currently selected
mailbox all messages that have the \\Deleted flag set, and returns
to authenticated state from selected state. */
mailbox_expunge (mbox);
mailbox_flush (mbox, 1);
/* No messages are removed, and no error is give, if the mailbox is
selected by an EXAMINE command or is otherwise selected read-only. */
mailbox_close (mbox);
......
......@@ -42,8 +42,7 @@ mail_mbox_close ()
if (mail_mbox_commit ())
return 1;
mailbox_save_attributes (mbox);
mailbox_expunge (mbox);
mailbox_flush (mbox, 1);
}
mailbox_get_url (mbox, &url);
......@@ -69,7 +68,7 @@ mail_mbox_commit ()
int is_user_mbox;
mailbox_get_url (mbox, &url);
is_user_mbox = strcmp (url_to_string (url), getenv("MBOX")) == 0;
is_user_mbox = strcmp (url_to_string (url), getenv ("MBOX")) == 0;
{
mailbox_t mb;
......
......@@ -33,7 +33,7 @@ pop3d_quit (const char *arg)
if (state == TRANSACTION)
{
pop3d_unlock ();
if (mailbox_expunge (mbox) != 0)
if (mailbox_flush (mbox, 1) != 0)
err = ERR_FILE;
if (mailbox_close (mbox) != 0)
err = ERR_FILE;
......