Mail Server to Database

Overview

This version is for Appian 25.1 and above. Cloud customers on a lower version of Appian that want to install this plugin should open a support case. Self-managed customers can download the latest JAR for Appian 25.1 and later from the AppMarket.

Enhancement to the plug-in to enable the selection of whether or not to include the email attachments as part of the EML document. Previously, the plug-in would create an EML document with the attachments stripped out. Our client needs to preserve the original e-mail as it was sent (for auditing purposes), so the EML must include the attachments as part of it. This update extends the functionality to allow the user to select whether they want an EML with the attachments removed (original functionality), an EML with attachments included, or both (2 EMLS of original email - one without the attachments included and one with the attachments included). Any e-mail attachments will continue to be saved separately.

Key Features & Functionality

Takes all unread email from a mailbox and adds entries directly to a database table.The original email is saved as an EML based on three attachment type options

  1. EML with attachments removed
  2. EML with attachments included
  3. Both (2 EMLs of original email) - EML with attachments removed and EML with attachments included

Each email attachment is saved as its own document. The database tables store the Appian document ids, email recipients, subject and body (text and HTML)

Anonymous
    1. The original eml file gets saved in database and in a Appian Doc.
    2. The size of the email are 1066 KB and 727 KB.

    There is no particular pattern, it just happens with random mailboxes. Sometimes, the APP_MAIL_POLLER_DOC table will have the entries for attachments but the referenced Appian Doc doesn't exist in system. I have seen cases where the original eml is saved to DB but the doc itself missing from KC. 

    Hope this helps. Please let me know if you need any additional info. TIA. 

  • I have not encountered this before but here a few questions:

    1. Does the eml get saved in the DB and in an Appian doc?
    2. How big are the attachments? Is there any pattern to the specific types of emails that are breaking?
  • I think so, the download file contains documentation with these detail.

  • , We have a repeating issue where the email attachments are not getting extracted from original email. Sometimes the database entries point to AppianDocId but the document doesn't exist in KC. Any pointers or something we need to look for why this is happening? Any help in this matter is greatly appreciated. 

  • Hi ,

    I have the requirement to pull the mails into appian and need to access the email details like sender, email subject and email content and attachments, does this plug-in fulfill my requirement? 

    Thanks in advance.

  • Hi ,

    I have used this plugin in our application, CC_NAMES and TO_NAMES are not capturing in APP_MAIL_POLLER table, could you please provide the solution for this?

    Also I have following questions could you please answer for that

    1.Maximum how much MB attachments this plugin will read?

    2.On failure, I need to mark it as unread so is there any way to do that? 

  • The poller can only have one instance running at a time. Check your processes to make sure you don't have one executing in parallel.

  • Hi

    This poller plugin started failing since yesterday all of sudden in all environment with below error.

    "poller already running"

    When we further checked, it is reading email with above error. All the email accounts we have are failing with this error.

    What could have been went wrong, could you please help us to understand.

    Thanks in advance.

  • The socket timeout likely indicates a problem with establishing the connection. If you are sure the connection string and credentials are correct, then it could be a problem on the firewall. Check with the networking team.


  • Hello Mike,

    i'm trying to use your plugin but, even trying different configuration I can't succeed in my purpose Sweat smile
    I'm already using EWS Mail Poller To DB correctly but it is limited to Exchange account and your plugin is way more flexible.
    The error I'm receiving is "Read Timeout".
    I've configured a third party authentication with username and password keys, verified host configuration from mail provider and, despite that it doesn't work.
    Tomcat stdout reports:

    [Appian Work Item - 240029 - execution01 : UnattendedJavaActivityRequest] ERROR com.appiancorp.ps.mail.MailPollerSmartService - Error during mail polling
    javax.mail.MessagingException: Read timed out;
      nested exception is:
    	java.net.SocketTimeoutException: Read timed out
    	at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:670)
    	at javax.mail.Service.connect(Service.java:295)
    	at javax.mail.Service.connect(Service.java:176)
    	at javax.mail.Service.connect(Service.java:125)
    	at com.appiancorp.ps.mail.MailPoller.<init>(MailPoller.java:92)
    	at com.appiancorp.ps.mail.MailPollerSmartService.run(MailPollerSmartService.java:148)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.lambda$call$0(DefaultActivityExecutor.java:131)
    	at com.appiancorp.plugins.PluginUsageLogger.runWithPluginInformation(PluginUsageLogger.java:52)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:131)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:125)
    	at com.appiancorp.common.ContextClassLoaderSwitcher.runInContext(ContextClassLoaderSwitcher.java:25)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor.execute(DefaultActivityExecutor.java:125)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute(UnattendedJavaActivityRequest.java:83)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute0(UnattendedJavaActivityRequest.java:55)
    	at com.appiancorp.process.engine.ContinuationRequest.executeOuter(ContinuationRequest.java:71)
    	at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:100)
    	at com.appiancorp.process.workpoller.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:36)
    	at com.appiancorp.process.workpoller.WorkItem.run(WorkItem.java:84)
    	at org.springframework.jca.work.SimpleTaskWorkManager$DelegatingWorkAdapter.run(SimpleTaskWorkManager.java:239)
    	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:748)
    Caused by: java.net.SocketTimeoutException: Read timed out
    	at java.net.SocketInputStream.socketRead0(Native Method)
    	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
    	at java.net.SocketInputStream.read(SocketInputStream.java:171)
    	at java.net.SocketInputStream.read(SocketInputStream.java:141)
    	at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:124)
    	at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
    	at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
    	at com.sun.mail.iap.ResponseInputStream.readResponse(ResponseInputStream.java:95)
    	at com.sun.mail.iap.Response.<init>(Response.java:95)
    	at com.sun.mail.imap.protocol.IMAPResponse.<init>(IMAPResponse.java:60)
    	at com.sun.mail.imap.protocol.IMAPProtocol.readResponse(IMAPProtocol.java:286)
    	at com.sun.mail.iap.Protocol.<init>(Protocol.java:123)
    	at com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:115)
    	at com.sun.mail.imap.IMAPStore.newIMAPProtocol(IMAPStore.java:685)
    	at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:636)
    what am I doing wrong?
    Sorry for bothering you and all people in this community but i don't know what I have to do.

    Thanks in advance for your patience and your time
    Kind Regards