dovecot-2.0: dsync: Log an error if saving mail fails (e.g. beca...
dovecot at dovecot.org
dovecot at dovecot.org
Thu Jul 1 18:38:15 EEST 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/f319af83ae36
changeset: 11675:f319af83ae36
user: Timo Sirainen <tss at iki.fi>
date: Thu Jul 01 16:38:12 2010 +0100
description:
dsync: Log an error if saving mail fails (e.g. because of quota)
diffstat:
src/dsync/dsync-worker-local.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diffs (45 lines):
diff -r 220e7b0f03c2 -r f319af83ae36 src/dsync/dsync-worker-local.c
--- a/src/dsync/dsync-worker-local.c Thu Jul 01 16:31:37 2010 +0100
+++ b/src/dsync/dsync-worker-local.c Thu Jul 01 16:38:12 2010 +0100
@@ -1490,6 +1490,7 @@
static void
local_worker_save_msg_continue(struct local_dsync_worker *worker)
{
+ struct mailbox *dest_box = worker->ext_mail->box;
int ret;
while ((ret = i_stream_read(worker->save_input)) > 0) {
@@ -1519,8 +1520,13 @@
i_assert(worker->save_input->eof);
ret = mailbox_save_finish(&worker->save_ctx);
}
- if (ret < 0)
+ if (ret < 0) {
+ struct mail_storage *storage = mailbox_get_storage(dest_box);
+ i_error("Can't save message to mailbox %s: %s",
+ mailbox_get_vname(dest_box),
+ mail_storage_get_last_error(storage, NULL));
dsync_worker_set_failure(&worker->worker);
+ }
i_stream_unref(&worker->save_input);
dsync_worker_try_finish(worker);
}
@@ -1532,6 +1538,7 @@
{
struct local_dsync_worker *worker =
(struct local_dsync_worker *)_worker;
+ struct mailbox *dest_box = worker->ext_mail->box;
struct mail_save_context *save_ctx;
i_assert(worker->save_input == NULL);
@@ -1545,6 +1552,10 @@
mailbox_save_set_received_date(save_ctx, data->received_date, 0);
if (mailbox_save_begin(&save_ctx, data->input) < 0) {
+ struct mail_storage *storage = mailbox_get_storage(dest_box);
+ i_error("Can't save message to mailbox %s: %s",
+ mailbox_get_vname(dest_box),
+ mail_storage_get_last_error(storage, NULL));
dsync_worker_set_failure(_worker);
return;
}
More information about the dovecot-cvs
mailing list