From: Timo Sirainen Date: Mon, 31 May 2010 14:12:57 +0000 (+0100) Subject: If read() from a mail stream fails, log the stream name (filename typically). X-Git-Tag: 2.0.beta6~102 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2c744723c2ff9cb4d848c241fed682de4d35fe01;p=thirdparty%2Fdovecot%2Fcore.git If read() from a mail stream fails, log the stream name (filename typically). --HG-- branch : HEAD --- diff --git a/src/imap/imap-fetch-body.c b/src/imap/imap-fetch-body.c index 94ba0b8420..6882cfbaa5 100644 --- a/src/imap/imap-fetch-body.c +++ b/src/imap/imap-fetch-body.c @@ -9,7 +9,7 @@ #include "istream-header-filter.h" #include "message-parser.h" #include "message-send.h" -#include "mail-storage.h" +#include "mail-storage-private.h" #include "imap-parser.h" #include "imap-fetch.h" @@ -46,8 +46,9 @@ static struct partial_cache last_partial = { 0, 0, 0, 0, { 0, 0, 0 } }; static void fetch_read_error(struct imap_fetch_context *ctx) { errno = ctx->cur_input->stream_errno; - i_error("FETCH for mailbox %s UID %u " - "failed to read message input: %m", + mail_storage_set_critical(ctx->box->storage, + "read(%s) failed: %m (FETCH for mailbox %s UID %u)", + i_stream_get_name(ctx->cur_input), mailbox_get_vname(ctx->mail->box), ctx->mail->uid); } diff --git a/src/lib-storage/index/index-mail.c b/src/lib-storage/index/index-mail.c index 6b8ec8cd31..0f2f1735e2 100644 --- a/src/lib-storage/index/index-mail.c +++ b/src/lib-storage/index/index-mail.c @@ -757,7 +757,8 @@ static int index_mail_stream_check_failure(struct index_mail *mail) errno = mail->data.stream->stream_errno; mail_storage_set_critical(mail->mail.mail.box->storage, - "read(mail, uid=%u) failed: %m", mail->mail.mail.uid); + "read(%s) failed: %m (uid=%u)", + i_stream_get_name(mail->data.stream), mail->mail.mail.uid); return -1; }