From 22888ba5ac2cdc8d52d4c8eba9a94936376b7520 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 26 Feb 2015 17:49:26 -0500 Subject: [PATCH] use the correct mail body element for EAS 2.5 clients - patch from tfu --- ActiveSync/SOGoMailObject+ActiveSync.m | 38 ++++++++++++++++---------- NEWS | 1 + 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/ActiveSync/SOGoMailObject+ActiveSync.m b/ActiveSync/SOGoMailObject+ActiveSync.m index 43b55c376..c2993ca7f 100644 --- a/ActiveSync/SOGoMailObject+ActiveSync.m +++ b/ActiveSync/SOGoMailObject+ActiveSync.m @@ -754,23 +754,31 @@ struct GlobalObjectId { len = [content length]; - [s appendString: @""]; - - // Set the correct type if client requested text/html but we got text/plain - if (preferredBodyType == 2 && nativeBodyType == 1) - [s appendString: @"1"]; - else - [s appendFormat: @"%d", preferredBodyType]; - - [s appendFormat: @"%d", truncated]; - [s appendFormat: @""]; - - if (!truncated) + if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"2.5"]) { - [s appendFormat: @"%@", content]; - [s appendFormat: @"%d", len]; + [s appendFormat: @"%@", content]; + [s appendFormat: @"%d", truncated]; } - [s appendString: @""]; + else + { + [s appendString: @""]; + + // Set the correct type if client requested text/html but we got text/plain + if (preferredBodyType == 2 && nativeBodyType == 1) + [s appendString: @"1"]; + else + [s appendFormat: @"%d", preferredBodyType]; + + [s appendFormat: @"%d", truncated]; + [s appendFormat: @""]; + + if (!truncated) + { + [s appendFormat: @"%@", content]; + [s appendFormat: @"%d", len]; + } + [s appendString: @""]; + } } // Attachments -namespace 16 diff --git a/NEWS b/NEWS index d3fd5c1df..ae2da50c5 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ Bug fixes - fixed potential encoding issue using EAS and 8-bit mails (#3116) - multiple collections support for GetItemEstimate using EAS - fixed empty sync responses for EAS 2.5 and 12.0 clients + - use the correct mail body element for EAS 2.5 clients 2.2.16 (2015-02-12) -------------------