dovecot-2.1: mail-log: Log all mail deliveries with "save" event...

dovecot at dovecot.org dovecot at dovecot.org
Fri Jan 6 15:24:04 EET 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/e749d3171acd
changeset: 13898:e749d3171acd
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jan 06 15:23:53 2012 +0200
description:
mail-log: Log all mail deliveries with "save" event, even if it happened via copying.

diffstat:

 src/plugins/mail-log/mail-log-plugin.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (25 lines):

diff -r dfe7158a48ff -r e749d3171acd src/plugins/mail-log/mail-log-plugin.c
--- a/src/plugins/mail-log/mail-log-plugin.c	Fri Jan 06 15:23:12 2012 +0200
+++ b/src/plugins/mail-log/mail-log-plugin.c	Fri Jan 06 15:23:53 2012 +0200
@@ -360,15 +360,17 @@
 		(struct mail_log_mail_txn_context *)txn;
 	const char *desc;
 
-	if (strcmp(src->box->storage->name, "raw") == 0) {
-		/* special case: lda/lmtp is saving a mail */
-		desc = "save";
+	if (dst->saving) {
+		/* we came from mailbox_save_using_mail() */
+		mail_log_append_mail_message(ctx, dst,
+					     MAIL_LOG_EVENT_SAVE, "save");
 	} else {
 		desc = t_strdup_printf("copy from %s",
 				       str_sanitize(mailbox_get_name(src->box),
 						    MAILBOX_NAME_LOG_LEN));
+		mail_log_append_mail_message(ctx, dst,
+					     MAIL_LOG_EVENT_COPY, desc);
 	}
-	mail_log_append_mail_message(ctx, dst, MAIL_LOG_EVENT_COPY, desc);
 }
 
 static void mail_log_mail_expunge(void *txn, struct mail *mail)


More information about the dovecot-cvs mailing list