Email processor (email)
Description
Processor for exchanging email messages with mail servers.
Provides communication with mail servers (IMAP, SMTP). Monitors enabled IMAP folders and places messages received from senders into the data model collection /rest/v1/model/email/Messages, and sends messages created there with `sending` status to recipients via SMTP.
Creates collections/classes: email/Profiles, email/Accounts, email/Folders, email/Messages. Allows their further modification to extend the set of properties and the value variants of enumerated fields.
Interaction with external business logic is performed using message statuses (`sending`, `sent`, `error`, `received`, `raw`).
Code |
|
Operation mode |
|
Redundancy mode |
|
Site types |
|
Layer |
|
Placement |
|
State preservation and recovery on restart |
|
Application |
|
Capabilities
-
Email messages can be text, HTML, or contain both alternative variants.
-
Attachments are stored as attachments to the email/Messages entity (file field) and are available via /rest/v1/model/email/Messages/ID_MESSAGE/attachments.
-
HTML content is also stored as an attachment in the html field and is available via /rest/v1/model/email/Messages/ID_MESSAGE/html.
-
All inlines (files used within HTML) are stored as attachments in the inlines field and are available via /rest/v1/model/email/Messages/ID_MESSAGE/inlines.
-
When a message is received, its original RFC822 content is stored in the entity in the rawMessage field as an attachment and is available via /email/Message and via /rest/v1/model/email/Messages/ID_MESSAGE/rawMessage.
-
If a message cannot be parsed and decomposed into fields, its unparsed content is stored and the special `raw` status is set.
-
When an account is created (/rest/v1/model/email/Accounts) and a corresponding profile exists (/rest/v1/model/email/Profiles), it polls the folder composition and places them in disabled form in the email/Folders collection. After a folder is enabled, it is monitored for incoming messages, and the email/Messages collection is monitored with a filter by folder for messages ready to be sent.
Limitations
-
Operates in periodic IMAP server polling mode for incoming messages. The timeout between polls is 30 seconds by default. Controlled by the `after_read_timeout` value in the options field in descending order: /email/Folder, /email/Account, /email/Profile.
-
Deletion of messages in the IMAP folder is controlled by the `deleteOnServer` parameter of the folder entity.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
|
|
required |
Name. May consist of Latin letters and digits and must start with a letter. |
|
|
required |
Role type. Possible values: |
|
|
empty |
Additional role options. Contains a JSON object or list. |
|
|
empty |
Role activity flag. When set to false, the role does not participate in validation and is not started. |
|
|
empty |
Limit on the number of CPU logical cores used. Default: 0 - unlimited. |
|
|
empty |
Default logging level set specifically for the role instance (microservice type). More |
|
|
|
Flag allowing parameter differences in roles of the same group. Default: false - not allowed. |
|
|
required |
Group number. |
|
|
required |
Order of the role instance within the group. |
|
|
empty |
List of domain names served by this group. |
|
|
global |
Takeover mode switch.
|
|
|
Domain distribution group number. Instances with the same value share the domain subtree ( |
Configuration example
Configuration management is performed in an application available to master domain administrators. The application hides the full configuration content, but it is still available through the API.
The configuration contains a section describing all instances of all roles. Parameters are defined for each specific role instance.
{
"name": "im1",
"roletype": "im",
"group": 11330,
"order": 1
}