Email processor (email)
Description
Processor for exchanging email messages with mail servers.
Provides communication with mail servers (IMAP, STMP). Monitors included IMAP directories, places messages received from senders in the data model collection /rest/v1/model/email/Messages, and sends `sending` messages created in it to recipients via SMTP.
Forms collections/classes: email/Profiles, email/Accounts, email/Folders, email/Messages. Allows their further modification in the direction of extending the composition of properties and variants of values of enumerated fields.
Interaction with external business logic is performed using message statuses (`sending`, `sent`, `error`, `received`, `raw`).
Code |
|
Mode of operation |
|
Backup mode |
|
Types of sites |
|
Layer |
|
Placement |
|
Saving and restoring state on reboot |
|
appendix |
|
Opportunities
-
Mail messages can be text, html, or contain both alternatives.
-
Attachments are saved as attachments to the entity email/Messages (file field) and are accessible via the /rest/v1/model/email/Messages/ID_MESSAGE/attachments.
-
HTML The content is also saved as an attachment in the html field and can be accessed via the /rest/v1/model/email/Messages/ID_MESSAGE/html.
-
All inlines (files used within HTML) are saved as attachments in the inlines field and can be accessed via the /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 accessible via /email/Message and accessible via the /rest/v1/model/email/Messages/ID_MESSAGE/rawMessage.
-
If a message cannot be parsed and decomposed by fields, its uncompressed content is saved and a special status is set `raw`
-
When an account is created (/rest/v1/model/email/Accounts) and there is a corresponding profile (/rest/v1/model/email/Profiles), it surveys the composition of directories and places them in the collection email/Folders). Polls the composition of directories and places them in the collection email/Folders). Once the directory is turned on, it is monitored for incoming messages, as well as monitoring the email/Messages collection with a filter on the directory for messages ready to be sent.
Limitations
-
Works in the mode of periodic polling of the IMAP server for incoming messages. The default timeout between polls is 30 seconds. It is controlled by the `after_read_timeout` value in the options field in descending order: /email/Folder, /email/Account, /email/Profile.
-
The `deleteOnServer` parameter of the directory entity is responsible for deleting emails in the IMAP directory.
Parameters
Configuration example
The configuration is managed in an application available to master domain administrators. The application hides the full content of the configuration, but it is nevertheless accessible via the API.
The configuration contains a section to describe all instances of all roles. Parameters are defined for each specific role instance.
{
"name": "im1",
"roletype": "im",
"iface": "eth0",
"group": 11330,
"order": 1
}