Emaild
The Oracle Communications Unified Assurance Event Email Aggregator is a generic email integration. It connects to a POP3/IMAP email account and processes any messages found with customizable rules which can create de-duplicated events within Unified Assurance. It then deletes the email from the server.
You can run this application as a service using the Services UI.
Email Aggregator Setup
-
Update the application configuration to connect to the correct email server, along with the correct authentication settings.
-
Enable the default Service, unless a specific configuration option is needed.
Default Service
The following table shows the settings for the default service. Actual values are in bold, descriptions of values are in plaintext.
Field | Value |
---|---|
Package | coreCollection-app |
Name | Event Email Aggregator |
Program | bin/core/collection/Emaild |
Arguments | This field is blank. There is no default value. |
Description | Email Aggregator that collects from POP3 |
Failover Type | Standalone (Supported: Standalone, Primary, Redundant/Backup) |
Status | Disabled |
Privileged | This option is selected. |
See Services in Unified Assurance User's Guide for general information about the settings for services.
See Using Application Primary/Backup Failover for more information about the different failover types.
Default Configuration
The following table shows the default configurations for the application. Actual values are in bold, descriptions of values are in plaintext.
Name | Default Value | Possible Values | Notes |
---|---|---|---|
BaseRules | collection/event/email/base.rules | Text, 255 characters | The relative path to the application Base Rules file. |
BranchDir | core/default | Text, 255 characters | The relative path to the rules directory. |
ConnectionSecurity | None (Plaintext) | None (Plaintext), SSL (Secure on connect), TLS (Negotiated) | Secure connection protocol. |
EmailProtocol | POP3 | POP3 or IMAP | Mail protocol. |
Host | mail.example.com | Text, 255 characters | DNS name or IP Address of the email server. |
IncludeRules | collection/event/email/base.includes | Text, 255 characters | The relative path to the application Include Rules file. |
Interval | 60 | An integer | How often in seconds the aggregator will connect to collect the email. |
LoadRules | collection/event/email/base.load | Text, 255 characters | The relative path to the application Load Rules file. |
LogFile | logs/EventEmail.log | Text, 255 characters | The relative path to the log file. |
LogLevel | ERROR | OFF, FATAL, ERROR, WARN, INFO, DEBUG | The logging level for the application. |
Password | The default value is obscured and renders as *****. | Text, 255 characters | Password for login name of email server account. |
Port | 110 | An integer | Port for email server to collect email. (defaults: POP3 = 110, POP3S = 995, IMAP = 143, IMAPS = 993). |
ShardID | 1 | An integer | Database shard to be used. |
Threads | 3 | An integer | Number of process threads created. The aggregator takes a third of this value (rounded up) for database threads unless overridden by the DBThreads application configuration. |
Username | username@example.com | Text, 255 characters | Login name for email server account. |
Capture | Disabled | Enabled or Disabled | (Optional) If enabled, saves the raw message in the Log. |
DBThreads | This field is blank. There is no default value. | An integer | (Optional) Number of database threads to be created. If not specified, defaults to a third (rounded up) of Threads application configuration. |
FieldSetFile | This field is blank. There is no default value. | Text, 255 characters | (Optional) Path to csv file containing custom list of fields that will be used when inserting data. (Requires InsertSQLFile.) |
Folder | INBOX | Text, 255 characters | (Optional) If specified only processes the matching folder (IMAP only). |
IgnoreSizeErrors | Disabled | Enabled or Disabled | (Optional) IMAP only. Certain (caching) servers, like Exchange 2007, often report the wrong message size. Instead of skipping the message with an error, the reported size will just be ignored. |
InsertSQLFile | This field is blank. There is no default value. | Text, 255 characters | (Optional) Path to file containing custom SQL Insert statement for handling of event inserts. (Requires FieldSetFile.) |
Verification | Enabled | Enabled or Disabled | (Optional) Verify server certificate on connection (SSL/TLS only) defaults to Enabled. |
Rules
This aggregator uses the Unified Assurance standard rules architecture in Perl syntax. For information about creating rules, see the following in Unified Assurance Developer's Guide:
-
Core for information about core rules functions.
-
Events for information about Event rules functions.
Tokens
The aggregator exposes the following tokens for rules processing.
Token | Description |
---|---|
$AppConfig | Hash reference to the application configuration name-value pairs that were configured. (i.e. use $AppConfig->{'Host'} to retrieve the set value for 'Host'.) |
$Event | Reference to the hash that is used to create and insert the Event data into the database. Keys map to the fields within the table used and values assigned are inserted in the database to that field. (e.g. $Event->{'IPAddress'} = '192.0.2.1' to assign the event IP address to '192.0.2.1') At least the 'Node' and 'Summary' fields must be set, or no event is inserted. |
$SubjectOfMessage | Subject of Received Email |
$FromEmailAddress | First From Email Address header contents (may contain multiple emails) |
$ToEmailAddress | First To Email Address header contents (may contain multiple emails) |
$CCEmailAddress | First CC Email Address header contents (may contain multiple emails) |
$BodyOfMessage | Body of Received Email. ('text/plain' = PlainBody, 'text/html' = HTMLBody, 'multipart/*' = PlainBody) |
$RawEmail | Raw undecoded Email including headers |
$ContentType | Content Type of message |
$ToAddresses | Array reference to all To header contents (usually the same as $ToEmailAddress) |
$FromAddresses | Array reference to all From header contents (usually the same as $FromEmailAddress) |
$CCAddresses | Array reference to all CC header contents |
$ReceivedHeaders | Array reference to all Received header contents (contains list of servers mail went through) |
$PlainBody | Email body. In text/html content type this contains the plaintext stripped of any HTML tags |
$HTMLBody | Email body for text/html content type |
$EmailObject | Email::MIME object representing the email. For advanced parsing operations only |
$discard_flag | Flag for discard (0 = No, 1 = Yes) |
$Count | Message Counter |
$CustomHash | Custom key, value cache available across all rules. Contents commonly defined in Load Rules then used in Base or other rules. NOTE: This variable is a shared object and any additional sub hashes or arrays must be shared before use or it will cause the error: Invalid value for shared scalar. Instantiate the sub hash/array using '&share({})' e.g. $CustomHash->{SubObject} = \&share({}); |
Example Integration
In the below example, a section of logic was added so that emails that have Example in the subject line will be processed. For each of those emails, the body will be parsed and the Node and Status values will be extracted. The default event fields are then modified with those values, along with setting the SubMethod. If the Status contains Down, an event is created with Severity set to 5 (Critical). If the Status contains Up, an event is created with Severity set to 0 (Clear), which will also clear the previous Down event.
elsif ($SubjectOfMessage =~ /Example/) {
$Event->{'SubMethod'} = "Example Email";
(my $Device, $Status) = $BodyOfMessage =~ /Device:(.*) Status:(.*)/;
if($Status eq 'Up'){
$Event->{Severity} = 0;
}
elsif($Status eq 'Down'){
$Event->{Severity} = 5;
}
$Event->{'Node'} = $Device;
$Event->{'Summary'} = "$SubjectOfMessage - $Device is $Status";
}
Administration Details
The following list shows the technical details you will need for advanced administration of the application:
-
Package: coreCollection-app
-
Package:
./Emaild [OPTIONS]
-
Options:
-c, --AppConfigID N Application Config ID (Service, Job, or Request ID) -?, -h, --Help Print usage and exit
-
Threaded: Multithreaded