dovecot-2.2: lib-imap: ENVELOPE parsing/writing no longer strips...

dovecot at dovecot.org dovecot at dovecot.org
Wed Oct 24 11:30:22 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/c849ae6603f2
changeset: 15249:c849ae6603f2
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Oct 24 11:28:38 2012 +0300
description:
lib-imap: ENVELOPE parsing/writing no longer strips whitespace from machine readable fields.

diffstat:

 src/lib-imap/imap-envelope.c |  20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diffs (40 lines):

diff -r cb143b430787 -r c849ae6603f2 src/lib-imap/imap-envelope.c
--- a/src/lib-imap/imap-envelope.c	Wed Oct 24 11:22:28 2012 +0300
+++ b/src/lib-imap/imap-envelope.c	Wed Oct 24 11:28:38 2012 +0300
@@ -147,11 +147,17 @@
 		*addr_p = message_address_parse(pool, hdr->full_value,
 						hdr->full_value_len,
 						(unsigned int)-1, TRUE);
-	}
+	} else if (str_p != NULL) {
+		if (str_p != &d->subject) {
+			string_t *str = t_str_new(128);
 
-	if (str_p != NULL) {
-		*str_p = imap_quote(pool, hdr->full_value,
-				    hdr->full_value_len, TRUE);
+			imap_append_string(str,
+				t_strndup(hdr->full_value, hdr->full_value_len));
+			*str_p = p_strdup(pool, str_c(str));
+		} else {
+			*str_p = imap_quote(pool, hdr->full_value,
+					    hdr->full_value_len, TRUE);
+		}
 	}
 }
 
@@ -167,11 +173,11 @@
 		str_append_c(str, '(');
 		imap_quote_append_string(str, addr->name, TRUE);
 		str_append_c(str, ' ');
-		imap_quote_append_string(str, addr->route, TRUE);
+		imap_append_nstring(str, addr->route);
 		str_append_c(str, ' ');
-		imap_quote_append_string(str, addr->mailbox, TRUE);
+		imap_append_nstring(str, addr->mailbox);
 		str_append_c(str, ' ');
-		imap_quote_append_string(str, addr->domain, TRUE);
+		imap_append_nstring(str, addr->domain);
 		str_append_c(str, ')');
 
 		addr = addr->next;


More information about the dovecot-cvs mailing list