1. First page
  2. Documentation
  3. Administration Manual
  4. Document Exchange
  5. Sending and receiving rules
  6. IMAP Exchange

IMAP Exchange

IMAP Exchange protocol is used to receive documents via e-mail. With these instructions, you create rule that can properly convert the received message into a received document.

The rule is created using the Add button. If we have already created the corresponding rule, we can simply copy the rule for the next partner and correct the data.

First, the rule asks us for which protocol we want to create the rule:

Figure 1: Protocol selection when creating a receive rule

In the next step, we define the conditions that must be met for the program to recognise the rule. If the conditions are not present, the system moves the message to the UNKNOWN folder. If the conditions are present but incorrect, the system moves the message to the REJECTED or ERROR folder

Read more about this in Exchanging documents by email.

Figure 2: Conditions for receiving email
  • Sender Addresses:
    • enter the sender address of the message here, separated by a comma if there are more than one.
    • We can also use a pattern where the rule considers only the sender’s domain. The pattern is written in the form <*@domain.com>
    • If you want a general receipt, use the <*> pattern. In this case, the sender name is filled in manually or via a script (example below).

      Move mouse cursor over field to reveal helpful tooltips.
  • Recipient’s address:
    • Enter only if received email will contain several recipient addresses.
  • Subject contains:
    • The system can also separate documents by subject. If necessary, e.g. if the subject of the message is “Invoice for services rendered 102/2020”, the Invoice* pattern can be entered.
    • Blank field will accept all subjects.

The next step allows us to define in even more detail what we expect in the received message:

Figure 4: IMAP protocol settings
  • Multiple documents:
    • Check only if we expect several documents of the same type with the same message (e.g. we expect 3 invoices). One document can consist of a pair of two files – pdf and xml, but it is still only one document.
  • Content as display:
    • The content of an email message can be used as a display of the document in the system. This is only used when the document to be displayed is not sent as an attachment in the message itself.
  • Presentation filename pattern:
    • Define which file is used to display the data – usually a .pdf file. The <*.PDF> pattern is entered, which means that the system will use the .pdf file from the received message for the display. If there are multiple .pdf documents in an email, you must specify pattern which document is intended for presentation.
  • Data filename pattern:
    • Define the data file that corresponds to the .pdf display file. This is usually an .xml file. It is entered in the form of a sample <*.xml>.
  • Send confirmation:
    • We require our web server to automatically send a confirmation of receipt of a message when it is successfully imported by the system.
  • Content as attachment:
    • We attach the content of the received message to the document in EBA DMS as an attachment.
  • Data as attachment:
    • We attach the received data file (XML) to the document as an attachment.
  • Presentation same name:
    • Indicate if the display and data files have the same name – e.g. invoice_120_2020.pdf and invoice_120_2020.xml.
      Must be turned on if the first setting of this assembly or defined (multiple documents) so the EBA DMS system can make corresponding pairs of pdf and xml files into a single document.

Now we have to select the data owner (for multicompany) and the partner – the sender of the message.

Figure 5: Setting the owner and the partner

In case you have only one company in the system, then the data owner is set automatically, otherwise you have to define it manually.

  • Unknown partner:
    • Select when you do not want to define the partner automatically. We have to do this later in the scanner room.
  • Select partner
    • Select the partner who sent us the document from internal Addressbook.
  • Script
    • We define the partner using a script.
  • Query
    • We define the partner by querying the selected database.
Example of a query:

In the Query field, enter a query that can be used to retrieve the sender’s name from the database based on the information read by the system on the document. In this case, the sender’s name is selected according to the e-mail address entered in the internal address book. Of course, we need to keep the adressbook up-to-date.

Databases are configured in the general settings.

select email from eba_addressbook where email='%1'
Figure 6: Example of a query where we define the sender of a message

The next step is to define the document type of the received message:

Figure 7: Defining the document type

If we receive different document types in the same message from the same sender, we can select the option “Unknown document type” here, but this means that we will have to define the document type in the scanner.

The rest of the settings follow:

  • Data format:
    • Select in case we have received an e-invoice and select the corresponding data catalogue.
  • Data conversion script:
    • Select in case we want to convert the received data with a script.
  • Prepare with form
    • Select in case we want to prepare the received document with a form.

Finally, we define the name of the rule – e.g. invoice from EBA d.o.o. Repeat the process for each sender, the rules can – if the messages sent are similar – be copied and only the partner’s information can be changed.

How can we help?