dovecot-2.1: lib-lda: Added %e / %{from_envelope} variable to de...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jan 18 16:52:37 EET 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/08cc9d2a79e6
changeset: 13948:08cc9d2a79e6
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jan 18 16:52:14 2012 +0200
description:
lib-lda: Added %e / %{from_envelope} variable to deliver_log_format.

diffstat:

 src/lib-lda/mail-deliver.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 7ee2cfbcae2e -r 08cc9d2a79e6 src/lib-lda/mail-deliver.c
--- a/src/lib-lda/mail-deliver.c	Wed Jan 18 16:51:22 2012 +0200
+++ b/src/lib-lda/mail-deliver.c	Wed Jan 18 16:52:14 2012 +0200
@@ -46,11 +46,13 @@
 		{ 'm', NULL, "msgid" },
 		{ 's', NULL, "subject" },
 		{ 'f', NULL, "from" },
+		{ 'e', NULL, "from_envelope" },
 		{ 'p', NULL, "size" },
 		{ 'w', NULL, "vsize" },
 		{ '\0', NULL, NULL }
 	};
 	struct var_expand_table *tab;
+	const char *str;
 	uoff_t size;
 
 	tab = t_malloc(sizeof(static_tab));
@@ -65,10 +67,14 @@
 	tab[2].value = str_sanitize(tab[2].value, 80);
 	tab[3].value = str_sanitize(mail_deliver_get_address(mail, "From"), 80);
 
+	if (mail_get_special(mail, MAIL_FETCH_FROM_ENVELOPE, &str) < 0)
+		str = "";
+	tab[4].value = str_sanitize(str, 80);
+
 	if (mail_get_physical_size(mail, &size) == 0)
-		tab[4].value = dec2str(size);
+		tab[5].value = dec2str(size);
 	if (mail_get_virtual_size(mail, &size) == 0)
-		tab[5].value = dec2str(size);
+		tab[6].value = dec2str(size);
 	return tab;
 }
 


More information about the dovecot-cvs mailing list