Skip to content

Configuration file

A EmailRequest configuration file is where all settings for one or more mailbox integrations lives and is in XML format. Each mailbox integration is represented as an entry element. Each entry have a properties element, source element and destination element.

Basic structure

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <entries>
    <entry>
      <properties>
        <!-- One element for each property-->
        <property name="" value="" />
      </properties>
      <source type="">
        <properties>
          <!-- One element for each property-->
          <property name="" value="" />
        </properties>
      </source>
      <destination type="">
        <properties>
          <!-- One element for each property-->
          <property name="" value="" />
        </properties>
      </destination>
    </entry>
  </entries>
</configuration>

Properties (name - description)

  • displayName - Property value is used for logging purposes. Below is an example from a EmailRequest log.
    (Ex. YYYY-MM-DD HH:MM:SS,MS INFO - --- displayName --- (BEGIN) [com.easit.emailrequest.Application]
  • disabled - Indicated if the entry should be ignored by EmailRequest. Values: true / false. Default value = false. lockFilePath - Relative path where a lock file should live.
  • lockFileTTL - How long, in seconds, should the lock file be allowed to "live" before EmailRequest deletes it. Default value= 3600
    The lock file is always created and deleted for each mailbox each time EmailRequest is run. If the reading e.g. crashed for some reason, the lock file may remain to avoid us trying to download from it again.
  • maxMessagesToRetrieve - How many e-mails should EmailRequest retrieve and try to import from the mailbox. Default value = 20
  • displayErrorsAsWarning - If specified as true the following errors will be logged as warnings instead of errors: "There was an I/O exception!", "There was an error at the source!". Default value = false.

  • login - Username to use when logging on to mailbox.

  • password - Password use when logging on to mailbox. Note that there are 5 characters that are not allowed in the password and make the import not work, they are these: ' < > & " if any of these 5 characters are present then these characters must be replaced with a text line, read more here: http ://xml.silmaril.ie/specials.html i.e. if a password contains the character " then you should remove " and write &quot; instead.
  • host - URL to mail server. (E.g. pop3.company.com)
  • port - On what port should EmailRequest attempt to connect to the mail server. Default value = POP3: 110, IMAP4: 143
  • folderName" - Only supported / used with IMAP4 if EmailRequest should read e-mails from another folder than INBOX.
    To read from subdirectory: 'INBOX\mapp' or 'INBOX/mapp'.
  • tls - Specifies if TLS / SSL should be used or not. Default value = false
  • maxMessageSize - Specifies limit for how large e-mail can be that EmailRequest tries to read and import to Easit GO.
    Specified in bytes for POP3 and kb for IMAP4. (E.g. IMAP4 = 12288, POP3 = 12582912)
  • maxConnectionAttempts - How many times should EmailRequest attempt to reconnect to the mail server if the connections fails. Default value = 1.

  • mailbox - Specifies what importhandler in Easit GO the mails should be imported with.

  • destinationURL - URL to Easit GO.
  • clientName - Read friendly name of EmailRequest client. Recommended value: ER4

entry/properties

The following properties are mandatory for this element:

  • displayName
  • disabled
  • lockFilePath
  • maxMessagesToRetrieve

Optional properties:

  • displayErrorsAsWarning

entry/source - POP3

The following properties are mandatory for this element:

  • Source element MUST have a attribute named type with a value of POP3
  • host
  • login
  • password

Optional properties:

  • port
  • maxConnectionAttempts
  • authenticationMethod
  • tls
  • maxMessageSize

entry/source - IMAP4

The following properties are mandatory for this element:

  • Source element MUST have a attribute named type with a value of IMAP4
  • host
  • login
  • password

Optional properties:

  • port
  • maxConnectionAttempts
  • folderName
  • statePre
  • statePost
  • tls
  • maxMessageSize

entry/destination

The following properties are mandatory for this element:

  • Destination element MUST have a attribute named type with a value of EMS3
  • mailbox
  • destinationURL
  • clientName

Examples

One mailbox configuration

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <entries>
    <entry>
      <properties>
        <property name="displayName" value="IMAP4Test" />
        <property name="disabled" value="true" />
        <property name="lockFilePath" value=".\Lock_Dir\imap4test.lock" />
        <property name="lockFileTTL" value="1800" />
        <property name="maxMessagesToRetrieve" value="15" />
      </properties>
      <source type="IMAP4">
        <properties>
          <property name="login" value="imap4test" />
          <property name="password" value="imap4test" />
          <property name="host" value="mailserver" />
          <property name="folderName" value="INBOX" />
          <property name="port" value="143" />
          <property name="tls" value="false" />
          <property name="maxMessageSize" value="12288" />
          <property name="maxConnectionAttempts" value="3" />
        </properties>
      </source>
      <destination type="EMS3">
        <properties>
          <property name="mailbox" value="imap4test@kund" />
          <property name="destinationURL" value="http://localhost:8080/import?apikey=[APIKEY]" />
          <property name="clientName" value="ER4" />
        </properties>
    </destination>
    </entry>
  </entries>
</configuration>
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <entries>
    <entry>
      <properties>
        <property name="displayName" value="POP3Test" />
        <property name="disabled" value="false" />
        <property name="lockFilePath" value=".\Lock_Dir\pop3test.lock" />
        <property name="lockFileTTL" value="1800" />
        <property name="maxMessagesToRetrieve" value="10" />
      </properties>
      <source type="POP3">
        <properties>
          <property name="login" value="pop3test" />
          <property name="password" value="pop3test" />
          <property name="host" value="mailserver" />
          <property name="port" value="110" />
          <property name="tls" value="false" />
          <property name="maxMessageSize" value="12582912" />
          <property name="maxConnectionAttempts" value="3" />
        </properties>
      </source>
      <destination type="EMS3">
        <properties>
          <property name="mailbox" value="pop3test@kund" />
          <property name="destinationURL" value="http://localhost:8080/import?apikey=[APIKEY]" />
          <property name="clientName" value="ER4" />
        </properties>
    </destination>
    </entry>
  </entries>
</configuration>

Multiple mailbox configuration

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <entries>
    <entry>
      <properties>
        <property name="displayName" value="POP3Test" />
        <property name="disabled" value="false" />
        <property name="lockFilePath" value=".\Lock_Dir\pop3test.lock" />
        <property name="lockFileTTL" value="1800" />
        <property name="maxMessagesToRetrieve" value="10" />
      </properties>
      <source type="POP3">
        <properties>
          <property name="login" value="pop3test" />
          <property name="password" value="pop3test" />
          <property name="host" value="mailserver" />
          <property name="port" value="110" />
          <property name="tls" value="false" />
          <property name="maxMessageSize" value="12582912" />
          <property name="maxConnectionAttempts" value="3" />
        </properties>
      </source>
      <destination type="EMS3">
        <properties>
          <property name="mailbox" value="pop3test@kund" />
          <property name="destinationURL" value="http://localhost:8080/import?apikey=[APIKEY]" />
          <property name="clientName" value="ER4" />
        </properties>
      </destination>
    </entry>
    <entry>
      <properties>
        <property name="displayName" value="IMAP4Test" />
        <property name="disabled" value="true" />
        <property name="lockFilePath" value=".\Lock_Dir\imap4test.lock" />
        <property name="lockFileTTL" value="1800" />
        <property name="maxMessagesToRetrieve" value="15" />
      </properties>
      <source type="IMAP4">
        <properties>
          <property name="login" value="imap4test" />
          <property name="password" value="imap4test" />
          <property name="host" value="mailserver" />
          <property name="folderName" value="INBOX" />
          <property name="port" value="143" />
          <property name="tls" value="false" />
          <property name="maxMessageSize" value="12288" />
          <property name="maxConnectionAttempts" value="3" />
        </properties>
      </source>
      <destination type="EMS3">
        <properties>
          <property name="mailbox" value="imap4test@kund" />
          <property name="destinationURL" value="http://localhost:8080/import?apikey=[APIKEY]" />
          <property name="clientName" value="ER4" />
        </properties>
      </destination>
    </entry>
  </entries>
</configuration>