while (rc == IMAP_CMD_CONTINUE);
if (rc != IMAP_CMD_RESPOND)
- {
- char *pc;
-
- dprint (1, (debugfile, "imap_append_message(): command failed: %s\n",
- idata->buf));
-
- pc = idata->buf + SEQLEN;
- SKIPWS (pc);
- pc = imap_next_word (pc);
- mutt_error ("%s", pc);
- mutt_sleep (1);
- goto fail;
- }
+ goto cmd_step_fail;
for (last = EOF, sent = len = 0; (c = fgetc(fp)) != EOF; last = c)
{
while (rc == IMAP_CMD_CONTINUE);
if (rc != IMAP_CMD_OK)
+ goto cmd_step_fail;
+
+ FREE (&mx.mbox);
+ return 0;
+
+cmd_step_fail:
+ dprint (1, (debugfile, "imap_append_message(): command failed: %s\n",
+ idata->buf));
+ if (rc != IMAP_CMD_BAD)
{
char *pc;
- dprint (1, (debugfile, "imap_append_message(): command failed: %s\n",
- idata->buf));
- pc = idata->buf + SEQLEN;
- SKIPWS (pc);
- pc = imap_next_word (pc);
- mutt_error ("%s", pc);
- mutt_sleep (1);
- goto fail;
+ pc = imap_next_word (idata->buf); /* skip sequence number or token */
+ pc = imap_next_word (pc); /* skip response code */
+ if (*pc)
+ {
+ mutt_error ("%s", pc);
+ mutt_sleep (1);
+ }
}
- FREE (&mx.mbox);
- return 0;
-
fail:
safe_fclose (&fp);
FREE (&mx.mbox);