Re: Review request: Message reply fix for MfE



Hello all,
Sergio,
I attached the updated according to your comments patch, please, review it.

Thank you,
Alexander

Alexander Chumakov wrote:
Hello all,
Please, review the attached patch and integrate it if it looks fine.
Here is some info:
1) Baseline code location:
URL: http://git.gitorious.org/tinymail/tinymail.git
Branch: tinymail-1-2
Commit: 5ad7626d4119f1d045941425b0873aa36190458c

2) Fixed bug: 158769 - Edited response not delivered for an Accepted meeting request;
Link: https://projects.maemo.org/bugzilla/show_bug.cgi?id=158769

3) Fix information:
The original bug was submitted for meeting requests, but the issue is reproducible for ordinary emails also.
Modest receives an email from recipient with email address like this:
From: "Nangunoori Naveen.K (EXT-Wipro/Helsinki)"\r\n <ext-naveen k nangunoori nokia com>
Here '\r\n' is the new line marker.
When the user presses 'reply all' Modest forms string for 'To:' like this: "Nangunoori Naveen.K (EXT-Wipro/Helsinki)"\r\n <ext-naveen k nangunoori nokia com> Modest passes this email address to 'tny_header_set_to (new_header, new_to)' -> '_foreach_email_add_to_inet_addr ()' -> '_string_to_camel_inet_addr ()';
In its turn, _string_to_camel_inet_addr () transforms:
["Nangunoori Naveen.K (EXT-Wipro/Helsinki)"\r\n] => [Nangunoori Naveen.K (EXT-Wipro/Helsinki)"] Here, the trailing \" is not removed. Now, the email address is considered to be: "Nangunoori Naveen.K (EXT-Wipro/Helsinki)\"" <ext-naveen k nangunoori nokia com> The email address has extra \" character. According to the RFCs the email address is still valid, but it is NOT valid for MS Exchange servers and it rejects such an address. I added stripping (removing whitespaces) the name before \" characters are removed. This fixes this particular issue.

Please, let me know if something is wrong with this fix.

Thank you,
Alexander



Alexander Chumakov
Architect

Teleca
24 Salganskaya St., Nizhny Novgorod, 603105, Russia
Phone: +78312788198, Fax: +78312577230
Alexander Chumakov teleca com
http://www.teleca.com/

Follow what's going on at Teleca's blog on http://www.whatsyourideaoftomorrow.blogspot.com/.

The information contained in this message is confidential and is intended for the addressee(s) only. If you have received this message in error please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly prohibited.

>From 6421f69c4b5065a995c9fa0ae69a2b670d13bfd7 Mon Sep 17 00:00:00 2001
From: alexander chumakov <alexander chumakov teleca com>
Date: Wed, 14 Apr 2010 11:29:30 +0400
Subject: [PATCH] Fixed handling addresses with a new line between display-name and angle-addr

---
 ChangeLog                            |    5 +++++
 libtinymail-camel/tny-camel-common.c |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d46ee52..b42b584 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-04-14  Alexander Chumakov  <alexander chumakov teleca com>
+
+	* libtinymail-camel/tny-camel-common.c (_string_to_camel_inet_addr):
+	Fixed handling addresses with a new line between display-name and angle-addr
+
 2010-03-04  Simon Schubert  <2 0x2c org>
 
 	Reviewed by: Sergio Villar Senin <svillar igalia com>
diff --git a/libtinymail-camel/tny-camel-common.c b/libtinymail-camel/tny-camel-common.c
index b240ba4..8b90726 100644
--- a/libtinymail-camel/tny-camel-common.c
+++ b/libtinymail-camel/tny-camel-common.c
@@ -279,6 +279,7 @@ _string_to_camel_inet_addr (gchar *tok, CamelInternetAddress *target)
 	
 		if (G_LIKELY (lname && *lname == ' '))
 			*lname-- = '\0';
+		name = g_strstrip (name);
 		remove_quotes (name);
 		camel_internet_address_add (target, name, email);
 	} else {
-- 
1.7.0



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