Mail Scanner Nodes

From PresenceWiki
Jump to: navigation, search

Mail Scanner

The Mail Scanner Node can connect to POP mail accounts and retrieve emails, and then convert them into a Presence Data Table. This is especially useful for creating automated processes based on emails you receive.

The POP Scanner Interface

To create a new POP scanner in your Task, either drag Task Element labelled "Scan Mail Accounts" from the Data Access toolbox, or right-click on your Task and choose "Insert New > Mail Scanner > Scan Mail Accounts" from the pop-up menu.

POP Scanners created are not reusable. This means that while you can copy and paste a POP Scanner from one Task into another (or the same Task), changes made to one will not affect the other.

This is a view of the POP Scanner interface which will be displayed:

Pop scanner dialog 1.png

The Name and Description fields allow you to enter a descriptive name and short description of this item.

Account Details

This is the POP Mail Account Resource that you wish to connect to, which stores details such as the IMAP folder, Account Name, Password, Server Host, Port and security options. These can all be overridden by checking the "Override Values" checkbox.

Test Tab

If you want to run a test to check that your settings are correct and you can connect to your mail server, click on the "Test" tab, then click the "Test" button:

Pop scanner test panel.png

Timeout Options

This allows you to specify that the mail scanner should time out after a period of time if the mailbox is locked, or if it is unable to connect.

In addition you can specify the amount of time to wait before releasing the mail account lock.

Failed To Connect Options

When a timeout occurs, the Task can either raise an exception (which will be caught by an Error Handler Node if one is present) or it can continue anyway. Select the option here that best suits your Task.

Scan

Pop scanner dialog 2.png

Message Removal Options

This allows you to control how and when messages are permanently deleted from the mail server. The default option is to never delete messages either when retrieving them via the Mail Scanner editor or from within a Presence Task.

Alternatively you can select to delete them regardless of whether they pass the scan criteria (see below), or only if they do. This option is available separately for the mail scanner interface tests and for within Tasks.

Limit Emails

This allows you to limit the number of emails that are retrieved by this Node. You can limit the number of emails that get considered (before filtering options are taken into account) and the number of emails that get processed.

Scan Criteria

These options allow you to filter the messages that are retrieved based on selected criteria. You can filter messages based on the contents of the message header, body, and parts (e.g. attachments). For instance, you may only be interested in messages that are sent to a particular email address, or have a particular subject.

To apply criteria to the Header, Body or Parts, click the relevant tab. In the case of the Header and Parts, you will be presented with a drop-down list displaying the available parameters which can be filtered, for instance in the Header you can filter according to the value of the Message ID, Subject, Return Path, Status, etc.

The "Populate" button will cause the combo boxes to be automatically populated according to the contents of emails on the server.

Message Headers make up the information fields of the message and include (but are not limited to) Subject, Sender, Recipient, Return Path, unique Message ID and so on. Note that different e-mail packages may include different Headers. The bare minimum requirement for all e-mails (according to the RFC-822 internet standard) is to include Sender (FROM), Recipient (TO/BCC) and the Date of the message.

The Unique Message ID also should be present and this is added at the receiving mail server (not by the sending mail server). Other headers are optional and may or may not be present. Be aware of this before filtering on headers.

The Message Body is the text content of the e-mail. Although a single e-mail can include multiple body fields - for example, one for plain text, one for HTML formatted, the actual text content will usually remain the same. Presence allows you to treat these as separate items - searching either the plain text version or the HTML codes.

Message Parts are the separate components of a multipart MIME format message. In actual fact the message body fields are considered to be parts also, but for convenience Presence treats these as a separate component. Other Parts include attached documents, embedded images, and any other binary files.

Message "Read Once" Options

This option allows you to flag messages as Read in an internal Presence database to prevent the same message from being retrieved twice on subsequent executions.

To reset this list so that older messages can be re-reader, click the "Maintain Message-ID Table" button.

Output

Pop scanner dialog 3.png

The Output Panel gives the user the ability to select which values to include in the outputted Data Table. To include a value, drag the item from the list on the left hand pane into the main (centre) pane. Please note that columns will only appear for selection if they have been included in the Scan Criteria.

Store Messages For Debug

This option allows you to save a copy of each downloaded email in the folder specified in case you need to cross check the results of the POP Scanner with the actual mail message.

Test

Pop scanner dialog 4.png

The Test Tab allows you to connect to the POP account specified and view any messages which match your criteria as a table, with Column names matching the items selected in the Output Tab.

Common reasons for not seeing messages

  • Emails seen before? A common problem is that emails have been flagged as "read" and so do not get picked up again. Click the "Remove Flags from Table" button in the Scan Panel.
  • Criteria do not match Check your criteria in the Scan Panel. Ensure that the value of the criteria is not blank, as this will ignore all emails. Use an asterisk (*) to denote that any values are permissible.

Connecting to Google Mail Accounts

Google Mail can be accessed using POP or IMAP protocols. Google Mail uses SSL communication and so a certificate must be downloaded in order to access your account.

POP - In order to connect via POP (Post Office Protocol), the following attributes need to be set in your mailbox resource:

  • Server: smtp.gmail.com
  • SSL: Yes
  • Username: Your GMail address (e.g. johnsmith@gmail.com)
  • Port: 995

Click the "SSL" button, then click the "Download" button under "Download certificate to...". This will begin downloading the certificate to the specified store (you won't normally have to change this).

IMAP - These are the settings to enable GMail access over IMAP:

  • Server: imap.gmail.com
  • SSL: Yes
  • Username: Your GMail address
  • Port: 993
  • IMAP Folder: Typically this will be "Inbox", however you can enter a different folder if needed.

As with POP, a certificate must be downloaded - however only one is needed for POP or IMAP.

Please also see the POP Scanner page, which contains similar information to this page but may be more detailed.

See Also

Task Elements : Data Accesss Task Elements : Mail Scanner Nodes

SQL Statement Nodes | Object Monitor Nodes | XML Query Nodes | Mail Scanner Nodes
Web Services Nodes | LDAP Query Nodes | JSON Node | Flat File Parser | Data Table Nodes | Variable Nodes
Transaction Control Nodes | Context XML Nodes


Task Elements | Resources