Incoming email parsed as raw HTML
Email listener is not processing the incoming email correctly. Listener displays an incoming message as raw HTML. This issue occurs when using Exchange Server 2010.
No error message in the logs, but in the screen capture below the incoming email is displayed as raw HTML.
Steps to Reproduce
Send an email to a Pega email listener using Microsoft Exchange 2010.
The root cause of this problem is defect/misconfiguration in the operating environment. In EmailListener issues always add DEBUG to "com.pega.pegarules.integration.engine.internal.services.email.EmailListener" class and review the PegaRULES logs for anomaly. In this case the issue was with the wrong “Content-Type” set in the email header by the Exchange server. The incoming email had two MIME parts, i.e. text and html and the Content-Type was being set "text/html".
If incoming has multiparts, i.e. text and html always use Content-Type=mulitpart/alternative or multipart/mixed.
Also make sure the control that is used to display the incoming messages is set to RichTextDisplay.
This issue is resolved by making the following change to the operating environment: Configure Exchange server to set Content-Type to "mutipart/alternative" for outgoing messages and change the control to "RichTextDisplay".