[evolution-data-server] Try to RC2047-decode address-only string when parsing email addresses



commit 68cacfcb108c40932d6f776dd217d57c8335bb96
Author: Milan Crha <mcrha redhat com>
Date:   Wed Mar 7 08:28:31 2012 +0100

    Try to RC2047-decode address-only string when parsing email addresses
    
    This is for cases when email address consists only of an encoded string,
    with no SMTP part. That way the encoded string was treated as email address
    and is never decoded, which was shown in the UI.

 camel/camel-mime-utils.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index f848823..8c42d4c 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -2760,6 +2760,18 @@ header_decode_mailbox (const gchar **in,
 			addr = out;
 		}
 
+		if (!name) {
+			gchar *text;
+
+			text = rfc2047_decode_word (addr->str, addr->len, charset);
+			if (text) {
+				g_string_truncate (addr, 0);
+				g_string_append (addr, text);
+				g_free (text);
+			}
+
+		}
+
 		address = camel_header_address_new_name(name ? name->str : "", addr->str);
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]