[horde] Complex MIME structure and Outlook with Exchance Active Sync

Michael J Rubinsky mrubinsk at horde.org
Wed Sep 2 16:08:27 UTC 2015

Quoting Bjoern Voigt <bjoernv at arcor.de>:

> My users complained, that some of their mails are not shown
> correctly in Outlook 2013. The example mails contain a HTML body and
> an ICS calendar event attachment. The MIME structure of such mails
> is quiet complex:
>     ... mail header
>     MIME-Version: 1.0
>     Content-Type: multipart/mixed;
>         boundary="----=_Part_612210_854769737.1441205167596"
>     ...
>     ------=_Part_612210_854769737.1441205167596
>     Content-Type: multipart/alternative;
>         boundary="----=_Part_612211_1596854976.1441205167596"
>     ------=_Part_612211_1596854976.1441205167596
>     Content-Type: text/plain; charset=UTF-8
>     Content-Transfer-Encoding: QUOTED-PRINTABLE
>     Content-Disposition: inline
>     ... plain text
>     ------=_Part_612211_1596854976.1441205167596
>     Content-Type: text/html; charset=UTF-8
>     Content-Transfer-Encoding: QUOTED-PRINTABLE
>     Content-Disposition: inline
>     <html>
>     ...HTML text
>     </html>
>     ------=_Part_612211_1596854976.1441205167596--
>     ------=_Part_612210_854769737.1441205167596
>     Content-Type: text/calendar; method=REQUEST
>     Content-Transfer-Encoding: Base64
>     Content-Disposition: attachment; filename=iCal-20150902-074607.ics
>     ...Base64 coded ICS calendar event
>     ------=_Part_612210_854769737.1441205167596--
> For testing I set up Outlook 2013 with two identical accounts, one
> with IMAP and one with Exchange Active Sync to Horde/Groupware (5.2.10).

This is most likely fixed with the most recent PEAR versions of  
Horde_ActiveSync and Horde_Mime. It is due to us working around a bug  
in PHP - which we were working around incorrectly :)

> I found, that mails in Exchange Active Sync account are changed very
> much compared with the mail source on mailserver and compared with
> the IMAP mail copy.
> Fields like
>   * headers like From, Subject ... (line breaks, character sets ...)
>   * Boundary (in Content-Type header)
>   * HTML content
> are changed.
> For instance
> Content-Type: multipart/mixed;
>     boundary="----=_Part_612210_854769737.1441205167596"
> in the original mail file (and in IMAP) will be
> Content-Type multipart/mixed; boundary="=_u0lCRt-yWhSaSeK8u9bpda_"
> in Outlook using Exchange Active Sync.
> My questions:
>   * Does Horde transfer the complete mails 1:1 using Exchange Active
>     Sync?

Not usually. The only time this is definitely true is when the email  
is s/mime signed and/or encrypted.

It is necessary to rebuild the message for non s/mime emails because  
we do a lot of filtering/sanity checking for things that are known to  
break some EAS clients. Things like incorrect line endings, 8bit text  
sent with 7bit encoding etc... Otherwise a single malformed email  
could prevent your client from syncing anything and in extreme cases  
could cause sync loops that drain a mobile's battery and slow down the  

Another place we alter things are for things like TNEF attachments.  
Most clients don't understand them, so we decompress the TNEF data and  
extract the data that we can from it and add them as "normal" file  

>   * Are there any problems with Horde Active Sync and complex MIME
>     structures?

In general, no. That doesn't mean there won't be some edge case  
uncovered where this fails...in which case a bug report should be  
submitted so we can investigate and fix.

>   * If Horde is not the source of the problem, which additional
>     tools tend to change mail headers and content. (I have a complex
>     setup with Linux and Windows Antivirus programs and filters like
>     Procmail.)

See above. The issue with mangled base64 encoded text/calendar parts  
should be fixed by the updates that went out a day or two ago.

The Horde Project
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5751 bytes
Desc: S/MIME Signature
URL: <http://lists.horde.org/archives/horde/attachments/20150902/a7b40ffc/attachment.bin>

More information about the horde mailing list