--- deliver.c.rc7+ 2006-09-25 10:36:59.885645000 +0100 +++ deliver.c 2006-10-04 18:01:31.910181000 +0100 @@ -103,12 +103,15 @@ struct mailbox *box; struct mailbox_transaction_context *t; struct mail_keywords *kw; + const char *str; int ret = 0; box = mailbox_open_or_create_synced(storage, mailbox); if (box == NULL) return -1; + str = mail_get_first_header(mail, "Message-ID"); + t = mailbox_transaction_begin(box, MAILBOX_TRANSACTION_FLAG_EXTERNAL); kw = strarray_length(keywords) == 0 ? NULL : @@ -117,10 +120,14 @@ ret = -1; mailbox_keywords_free(t, &kw); - if (ret < 0) + if (ret < 0) { + i_info("failed to deliver msgid=%s to %s", str, mailbox); mailbox_transaction_rollback(&t); - else + } + else { + i_info("delivered msgid=%s to %s", str, mailbox); ret = mailbox_transaction_commit(&t, 0); + } mailbox_close(&box); return ret;