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(including digitally signed emails) using the MS Graph API
  • Convert the email to an EML file stored as an Appian document, with attachments removed from it
  • Store all email 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.
  • This plugin currently supports only MySQL and Oracle databases
Anonymous
  • Hi Team,

    Is there a way to configure a foldername to poll mails from instead of the default inbox.
    If not, is there a plan to come up with this feature in upcoming versions.

    Kind Regards,
    Richa 

  • Hello, 

    This is a great plugin, just a quick update on my experience while setting up this plugin on-prem setup to avoid confusion and to guide upcoming plugin users.

    1. Setting up a tenant with the Tenant name as “pr**********er.com.au.onmicrosoft.com
    2. Do not rely on the Test connection button when setting up a third-party credential.
    3. Sample application is developed with an old version of the Smart service, so it will not work as it is, you need to create your own process model Or replace the old smart service with a new smart service with your values.
    4. Database scripts are also old, 3 columns are missing [DOC_ID_NO_ATT], [BODY_SWAPPED_IMAGES], [MESSAGE_GRAPH_ID]. Just add while creating a table and it will work smoothly.

    Thanks and appreciate the Appian team’s hard work on this plugin.

    Regards,

    Bhushan

  • My issue is resolved we found that 3 columns was missing and we added that.

  • Thanks Raymond, Connection issue is resolved now.

    Now, I am getting wile write response back to database. 

    Invalid column name 'DOC_ID_NO_ATT' but I don't have column with this name.

    2023-02-21 04:54:56,274 [Appian Work Item - 11 - WorkID 5 - execution02 - process 2097154 - model 6 : UnattendedJavaActivityRequest] ERROR com.appiancs.msgraphmail.MSGraphDBHandler - Error writing mail to database
    com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name 'DOC_ID_NO_ATT'.

    Below is script of tables :

    create table "APP_MAIL_POLLER_DOC" (
    "APP_MAIL_POLLER_DOC_ID" number(10,0) not null,
    "APP_MAIL_POLLER_ID" number(10,0),
    "ELT" number(10,0),
    "DOC_IDX" number(10,0),
    "SYS_DATE" timestamp,
    primary key ("APP_MAIL_POLLER_DOC_ID")
    );

    create table "APP_MAIL_POLLER" (
    "APP_MAIL_POLLER_ID" number(10,0) not null,
    "FROM_EMAIL" varchar2(2000 char),
    "FROM_NAME" varchar2(2000 char),
    "SUBJECT" varchar2(700 char),
    "TO_EMAILS" varchar2(2000 char),
    "TO_NAMES" varchar2(2000 char),
    "CC_EMAILS" varchar2(2000 char),
    "CC_NAMES" varchar2(2000 char),
    "BCC_EMAILS" varchar2(2000 char),
    "BCC_NAMES" varchar2(2000 char),
    "IN_REPLY_TO" varchar2(2000 char),
    "MESSAGE_ID" varchar2(500 char),
    "STATUS" varchar2(255 char),
    "BODY_TEXT" CLOB,
    "BODY_HTML" CLOB,
    "DOC_ID" number(10,0),
    "RECEIVED_DATE" timestamp,
    "SYS_DATE" timestamp,
    "IMPORTANCE" varchar2(32 char),
    primary key ("APP_MAIL_POLLER_ID")
    );

  • Hi Bushan,

    In version 4 and later, the tenant no longer has the full URL, but just the tenant ID, i.e. something like <CLIENT_TENANT_NAME>.onmicrosoft.com

    As for seeing the deprecated smart service: That implies you are using an old version of the smart service. You will need to drag the smartservice from the pallet again and copy the data from it. A lot has changed in the implementation of the smart service, therefore these older versions are deprecated

    Hope this helps.

  • Hi, 

    We are replacing the IMAP Mail Poller with MS Graph Poller, Appian version is 22.4 and plugin version is 4.0.3. 

    Secret value, Application ID and Tenant link is entered correctly but after clicking on test connection I am getting connection failed error.

    Format  of tenant URL is login.microsoftonline.com/XXXXX.onmicrosoft.com

    I tried various diff tenant URL formats to check if it working or not.

    After that I just triggered a sample process model which has smart service, I can see below error in log.

    2023-02-17 03:18:23,087 [Appian Work Item - 2 - WorkID 3 - execution02 - process 2097152 - model 3 : UnattendedJavaActivityRequest] ERROR com.appiancs.msgraphmail.MSGraphMailPollerSmartServiceV1 - This version of the mailpoller cannot work with the latest MS Graph APIs, use the latest smartservice

    I checked this issue with Appian support, they said everything looks good in Appian third party credentials, also suggested  me to post my query over here. 

    Can someone guide me in this case.

    Thanks,

    Bhushan

  • v4.0.3 Release Notes
    • Fixed a bug where some characters in the subject could cause an issue saving the message as an EML

  • Sorry, should have been clearer, proprietary jars = Appian jars, so if you have a self-managed sandbox, you have access to them.

    See https://docs.appian.com/suite/help/22.4/developer-setup.html for details on what jars you need.

    The rest of the lib jars should be included in the plugin.

  • How can I build the plugin if I am missing proprietary jars and test it in my sandbox environment?

  • We don't have public repos for plugins yet (there is a need for proprietary jars in the repo) but if you zip up your branch, I can merge it into the repo. Once I do, I can let you know so you can publish on the appmarket.