From be7ee69f0f875e4d8b1986b3d1dfae87f44e7e56 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Wed, 9 Mar 2016 08:49:17 -0500 Subject: [PATCH] (fix) avoid truncating the MIME content when fetching the whole message --- ActiveSync/SOGoActiveSyncDispatcher+Sync.m | 5 +++++ ActiveSync/SOGoActiveSyncDispatcher.m | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/ActiveSync/SOGoActiveSyncDispatcher+Sync.m b/ActiveSync/SOGoActiveSyncDispatcher+Sync.m index 4ece45011..9dab9621a 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher+Sync.m +++ b/ActiveSync/SOGoActiveSyncDispatcher+Sync.m @@ -590,6 +590,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. serverId = [[(id)[theDocumentElement getElementsByTagName: @"ServerId"] lastObject] textValue]; + // https://msdn.microsoft.com/en-us/library/gg675490%28v=exchg.80%29.aspx + // The fetch element is used to request the application data of an item that was truncated in a synchronization response from the server. + // The complete item is then returned to the client in a server response. + [context setObject: @"8" forKey: @"MIMETruncation"]; + o = [theCollection lookupName: [serverId sanitizedServerIdWithType: theFolderType] inContext: context acquire: NO]; diff --git a/ActiveSync/SOGoActiveSyncDispatcher.m b/ActiveSync/SOGoActiveSyncDispatcher.m index 72b26dfef..b3b3d218a 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher.m +++ b/ActiveSync/SOGoActiveSyncDispatcher.m @@ -1425,6 +1425,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. mimeSupport = [[(id)[theDocumentElement getElementsByTagName: @"MIMESupport"] lastObject] textValue]; [context setObject: mimeSupport forKey: @"MIMESupport"]; + // https://msdn.microsoft.com/en-us/library/gg675490%28v=exchg.80%29.aspx + // The fetch element is used to request the application data of an item that was truncated in a synchronization response from the server. + // The complete item is then returned to the client in a server response. + [context setObject: @"8" forKey: @"MIMETruncation"]; + currentCollection = [self collectionFromId: realCollectionId type: folderType]; mailObject = [currentCollection lookupName: serverId inContext: context acquire: NO];