Configuring an Incoming Mailbox

To be able to create entities, from incoming emails, it is necessary to define an incoming mailbox, and then associate this mailbox to related email rules.

This guide will explain how to configure an IN mailbox.

Important Note: based on the settings of your email server, all incoming messages could be deleted after Deepser has processed them. This is the default behaviour of the software with email servers like Exchange, Standard SMTP Servers, etc.

Be very careful when configuring the incoming email integration, do a test and a backup. Remember also that Deepser processes all the emails in the inbox, so if the mailbox is full of messages (eg: the first time we run the integration) a lot of records could be created.

To avoid this situations, not directly caused by Deepser, we advise always to do a test on mailboxes with few messages.


To configure a mailbox within Deepser, in the backend navigation menu, navigate to the System->Tools->Email->Mailbox section.

The grid in this section shows already configured mailboxes.

To configure a new mailbox click on the ‘+ Add Mailbox‘ button in the top right corner.

At this point the mailbox configuration form will appear.

Once the mailbox type has been set, in this case ‘IN‘, all the relevant fields will be loaded dynamically.

The fields in the form have the following meaning:

GENERAL DATANameName of the mailbox. It is the name used in the select-boxes.
TypeIN o OUT (IN to receive emails, OUT to send).
StatusIf “Disabled” the integration will not be considered by the system.
HostAddress of the mailserver.
PortPort for the connection to the mailserver.
EncryptionEncryption of the connection..
UsernameUser name to read the mailbox (usually it is the email or the Exchange user associated to that mailbox).
PasswordPassword to login to the mailbox.
ProtocolProtocol to get the emails (POP3, IMAP or OWA).
OAuth ClientOAuth2 client used for the authentication, if required.
SITEMA DATAModelThe field Model represents the entity of Deepser in which to look for a record linked to the received emails. If we set for example DeepService – Operation the mailbox will create and update records of Operations. If we set DeepAdmin – User the emails will used to create or update users.
Model FieldIt is the field of the entity Model where to check if a record already exists. If we set the ID (field: entity_id), then the check will be done on entity_id (unique ID) of the Operations.
PrefixIt’s the prefix we prepend to the Model Field, to search the record. If we set the Model Field equals entity_id of the Operation, then the email integration verifies the subject of the email: if after the Prefix there’s an ID of a record already in the system. After the expression Prefix and until the first blank space, the ID of the model will be searched. Thus, if we set the field Prefix with the value TICKET# and the Model Field with the value entity_id, if we receive an email with subject TICKET#70, then Deepser looks for an Operation with ID 70. If Deepser finds that record, then the record is updated and the rules applyed to update the record are that in the Update Expression field. If we receive an email with a subject Hey this is a new ticket then Deepser creates a new record, following the rules in the field Create Expression.
Outgoing Email BoxWe can teel the system that for every record created using this mailbox we will use the specific outgoing mailbox to send notifications.
Apply Email RulesIf yes related email rules are executed.
Allowed EmailsIf we can receive email from all emails or only from registerd users. Ignored mails will be deleted.
Spam ExpressionIn this field it’s possible to define a regular expression to check the objects of incoming mails in case they should be identified as spam. If the emails are ignored they are deleted from the inbox.
ADVANCEDCron ExpressionCron Expression that defines the frequency of the scan of Deepser. If this expression is not set, this mailbox will not be processed by Deepser.
Processed onDate and time of the last scan of the mailbox.
 Custom CodePHP custom code run after the email has been received. It is possible to configure this field to trigger custom events after the email has been received. For example, if we want to receive a counter of the reminders or to update a specific entity of Deepser after we have received the email, we can customize this field to do that.

Once the form has been filled and the configuration saved, click on the ‘Check‘ button, top right, to test the configuration.

If the mailbox has been configured correctly you will see a message of successful connection, otherwise an error message.