Problem in extracting emails via EWS from 11134

Problem in extracting emails via EWS from 11134

Emails getting fetched via EWS are getting failed to process and stops the Mail Fetching when that mail's object doesn't have InternetMessageHeaders.

Note: This issue will not occur for all emails extracted via EWS except for the emails which don't have the expected header in them. (which will be a rare scenario)
The issue started occurring from 11134 due to the fix of SD-84472, in which the content-type mail header is extracted for fixing it.

Issue ID: SD-92222

Exception Error Trace:

[14:49:48:419]|[12-29-2020]|[com.manageengine.servicedesk.mail.core.ProcessEWSMessage]|[SEVERE]|[147]: Exception in getting mailcontent|
[14:49:48:419]|[12-29-2020]|[com.adventnet.servicedesk.helpdesk.mail.task.MailFetchingTask]|[SEVERE]|[147]: Exception : Exception while extracting attachments and inline images|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: com.manageengine.servicedesk.mailutils.MailException: Exception while extracting attachments and inline images|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at com.manageengine.servicedesk.mail.core.ProcessEWSMessage.loadProperties(ProcessEWSMessage.java:356)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at com.manageengine.servicedesk.mail.core.ProcessMessageHandler.loadPropertiesIntoBean(ProcessMessageHandler.java:73)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at com.manageengine.servicedesk.mail.core.ProcessMessageHandler.loadProperties(ProcessMessageHandler.java:45)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at com.adventnet.servicedesk.mailutils.MailProcessor.processEMail(MailProcessor.java:54)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at com.adventnet.servicedesk.helpdesk.mail.task.MailFetchingTask.emailThreadOfEWS(MailFetchingTask.java:472)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at com.adventnet.servicedesk.helpdesk.mail.task.MailFetchingTask.executeTask(MailFetchingTask.java:100)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at com.adventnet.taskengine.internal.SchedulerBean.executeTask(SchedulerBean.java:634)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at sun.reflect.GeneratedMethodAccessor97.invoke(Unknown Source)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at java.lang.reflect.Method.invoke(Method.java:498)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at com.adventnet.mfw.bean.BeanProxy.invoke(BeanProxy.java:115)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at com.sun.proxy.$Proxy5.executeTask(Unknown Source)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at com.adventnet.taskengine.internal.ScheduleExecutor.executeNextTask(ScheduleExecutor.java:191)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at com.adventnet.taskengine.internal.ScheduleExecutor.run(ScheduleExecutor.java:86)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at java.lang.Thread.run(Thread.java:748)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: Caused by: java.lang.NullPointerException|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at com.manageengine.servicedesk.mail.core.ProcessEWSMessage.extractAttachmentsAndInlineImages(ProcessEWSMessage.java:368)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: at com.manageengine.servicedesk.mail.core.ProcessEWSMessage.loadProperties(ProcessEWSMessage.java:352)|
[14:49:48:419]|[12-29-2020]|[SYSERR]|[INFO]|[147]: ... 20 more|


Files Modified :
<SDP>\helpdesk\src\library\com\manageengine\servicedesk\mail\core\ProcessEWSMessage.java

Jar Compatibility :
    11134 , 11135 - SDP Build Version

      New to ADManager Plus?

        New to ADSelfService Plus?

          • Related Articles

          • List of mail fetching issues and solutions

            Scenario 1 : Mail fetching issue due to Invalid or No PKIX certificate .   Log traces for Mail Fetching  issues Exception when connecting to store.|javax.mail.MessagingException: sun.security.validator.ValidatorException: PKIX path building failed: ...
          • Troubleshooting Oauth configuration for mail server settings

            Oauth in ServiceDesk Plus / AssetExplorer for Mail SDP supports Oauth configuration for Office365 and GSuite mailboxes since 11106 build. Office365 mailboxes can be configured with Oauth authentication using EWS (since 11106) and IMAP / SMTP (since ...
          • Fix JAR for Parse Error Exception Raised during Mail Fetching

            Issue : Some mail are fetched and created as ticket without description due to message corruption temporarily. The issue is can be identified with the below trace. Fix : The issue is not recreated when the mail is skipped to next schedule and fetched ...
          • Unable to send reply’s in a specific format from the application when EWS is configured

             When trying to send reply mail, if a user mail address is entered in the format "Name<email-address>", then an exception in EWS since, could not resolve this toaddress. Log Trace :  [22:10:27:393]|[09-21-2022]|[SYSERR]|[INFO]|[157]: ...
          • Mail Fetching Stopped Due to Inline Image Handling

            Issue Cause : While fetching a mail, in certain mail servers, cid of inline image is not parsed correctly. Once inline stream is converted to image, cid in src attr will be replaced with image url. cid for uploaded inline image in mail content is not ...