case MAIL_ERROR_LIMIT:
exit_code = DOVEADM_EX_NOTPOSSIBLE;
break;
+ case MAIL_ERROR_LOOKUP_ABORTED:
+ break;
}
/* tempfail overrides all other exit codes, otherwise use whatever
error happened first */
case MAIL_ERROR_NONE:
break;
case MAIL_ERROR_TEMP:
+ case MAIL_ERROR_LOOKUP_ABORTED: /* BUG: shouldn't be visible here */
resp_code = IMAP_RESP_CODE_SERVERBUG;
break;
case MAIL_ERROR_NOTPOSSIBLE:
}
ret = mail_get_virtual_size(mail, &vsize);
if (ret < 0 &&
- mailbox_get_last_mail_error(update->box) == MAIL_ERROR_NOTPOSSIBLE) {
+ mailbox_get_last_mail_error(update->box) == MAIL_ERROR_LOOKUP_ABORTED) {
/* abort and finish on background */
i_assert(mails_left == 0);
case MAIL_ERROR_EXPUNGED:
ctx->mail_ctx.seen_lost_data = TRUE;
break;
- case MAIL_ERROR_NOTPOSSIBLE:
- /* lookup_abort hit */
+ case MAIL_ERROR_LOOKUP_ABORTED:
+ /* expected failure */
break;
default:
search_set_failed(ctx);
switch (mailbox_get_last_mail_error(mail->box)) {
case MAIL_ERROR_EXPUNGED:
break;
- case MAIL_ERROR_NOTPOSSIBLE:
+ case MAIL_ERROR_LOOKUP_ABORTED:
/* just change the error message */
mail_storage_set_error(program->t->box->storage, MAIL_ERROR_LIMIT,
"Requested sort would have taken too long.");
MAIL_ERROR_INVALIDDATA,
/* Operation ran against some kind of a limit. */
MAIL_ERROR_LIMIT,
+ /* Operation couldn't be finished as efficiently as required by
+ mail.lookup_abort. */
+ MAIL_ERROR_LOOKUP_ABORTED,
};
/* Convert errno to mail_error and an error string. Returns TRUE if successful,
void mail_set_aborted(struct mail *mail)
{
- mail_storage_set_error(mail->box->storage, MAIL_ERROR_NOTPOSSIBLE,
+ mail_storage_set_error(mail->box->storage, MAIL_ERROR_LOOKUP_ABORTED,
"Mail field not cached");
}
if (ret == 0)
return 0;
- if (mailbox_get_last_mail_error(mail->box) != MAIL_ERROR_NOTPOSSIBLE)
+ if (mailbox_get_last_mail_error(mail->box) != MAIL_ERROR_LOOKUP_ABORTED)
return -1;
/* virtual size not available with a fast lookup.
if (ret == 0)
return 0;
- if (mailbox_get_last_mail_error(mail->box) != MAIL_ERROR_NOTPOSSIBLE)
+ if (mailbox_get_last_mail_error(mail->box) != MAIL_ERROR_LOOKUP_ABORTED)
return -1;
/* no way to quickly get the size. fallback to doing a slow virtual