MSGraph Email Poller

Overview

Need to poll emails from your Exchange server? This smart service can be used in a poller process and extract the data from the Microsoft Exchange server. Messages are stored in the Appian Document System, as well as the attachments. Meta data is stored in a database table for further processing.

This plug-in provides an alternative to sending emails to an Appian process model when inbound email integration is requested. Instead of the email being forwarded to Appian, this plug-in reads the emails directly from the Exchange mailbox using the MS Graph API as described below:

  • Reads the mailbox using the MS Graph API
  • Convert the email to an EML file stored as an Appian document; Item attachments (calendar invites, messages) are kept in the eml file, File attachments removed from it and stored separately in the document management system.
  • Store all email file attachments as separate Appian documents
  • Store all email metadata (subject, author, recipients, etc...) into a set of tables in the database

Key Features & Functionality

All information how to deploy, configure and use the smart service is in the 'MS Graph Mail Poller.pdf' document in the downloaded zip. Extract the files in the ZIP and follow the instructions in the document.

Anonymous
Parents
  • Hello, 

    We are facing issues with emails getting moved to the exceptions folder. This is happening since January, emails doesn't appear to have similar format. Before it was becasue either an attachment was corrupted or distribution recipient and cc list are too large (+100 emails).

    New cases doesnt fit into this model. It is being hard to understand the root cause of why these emails are not getting integrated and it is crucial to us that we are integrating all emails or understanding the root cause if not. 

    You will find example case below:

    2024-06-17 00:42:28,360 [Appian Work Item - 1074052 - WorkID 504 - execution02 - process 11744124 - model 1283 : UnattendedJavaActivityRequest] ERROR com.appiancs.msgraphmail.MSGraphMessageHandler - Error during email processing
    java.net.SocketTimeoutException: timeout
    	at okhttp3.internal.http2.Http2Stream$StreamTimeout.newTimeoutException(Http2Stream.kt:675)
    	at okhttp3.internal.http2.Http2Stream$StreamTimeout.exitAndThrowIfTimedOut(Http2Stream.kt:684)
    	at okhttp3.internal.http2.Http2Stream$FramingSource.read(Http2Stream.kt:379)
    	at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.kt:276)
    	at okio.RealBufferedSource.read(RealBufferedSource.kt:192)
    	at okio.RealBufferedSource.exhausted(RealBufferedSource.kt:200)
    	at okio.InflaterSource.refill(InflaterSource.kt:112)
    	at okio.InflaterSource.readOrInflate(InflaterSource.kt:76)
    	at okio.InflaterSource.read(InflaterSource.kt:49)
    	at okio.GzipSource.read(GzipSource.kt:69)
    	at okio.RealBufferedSource$inputStream$1.read(RealBufferedSource.kt:161)
    	at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:282)
    	at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:343)
    	at java.base/java.io.FilterInputStream.read(FilterInputStream.java:106)
    	at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1309)
    	at org.apache.commons.io.IOUtils.copy(IOUtils.java:978)
    	at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1282)
    	at org.apache.commons.io.IOUtils.copy(IOUtils.java:953)
    	at org.apache.commons.io.IOUtils.toByteArray(IOUtils.java:2405)
    	at com.appiancs.msgraphmail.MSGraphMessageHandler.processProxied(MSGraphMessageHandler.java:114)
    	at com.appiancs.msgraphmail.MSGraphMailPoller.processInboxItems(MSGraphMailPoller.java:168)
    	at com.appiancs.msgraphmail.MSGraphMailPoller.pollForMail(MSGraphMailPoller.java:45)
    	at com.appiancs.msgraphmail.MSGraphMailPollerSmartService.run(MSGraphMailPollerSmartService.java:212)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.lambda$call$0(DefaultActivityExecutor.java:136)
    	at com.appiancorp.plugins.PluginUsageLogger.runWithPluginInformation(PluginUsageLogger.java:54)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:136)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:130)
    	at com.appiancorp.common.ContextClassLoaderSwitcher.runInContext(ContextClassLoaderSwitcher.java:28)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor.execute(DefaultActivityExecutor.java:130)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute(UnattendedJavaActivityRequest.java:88)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequestResponseCreator.getJavaActivityResultResponse(UnattendedJavaActivityRequestResponseCreator.java:22)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.getJavaActivityResultResponse(UnattendedJavaActivityRequest.java:67)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute0(UnattendedJavaActivityRequest.java:55)
    	at com.appiancorp.common.persistence.data.AppianDataUserContextProvider.executeWithConsistentDataReads(AppianDataUserContextProvider.java:143)
    	at com.appiancorp.process.engine.ProcessContinuationRequest.executeOuter(ProcessContinuationRequest.java:68)
    	at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:136)
    	at com.appiancorp.process.workpoller.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:36)
    	at com.appiancorp.process.workpoller.WorkItem.run(WorkItem.java:110)
    	at org.springframework.jca.work.SimpleTaskWorkManager$DelegatingWorkAdapter.run(SimpleTaskWorkManager.java:241)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    

    Could you please advise how we should process or if anything will be done to correct this ? 

    Thank you in advance for your guidance and help.

