We are experiencing a problem with Rich Text Emails that are forwarded as attachments having the ContentIDs
being stripped from the attachments, which prevents us from correctly rebuilding the email message.
Here is an example response from EWS for a Rich Text Email with a picture
<t:ItemAttachment>
<t:AttachmentId Id="AAMkAGRlNWE5MTc1LTUyODktNDRjNi05NTcwLWZjZGM1ODNkMmUxYwBGAAAAAABtOoJbAYfVSZzEDvklEbbPBwBBckyCi9TiT4cjPa5DHYwwAAAAemCwAABBckyCi9TiT4cjPa5DHYwwAABknfz6AAABBgAEAAAAAAA="/>
<t:Name>Message with Attachments</t:Name>
<t:Size>97993</t:Size>
<t:LastModifiedTime>2014-06-10T13:19:25</t:LastModifiedTime>
<t:IsInline>false</t:IsInline>
<t:ContentId>F4880FA606E4DC9BBC5143C97C52AC554A3AE55B@1</t:ContentId>
</t:ItemAttachment>
Here is the same Email that is forwarded as an attachment:
<t:FileAttachment>
<t:AttachmentId Id="AAMkAGRlNWE5MTc1LTUyODktNDRjNi05NTcwLWZjZGM1ODNkMmUxYwBGAAAAAABtOoJbAYfVSZzEDvklEbbPBwBBckyCi9TiT4cjPa5DHYwwAAAAemCwAABBckyCi9TiT4cjPa5DHYwwAABknfz6AAACBgAEAAAAAAAGAAQAAQAAAA=="/>
<t:Name>Picture (Device Independent Bitmap)</t:Name>
<t:Size>5210</t:Size>
<t:LastModifiedTime>2014-06-10T13:19:25</t:LastModifiedTime>
<t:IsInline>true</t:IsInline>
</t:FileAttachment>
Of Note - Exhange 2010 SP2 EWS API v2.2 (also happens in 2.0)
My Questions are:
- Is this intended behavior? (if so why?)
- Is this configurable on exchange (not the correct forum - but still)
- If it is configurable on exchange what are the implications of said configuration.
I'll be opening an MSFT Support Incident here shortly.
Steps to recreate:
- New Message
- Set Message to Rich Text
- Attach Image
- Send Email
- Open Email
- Forward as attachment to another Rich Text Email (this can also be done by saving the msg to disk and then attaching it manually)
ExtendedPropertyDefinition PidTagRtfCompressed = new ExtendedPropertyDefinition(0x1009, MapiPropertyType.Binary);
PropertySet propSet = new PropertySet(BasePropertySet.IdOnly, EmailMessageSchema.Subject, PidTagRtfCompressed);
EmailMessage message = EmailMessage.Bind(service, ItemId, propSet);
I'm not sure if that property also contains the RTF of the original attachment or not. – Mimi Gentz