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
  • Hi, we have an issue when mail poller is trying to download an email with reasnably large (18Mb) attachments from Exchange folder - after a short time, the email gets moved to Expection folder without being processed. In the logs I can see the following error:

    2024-04-12 11:33:23 WARNING [OkHttp ConnectionPool] okhttp3.internal.platform.Platform.log A connection to https://graph.microsoft.com/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);

    and then shortly after:
    execution02 - process 28513890 - model 2849 : UnattendedJavaActivityRequest] ERROR com.appiancs.msgraphmail.MSGraphMailPoller - Error during email processing, exiting all
    com.microsoft.graph.core.ClientException: Error during http request
    	at com.microsoft.graph.http.CoreHttpProvider.processResponse(CoreHttpProvider.java:494)
    	at com.microsoft.graph.http.CoreHttpProvider.sendRequestInternal(CoreHttpProvider.java:408)
    	at com.microsoft.graph.http.CoreHttpProvider.send(CoreHttpProvider.java:225)
    	at com.microsoft.graph.http.CoreHttpProvider.send(CoreHttpProvider.java:202)
    	at com.microsoft.graph.http.BaseRequest.send(BaseRequest.java:335)
    	at com.microsoft.graph.requests.MessageMoveRequest.post(MessageMoveRequest.java:54)
    	at com.appiancs.msgraphmail.MSGraphMessageHandler.processProxied(MSGraphMessageHandler.java:252)
    	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:129)
    	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.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:750)
    Caused by: com.google.gson.JsonSyntaxException: java.net.SocketTimeoutException: timeout

    Can you please checked that?
Comment
  • Hi, we have an issue when mail poller is trying to download an email with reasnably large (18Mb) attachments from Exchange folder - after a short time, the email gets moved to Expection folder without being processed. In the logs I can see the following error:

    2024-04-12 11:33:23 WARNING [OkHttp ConnectionPool] okhttp3.internal.platform.Platform.log A connection to https://graph.microsoft.com/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);

    and then shortly after:
    execution02 - process 28513890 - model 2849 : UnattendedJavaActivityRequest] ERROR com.appiancs.msgraphmail.MSGraphMailPoller - Error during email processing, exiting all
    com.microsoft.graph.core.ClientException: Error during http request
    	at com.microsoft.graph.http.CoreHttpProvider.processResponse(CoreHttpProvider.java:494)
    	at com.microsoft.graph.http.CoreHttpProvider.sendRequestInternal(CoreHttpProvider.java:408)
    	at com.microsoft.graph.http.CoreHttpProvider.send(CoreHttpProvider.java:225)
    	at com.microsoft.graph.http.CoreHttpProvider.send(CoreHttpProvider.java:202)
    	at com.microsoft.graph.http.BaseRequest.send(BaseRequest.java:335)
    	at com.microsoft.graph.requests.MessageMoveRequest.post(MessageMoveRequest.java:54)
    	at com.appiancs.msgraphmail.MSGraphMessageHandler.processProxied(MSGraphMessageHandler.java:252)
    	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:129)
    	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.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:750)
    Caused by: com.google.gson.JsonSyntaxException: java.net.SocketTimeoutException: timeout

    Can you please checked that?
Children
No Data