diff --git a/ActiveSync/SOGoActiveSyncDispatcher.m b/ActiveSync/SOGoActiveSyncDispatcher.m
index 03a8aec..25affe8 100644
--- a/ActiveSync/SOGoActiveSyncDispatcher.m
+++ b/ActiveSync/SOGoActiveSyncDispatcher.m
@@ -3990,6 +3990,8 @@ NSLog(@"tfu process");
                       [map setObject: [currentAttachment objectForKey: @"mimetype"] forKey: @"content-type"];
                       [map setObject: [currentAttachment objectForKey: @"encoding"] forKey: @"content-transfer-encoding"];
                       [map addObject: [NSString stringWithFormat: @"attachment; filename=\"%@\"", [currentAttachment objectForKey: @"filename"]] forKey: @"content-disposition"];
+                      if ([[currentAttachment objectForKey: @"bodyId"] length])
+                        [map setObject: [currentAttachment objectForKey: @"bodyId"] forKey: @"content-id"];
                       bodyPart = [[[NGMimeBodyPart alloc] initWithHeader: map] autorelease];
 
                       fdata = [[NGMimeFileData alloc] initWithBytes:[bodydata bytes]  length:[bodydata length]];
diff --git a/ActiveSync/SOGoMailObject+ActiveSync.m b/ActiveSync/SOGoMailObject+ActiveSync.m
index 0fdca97..c29e5ac 100644
--- a/ActiveSync/SOGoMailObject+ActiveSync.m
+++ b/ActiveSync/SOGoMailObject+ActiveSync.m
@@ -1260,7 +1260,7 @@ struct GlobalObjectId {
             {
               if ([[value objectForKey: @"bodyId"] length])
                 {
-                  [s appendFormat: @"<ContentId>%@</ContentId>", [[value objectForKey: @"bodyId"] activeSyncRepresentationInContext: context]];
+                  [s appendFormat: @"<ContentId>%@</ContentId>", [[[value objectForKey: @"bodyId"] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString: @"<>"]] activeSyncRepresentationInContext: context]];
                   [s appendFormat: @"<IsInline>%d</IsInline>", 1];
                 }
 
