Internet Mail Archive System

From PresenceWiki
Revision as of 17:02, 27 February 2012 by Graham (Talk | contribs)

Jump to: navigation, search
Tutorial Pages > Internet Mail Archive System

Overview

This document describes the IMAS system and how it was created using Presence.

The Imas System currently performs 3 functions:-

  • The Mail Service connects to a POP(email) account and downloads attachments, based on conditions defined under the rules menu.
  • The Rule Service will then copy each attachment to a Network or AS400 location or place it in a folder to be processed by a task service.
  • The Task Service will then process any attachments that need processing, custom tasks can be created for this purpose.

Note: It is the tasks in the task services panel that are bespoke to the specific solution requirement.

Presence Tasks

Queued Processes

Queue Scan POP
Queue Rule Action

On-Demand Processes

OnDemand MainPage (alias imas.mainPage)

General IMAS Solution

Here we will take a look at the general IMAS solution and show how it can Scan attachments from emails and upload them to either an AS400 Folder a Network Folder or run a task with them.

Specific DAS Solution

Here, we will study the solution delivered to DAS to give us an overview of the capabilities and operation of IMAS.

The requirement for DAS was to scan an email account for files that can be one of four types:-

  • HomeFixed
  • HomeDelimitted
  • MotorFixed
  • MoterDelimitted

Attachments, can also come through as zipped, in which case we needed to get Presence to unzip them so that it can then treat them as standard attachments.


As an example we will send 1 email that contains a zip file containing one of each file (HomeFixed,HomeDelimitted MotorFixed,MoterDelimitted) as well as an individual file MotorDelimitted.txt and another file Wrong.txt which contains invalid data.

When the Mailservice runs each of these files will be detached and placed in:-

res\imas\scan\basicdetach folder, in a separate folder each:-

ccccccccccc

http://www.international-presence.com/images/imas/basicdetach.png

Note there are 2 files in each folder as one is the trigger folder (imasready).

This Task can be stopped and started using the Mail Service Screen and the logs will describe what is happening.

http://www.international-presence.com/images/imas/mailservice.png

We then need to run the rule service, this will perform the required action on each of the folders created from the Mail Service.

In this case it will run the task "Move Folder Into Bucket". This task actually opens each file and decides whether it is:-

  • HomeFixed
  • HomeDelimitted
  • MotorFixed
  • MoterDelimitted

And places it in the corresponding scan directory. If it can't decide it places it in the Unknown directory:-

All this can be seen on the Rule Service Screen, where again we can view the logs and stop and start this service.

http://www.international-presence.com/images/imas/ruleservice.png

We have added a Custom Task to process each bucket directory. For each type of directory, it will populate a table on the as400 (from the file), and then run a program call on the as400, after which the file will be deleted. To run this Custom Task, we need to


http://www.international-presence.com/images/imas/taskservice.png

http://www.international-presence.com/images/imas/ruleexceptions.png http://www.international-presence.com/images/imas/taskexceptions.png http://www.international-presence.com/images/imas/mailexceptions.png

Importing

You can download the tasks for this example from:- http://www.international-presence.com/wikidocs/samples/On_Demand_Windows_Login.xml

Once imported they should look like:-

http://www.international-presence.com/images/docs/userlogin/tasks.png

To embed the task, we just place the Check Login Sub Task before our normal OnDemand task page as you can see below in Simple Task To Confirm Action.