ctx->hdrs = safe_malloc (count * sizeof (HEADER *));
ctx->v2r = safe_malloc (count * sizeof (int));
ctx->msgcount = 0;
- count = imap_read_headers (idata, 0, count - 1) + 1;
+ if (imap_read_headers (idata, 0, count - 1) < 0)
+ {
+ mutt_error _("Error opening mailbox");
+ mutt_sleep (1);
+ goto fail;
+ }
dprint (2, (debugfile, "imap_open_mailbox: msgcount is %d\n", ctx->msgcount));
FREE (&mx.mbox);
* as they come in. */
mutt_mktemp (tempfile);
if (!(fp = safe_fopen (tempfile, "w+")))
+ {
+ mutt_error (_("Could not create temporary file %s"), tempfile);
+ mutt_sleep (2);
return -1;
+ }
unlink (tempfile);
/* make sure context has room to hold the mailbox */