Skip to content

Commit

Permalink
imapc: If FETCH didn't send our wanted data, log the tagged FETCH rep…
Browse files Browse the repository at this point in the history
…ly text.
  • Loading branch information
sirainen committed Jan 28, 2016
1 parent 740e369 commit 14fb3a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/lib-storage/index/imapc/imapc-mail-fetch.c
Expand Up @@ -21,6 +21,8 @@ static void imapc_mail_set_failure(struct imapc_mail *mail,
struct imapc_mailbox *mbox =
(struct imapc_mailbox *)mail->imail.mail.mail.box;

mail->last_fetch_reply = p_strdup(mail->imail.mail.pool, reply->text_full);

switch (reply->state) {
case IMAPC_COMMAND_STATE_OK:
break;
Expand Down
5 changes: 3 additions & 2 deletions src/lib-storage/index/imapc/imapc-mail.c
Expand Up @@ -84,9 +84,10 @@ static int imapc_mail_failed(struct mail *mail, const char *field)
*/
fix_broken_mail = imail->fetch_ignore_if_missing;
mail_storage_set_critical(mail->box->storage,
"imapc: Remote server didn't send %s for UID %u in %s%s",
"imapc: Remote server didn't send %s for UID %u in %s%s (FETCH replied: %s)",
field, mail->uid, mail->box->vname,
fix_broken_mail ? " - treating it as empty" : "");
fix_broken_mail ? " - treating it as empty" : "",
imail->last_fetch_reply);
}
return fix_broken_mail ? 0 : -1;
}
Expand Down
1 change: 1 addition & 0 deletions src/lib-storage/index/imapc/imapc-mail.h
Expand Up @@ -14,6 +14,7 @@ struct imapc_mail {
const char *const *fetching_headers;
unsigned int fetch_count;
bool fetch_sent;
const char *last_fetch_reply;

int fd;
buffer_t *body;
Expand Down

0 comments on commit 14fb3a2

Please sign in to comment.