Email Import Configuration
You can configure an email account in the Batch Class to process the attachments in the mail or both, mail content and attachments. Once the mail import configurations are done, the application will automatically start fetching the emails and process as batch.
Following are the configurations required:
- Go to Ephesoft\Application folder and open applicationContext.xml file in your local editor.
Uncomment the following tag to activate mail import service.
<import resource=”classpath:/META-INF/applicationContext-dcma-mail-import.xml” />
- Go to Ephesoft\Application\WEB-INF\classes\META-INF\dcma-mail-import folder and open mail-import-properties file in your local editor.
a. Schedule the time for running the cron job for mail import.
b. Set the flag to include attachments or both, mail content (body) and attachments.
#1= download only attachments
#0= download body with attachments (default value)
- Open the Batch Class for which you want to configure mail import and click on Email Configuration from the left panel to configure the email account.Following are the configurable mail account properties:
Configurable property Type of value Value options Description Username String A valid email account username. The user account name to be configured with Ephesoft on which the Email Import service will keep a watch. Password String Corresponding password for the configured username Password for the configured user account. Password will always visible as 8 * in password field. Incoming Server String A valid mail server name The name of the mail server to which the configured user account belongs. Server type Dropdown A valid mail server type.
The type of the mail server to which the configured user account belongs. Server Type can be IMAP/POP3. Folder Name String A valid and existing mail folder name The name of the mail folder on which the Ephesoft Email import will be checking. Folder Name cane be Inbox. Is SSL Check Box
The property that defines whether we’ll be connecting to mail server using the SSL settings or Non-SSL. Enable Check Box
The property that defines whether user email is enable or disable for importing documents. Port number Integer A valid port number The port number on which the configured mail server type will work. Port number will be in range of 1 to 65535.
If any filed of Email configuration is not valid this field will be shown in red color.
* Using a single email account across multiple batch classes or environments is not supported and may result in unexpected results.
- Once the email configuration is done, check the account settings for uninterrupted service.
For example, in case you are configuring a Gmail account then check the following attributes:
a. Go to My Account >> Sign-in & Security and Turn-on the switch “Allow less secure apps”.
b. Go to Settings, open the tab “Forwarding and POP/IMAP” and Enable IMAP access.
c. Save Changes.
- Restart the Ephesoft server and test the functionality.
Depending upon the scheduler, the application will pick-up the emails and start processing them as Batch. You can view the batches in the Batch Instance screen. Or, go to the Shared Folder to view the processed batches.
Configurable Properties file
- mail-import. properties
Path: <Ephesoft installation directory>\ Application\WEB-INF\classes\META-INF\dcma-mail-import\mail-import. properties
Configurable property Type of value Value options Description dcma.importMail.cronExpression String A valid cron expressions The CRON expression defining the look up time for the plug-in, i.e. at what time the plug-in looks for any updates in the configured mail account. dcma.supported.attachment.extension String List of valid file extensions Defines the supported documents by the plug-in. Multiple entries are separated by a “;”.
Path: <Ephesoft installation directory>\ Application\WEB-INF\classes\META-INF\dcma-mail-import\open-office.properties
Configurable property Type of value Value options Description openoffice.serverUrl List of values ON/OFF Server used for connecting to the remote open office server instance. Used in case of connecting to external/remote service. openoffice.serverPort Integer A valid and available port number. Port number used for connecting to the open office server instance. Default port is 8100 openoffice.autoStart Boolean
If the open office server should be started / connected upon XE starts. Default value is false. openoffice.homePath String N-A Path to open office installation. If no path is provided, a default value will be calculated based on the operating environment. openoffice.maxTasksPerProcess Integer Any valid integer value. Maximum number of simultaneous conversion tasks to be handled by a single open office process. Default value for optimized performance is 50. openoffice.taskExecutionTimeout Integer Any valid integer value. Timeout for conversion tasks (in milliseconds). Default value for optimized performance is 30 seconds.
File Name Length Restriction
Use the following formula to determine the maximum file name length that Ephesoft Transact supports for email import:
Length[UNC_FOLDER_File_Name_Path] < PERMISSIBLE_LIMIT_PATH_LENGTH_WINDOWS – PDF_PROCESSING_FOLDER.length() – 10
PERMISSIBLE_LIMIT_PATH_LENGTH_WINDOWS = 259
The following case study provides an example of this formula in application:
- During the import process, the file !!!mail.pdf is located in the following directory:
- In this case, the maximum file name length is calculated to be as follows:
- length[D:\Ephesoft\SharedFolders\TestBatch\39455638711700!!!mail.pdf] < 227
This feature is responsible for enabling/disabling an email for importing the documents present in a defined form from the user’s mail account. A batch class can have multiple user mail accounts and multiple enable/disable user mail accounts.
This feature is responsible to verify whether a configured user mail account is valid. User can check the connection for user’s mail account after configuration of mail account.
- The functionality/service allows the user to set up any number of mail accounts for gathering data.
- The user is allowed to configure the account via UI.
- The functionality/service can support multiple document formats.
- The functionality/service makes use of the open-office to convert the received data files into application usable formats.
- The functionality/service is capable of downloading and saving the attachments of a mail.
Steps of execution/working
- When the plug-in properties have been set up properly, Ephesoft moves ahead with mail downloading by accessing the mail account.
- Email import service reads the user’s mail configuration from the database, and tries to access the user’s mail account using the configured settings.
- If the service is able to connect to the user account, it reads all the mails contained in the configured folder.
- After the service has read the mails, it starts processing multiple mails at a time.
- Each read mail goes through a three step procedure of processing, downloading, converting and creating a batch for the mail.
- If any error occurs processing of a mail, the service sends notification mail to mail accounts configured for notification.
Following are few common error messages received due to mal-functioning of the plugin:
|S no.||Error message||Possible root cause|
|1||Unable to convert Email into PDF file.||Open office service is either not running or have not been configured correctly|
|2||Error in Server Type Configuration, only IMAP/POP3 is allowed.||Plug-in only supports IMAP or POP3 server type. Check the user’s account configuration.|
|3||Not able to establish connection.||Connection could not be established for the current user’s account configuration.|
|4||Could not find port number. Trying with default value of 995.||Port number specified in the user’s configuration is invalid, hence plug-in tries to connect on the default pop3 port.|
|5||Could not find port number. Trying with default value of 993.||Port number specified in the user’s configuration is invalid, hence plug-in tries to connect on the default IMAP port.|
|6||Error while reading mail contents||Either email body or other attachments could not be read and converted|
|7||Not able to process the mail reading.||Some error in reading the contents of mail. Open-office could not convert the source file into desired.|
Email Import with Folder other than Inbox
Earlier in Email Import Configuration folder name was not editable. It was fixed to Inbox folder only. Now, Folder name is editable for IMAP Server but is fixed to Inbox for POP3 Server.
If you want to use a sub-folder for Inbox, you can enter Inbox/<sub folder> as seen in screenshot below.