CTX_DATA->status = 0;
int imap_sync_mailbox (CONTEXT *ctx){  char seq[8];  char buf[LONG_STRING];  char tmp[LONG_STRING];  int n;  /* save status changes */  for (n = 0; n < ctx->msgcount; n++)  {    if (ctx->hdrs[n]->deleted || ctx->hdrs[n]->changed)    {      snprintf (tmp, sizeof (tmp), _("Saving message status flags... [%d/%d]"),	n+1, ctx->msgcount);      mutt_message (tmp);      *tmp = 0;      if (ctx->hdrs[n]->read)	strcat (tmp, "\\Seen ");      if (ctx->hdrs[n]->flagged)	strcat (tmp, "\\Flagged ");      if (ctx->hdrs[n]->replied)	strcat (tmp, "\\Answered ");      if (ctx->hdrs[n]->deleted)        strcat (tmp, "\\Deleted");      mutt_remove_trailing_ws (tmp);      if (!*tmp) continue; /* imapd doesn't like empty flags. */      imap_make_sequence (seq, sizeof (seq));      snprintf (buf, sizeof (buf), "%s STORE %d FLAGS.SILENT (%s)\r\n", seq,       	ctx->hdrs[n]->index + 1, tmp);      if (imap_exec (buf, sizeof (buf), CTX_DATA, seq, buf, 0) != 0)      {	imap_error ("imap_sync_mailbox()", buf);	return (-1);      }    }  }  mutt_message _("Expunging messages from server...");  CTX_DATA->status = IMAP_EXPUNGE;  imap_make_sequence (seq, sizeof (seq));  snprintf (buf, sizeof (buf), "%s EXPUNGE\r\n", seq);  if (imap_exec (buf, sizeof (buf), CTX_DATA, seq, buf, 0) != 0)  {    imap_error ("imap_sync_mailbox()", buf);    return (-1);  }  CTX_DATA->status = 0;  for (n = 0; n < IMAP_CACHE_LEN; n++)  {    if (CTX_DATA->cache[n].path)    {      unlink (CTX_DATA->cache[n].path);      safe_free ((void **) &CTX_DATA->cache[n].path);    }  }  return 0;}