Support Article

Incoming email parsed as raw HTML

SA-11676

Summary



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.

Error Messages



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.

Root Cause



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.






Resolution



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".
Suggest Edit

Published July 6, 2015 - Updated October 8, 2020

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.