Comment
  • Hello, 

    We are facing issues with emails getting moved to the exceptions folder. This is happening since January, emails doesn't appear to have similar format. Before it was becasue either an attachment was corrupted or distribution recipient and cc list are too large (+100 emails).

    New cases doesnt fit into this model. It is being hard to understand the root cause of why these emails are not getting integrated and it is crucial to us that we are integrating all emails or understanding the root cause if not. 

    You will find example case below:

    2024-06-17 00:42:28,360 [Appian Work Item - 1074052 - WorkID 504 - execution02 - process 11744124 - model 1283 : UnattendedJavaActivityRequest] ERROR com.appiancs.msgraphmail.MSGraphMessageHandler - Error during email processing
    java.net.SocketTimeoutException: timeout
    	at okhttp3.internal.http2.Http2Stream$StreamTimeout.newTimeoutException(Http2Stream.kt:675)
    	at okhttp3.internal.http2.Http2Stream$StreamTimeout.exitAndThrowIfTimedOut(Http2Stream.kt:684)
    	at okhttp3.internal.http2.Http2Stream$FramingSource.read(Http2Stream.kt:379)
    	at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.kt:276)
    	at okio.RealBufferedSource.read(RealBufferedSource.kt:192)
    	at okio.RealBufferedSource.exhausted(RealBufferedSource.kt:200)
    	at okio.InflaterSource.refill(InflaterSource.kt:112)
    	at okio.InflaterSource.readOrInflate(InflaterSource.kt:76)
    	at okio.InflaterSource.read(InflaterSource.kt:49)
    	at okio.GzipSource.read(GzipSource.kt:69)
    	at okio.RealBufferedSource$inputStream$1.read(RealBufferedSource.kt:161)
    	at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:282)
    	at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:343)
    	at java.base/java.io.FilterInputStream.read(FilterInputStream.java:106)
    	at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1309)
    	at org.apache.commons.io.IOUtils.copy(IOUtils.java:978)
    	at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1282)
    	at org.apache.commons.io.IOUtils.copy(IOUtils.java:953)
    	at org.apache.commons.io.IOUtils.toByteArray(IOUtils.java:2405)
    	at com.appiancs.msgraphmail.MSGraphMessageHandler.processProxied(MSGraphMessageHandler.java:114)
    	at com.appiancs.msgraphmail.MSGraphMailPoller.processInboxItems(MSGraphMailPoller.java:168)
    	at com.appiancs.msgraphmail.MSGraphMailPoller.pollForMail(MSGraphMailPoller.java:45)
    	at com.appiancs.msgraphmail.MSGraphMailPollerSmartService.run(MSGraphMailPollerSmartService.java:212)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.lambda$call$0(DefaultActivityExecutor.java:136)
    	at com.appiancorp.plugins.PluginUsageLogger.runWithPluginInformation(PluginUsageLogger.java:54)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:136)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:130)
    	at com.appiancorp.common.ContextClassLoaderSwitcher.runInContext(ContextClassLoaderSwitcher.java:28)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor.execute(DefaultActivityExecutor.java:130)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute(UnattendedJavaActivityRequest.java:88)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequestResponseCreator.getJavaActivityResultResponse(UnattendedJavaActivityRequestResponseCreator.java:22)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.getJavaActivityResultResponse(UnattendedJavaActivityRequest.java:67)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute0(UnattendedJavaActivityRequest.java:55)
    	at com.appiancorp.common.persistence.data.AppianDataUserContextProvider.executeWithConsistentDataReads(AppianDataUserContextProvider.java:143)
    	at com.appiancorp.process.engine.ProcessContinuationRequest.executeOuter(ProcessContinuationRequest.java:68)
    	at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:136)
    	at com.appiancorp.process.workpoller.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:36)
    	at com.appiancorp.process.workpoller.WorkItem.run(WorkItem.java:110)
    	at org.springframework.jca.work.SimpleTaskWorkManager$DelegatingWorkAdapter.run(SimpleTaskWorkManager.java:241)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    

    Could you please advise how we should process or if anything will be done to correct this ? 

    Thank you in advance for your guidance and help.

Children
No Data