From: Timo Sirainen Date: Thu, 1 Jul 2010 15:38:12 +0000 (+0100) Subject: dsync: Log an error if saving mail fails (e.g. because of quota) X-Git-Tag: 2.0.rc1~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7c94057a7247b12c824c5a984390c8e438928fca;p=thirdparty%2Fdovecot%2Fcore.git dsync: Log an error if saving mail fails (e.g. because of quota) --HG-- branch : HEAD --- diff --git a/src/dsync/dsync-worker-local.c b/src/dsync/dsync-worker-local.c index c003100192..ec5fe2b4f9 100644 --- a/src/dsync/dsync-worker-local.c +++ b/src/dsync/dsync-worker-local.c @@ -1490,6 +1490,7 @@ static void dsync_worker_try_finish(struct local_dsync_worker *worker) 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 @@ local_worker_save_msg_continue(struct local_dsync_worker *worker) 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 @@ local_worker_msg_save(struct dsync_worker *_worker, { 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 @@ local_worker_msg_save(struct dsync_worker *_worker, 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; }