dovecot-2.0: If read() from a mail stream fails, log the stream ...
dovecot at dovecot.org
dovecot at dovecot.org
Mon May 31 17:13:02 EEST 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/e5b491043b5e
changeset: 11428:e5b491043b5e
user: Timo Sirainen <tss at iki.fi>
date: Mon May 31 15:12:57 2010 +0100
description:
If read() from a mail stream fails, log the stream name (filename typically).
diffstat:
src/imap/imap-fetch-body.c | 7 ++++---
src/lib-storage/index/index-mail.c | 3 ++-
2 files changed, 6 insertions(+), 4 deletions(-)
diffs (37 lines):
diff -r 4faaf5b037d5 -r e5b491043b5e src/imap/imap-fetch-body.c
--- a/src/imap/imap-fetch-body.c Fri May 28 18:30:55 2010 +0100
+++ b/src/imap/imap-fetch-body.c Mon May 31 15:12:57 2010 +0100
@@ -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 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 -r 4faaf5b037d5 -r e5b491043b5e src/lib-storage/index/index-mail.c
--- a/src/lib-storage/index/index-mail.c Fri May 28 18:30:55 2010 +0100
+++ b/src/lib-storage/index/index-mail.c Mon May 31 15:12:57 2010 +0100
@@ -757,7 +757,8 @@
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;
}
More information about the dovecot-cvs
mailing list