<emailboxes xmlns="http://schemas.cordys.com/1.0/email/configuration">
  <emailbox>
    <name>Gmail</name>
    <!--Use this as "username" to authenticate against Google itself!-->
    <username>OPA@gmail.com</username>
    <!--Dont't use the real password, but use an 
    "apppassword" https://myaccount.google.com/apppasswords-->
    <password>xxxx xxxx xxxx xxxx</password>
    <folders>
      <!--Make sure you have this as new label available within 
      your Gmail mailbox and create a rule when when `@opentext.com` 
      is in the header references it applies this label-->
      <folder>OPA_REPLY</folder>
    </folders>
    <triggers>
      <trigger appliesTo="OPA_REPLY">
        <name>OPA_REPLY</name>
        <priority>1001</priority>
        <rules>
          <rule section="SUBJECT">
            <pattern type="REGEX">
              <value>.+</value>
              <store>
                <token>
                  <name>Subject</name>
                  <value>0</value>
                </token>
              </store>
            </pattern>
          </rule>
          <rule section="TO">
            <pattern type="REGEX">
              <value>.+</value>
              <store>
                <token>
                  <name>To</name>
                  <value>0</value>
                </token>
              </store>
            </pattern>
          </rule>
          <rule section="FROM">
            <pattern type="REGEX">
              <value>.+</value>
              <store>
                <token>
                  <name>From</name>
                  <value>0</value>
                </token>
              </store>
            </pattern>
          </rule>
          <rule section="MULTIPART">
            <pattern type="CUSTOM">
              <value>com.eibus.applicationconnector.email.sample.Base64Plugin</value>
              <store>
                <token>
                  <name>Base64Attachment</name>
                  <value>string</value>
                </token>
              </store>
            </pattern>
          </rule>
        </rules>
        <message>
          <method>receiveEmail</method>
          <namespace>http://schemas.cordys.com/entity/email/1.0</namespace>
          <!--Use a correct DN from the 'User Manager' artifact executing this method!-->
          <user>cn=sysadmin,cn=organizational users,o=opa_tips,cn=cordys,cn=defaultInst,o=25.1.com</user>
          <!--Always use TRUE...don't shoot the messenger-->
          <sync>true</sync>
          <namespacemappings>
            <namespacemapping>
              <prefix>ns</prefix>
              <namespace>http://schemas.cordys.com/entity/email/1.0</namespace>
            </namespacemapping>
          </namespacemappings>
          <input xmlns:ns="http://schemas.cordys.com/entity/email/1.0">
            <ns:from />
            <ns:subject />
            <ns:body />
          </input>
          <mappings xmlns:tns="http://schemas.cordys.com/1.0/email/configuration">
            <mapping>
              <source>.//ns:from</source>
              <value src="From" />
            </mapping>
            <mapping>
              <source>.//ns:subject</source>
              <value src="Subject" />
            </mapping>
            <mapping>
              <source>.//ns:body</source>
              <value src="Base64Attachment" />
            </mapping>
          </mappings>
        </message>
      </trigger>
    </triggers>
    <!--These two settings are also for me an open question to investigate-->
    <automaticrestart xmlns:tns="http://schemas.cordys.com/1.0/email">true</automaticrestart>
    <restartinprogress xmlns:tns="http://schemas.cordys.com/1.0/email/configuration">false</restartinprogress>
  </emailbox>
</emailboxes>