---
title: Development Guidelines
slug: en/development-guidelines
description: Learn how to configure POP3, SMTP, and IMAP email services with this document. Discover step-by-step instructions on creating email accounts and applications in Microsoft Azure, setting permissions and access, configuring ActiveMQ queues, and creating fil
docTags: 
createdAt: 2023-03-02T11:29:56.000Z
---

This implementation does not substitute the previous **POP3**, **SMT**, an&#x64;**&#x20;IMAP** integration for other e-mail services. It can also be parametrized for being utilized simultaneously with those integrations.

# Configuration

The following steps must be accomplished in their presented order:

# Infrastructure

## Azure parametrization

Inside Microsoft Azure:

- Create or choose an e-mail to be utilized by the system in these integrations; It is not necessary to be a specific e-mail account. However, the user must be aware that the e-mail readout and dispatch can modify and pollute the mail inbox; so the user must create rules and folders for messages clearing and organization, so the work of one does not interfere with another.
- Create or choose an application from this e-mail account, in Azure Active Directory. It will be used for e-mail readout and dispatch.

![](https://api.archbee.com/api/optimize/pu5VMc-2TW3GQX4ly5Xp7/zlAleJNn-I30eAZk2Xluz_image.png)

![](https://api.archbee.com/api/optimize/pu5VMc-2TW3GQX4ly5Xp7/YmT8xxuCWpSI_GsR4JWii_image.png)

![](https://api.archbee.com/api/optimize/pu5VMc-2TW3GQX4ly5Xp7/--JIptUseyMcenlZCLtLC_image.png)

![](https://api.archbee.com/api/optimize/pu5VMc-2TW3GQX4ly5Xp7/647PGRgpRSZMilc0K1VbD_image.png)

- Set the following permissions:

![](https://api.archbee.com/api/optimize/pu5VMc-2TW3GQX4ly5Xp7/g097cmw8cei8czftZYpdf_image.png)

- Set the application access to the email account that will be used:

![](https://api.archbee.com/api/optimize/pu5VMc-2TW3GQX4ly5Xp7/4Mn7fGZihEAjUg-LJJsxl_image.png)

- Allow the public-client flow for the application:

![](https://api.archbee.com/api/optimize/pu5VMc-2TW3GQX4ly5Xp7/WiXrjlzM4IcL4IeYrM1TG_image.png)

- **APP ID**: Save this ID for future configuration.

![](https://api.archbee.com/api/optimize/pu5VMc-2TW3GQX4ly5Xp7/N0pe1OjctSOGFYBQhqwJ5_image.png)

- **Folders for e-mail readout**: If the user wishes to define filtering folders and rules for the mail inbox readout, they must be created at this point. In the first Graph Mail Project version, the sweep for identifying the folders is only realized as it launches.

## Service Management

### WildFly 1.1.2

**ActiveMQ user**

Set a user to have access to the ActiveMQ queues by executing the following command and parametrizing a secure password for the option "-p", according to your environment:

`sh add-user.sh -a -u jmsuser -p 1 -g guest`

**ActiveMQ queues**

The e-mail readout and dispatch queues must be set in the WildFly configuration file, the standalone.xml file, for example. Add the tags with the names of the queues inside the main tag: `<subsystem xmlns="urn:jboss:domain:messaging-activemq:3.0">`

**Example:**

:::BlockQuote
\<jms-queue name="graphMailQueue" entries="queue/graphMailQueue
java\:jboss/exported/jms/queue/queue/graphMailQueue"/>
:::

:::BlockQuote
\<jms-queue name="readGraphMailQueue"
entries="queue/readGraphMailQueue
java\:jboss/exported/jms/queue/queue/readGraphMailQueue"/>
:::

**System Properties**

For the Service Management project to upload the listeners, who will listen to the e-mail readout queues, it is necessary to set the following property:



:::BlockQuote
\<property name="jms.readGraphMailQueue.list" value="readGraphMailQueue"/>
:::

In the tag `<system-properties>` of standalone.xml it is possible to name a queue multiple times to be heard, only by separating with a coma.

### File Sharing

**Folder for sharing images and file attachments**

**A folder must be created** and the **writing** and **readout** **permissions must be set** on the application server, for the volume mapping of the docker containers, which will upload the applications. Thus it will allow the sharing of files between them. This folder will be used for the compose files and in **parameter 479**.

## Graph Mail Parametrization

### Docker

The correct file localization in the docker-compose.yml file from the Graph Mail Project must be set. Also, set the defined folders for image and attachment sharing.

:::BlockQuote
version: '2.2'

**services:**
  citSOLR:
    container\_name: citSOLR
    image: registry.cloud4biz.com/templates/solr\:latest
    command: solr-create -c base\_conhecimento -d base\_conhecimento\_configs

  citTIKA:
    container\_name: citTIKA
    image: registry.cloud4biz.com/templates/tika\:latest
    command: tika.sh
    ports:
    - 9998:9998

  graphmail:
    image: registry.cloud4biz.com/templates/graphmail:1.1.2 
    container\_name: graphmail
    restart: on-failure
    depends\_on:
        - "CITSMART"

    volumes:
    - /storage/my4biz/attachments\:/opt/attachments/
    - /storage/my4biz/config.properties\:/opt/graphmail/config.properties

 CITSMART:
    container\_name: CITSMART
    image: registry.cloud4biz.com/templates/itsmops:2.2.9 
    links:
    - citSOLR
    - citTIKA

    environment:
    - XMS=9600
    - XMX=9600
    - MIN\_POOL\_SIZE=10
    - MAX\_POOL\_SIZE=600
    - STATISTICS\_ENABLE=true
    - BLOCKING\_TIMEOUT\_MILLIS=60000
    - IDLE\_TIMEOUT\_MINUTES=2
    - GC\_CLIENT\_INTERVAL=1800000
    - GC\_SERVER\_INTERVAL=1800000
    - PARALLELGCTHREADS=4
    - ADMIN\_USER=seuuser
    - ADMIN\_PASS=QSPLwso497665kderfij
    - DB\_CITSMART=db\_seubanco
    - JB\_CONFI\_XML=standalone-full-ha.xml
    - TIME\_ZONEAmerica/Fortaleza
    - DB\_HOST=10.10.10.20
    - DB\_USER=seuuser
    - DB\_PASSWORD=QSPLwso497665kderfij
    - DB\_PORT=5432
    - CITSMART\_URL=10.10.10.30
    - GRAPHMAIL\_READ=readGraphMailQueue
    - SOLR\_URL=citSOLR
    - ENABLE\_SSL=yes
    - VALID\_SSL=yes
    - CERT\_KEY\_FILE=seucertificado.jks
    - CERT\_FILE=seucertificado.com.crt
    - CERT\_PASSWORD=789321456
    - CERT\_ALIAS=seualias
    - TIMEOUT\_DEPLOY=60000
    - EVM\_ENABLE=false
    - INV\_ENABLE=false
    - MONGODB\_HOST= #citmongo
    - MONGODB\_PORT= #27017
    - MONGODB\_USER= #admin
    - MONGODB\_PASSWORD= #admin
    - ESPER\_THREADS=4
    - CITSMART\_PROTOCOL=http
    - CITSMART\_LOGIN=consultor
    - CITSMART\_PASSWORD=P\@ssW0rd
    - CITSMARTINV\_ID=citsmartinventory
    - CITSMARTEVM\_ID=citsmartevm
    - CITSMART\_HTTP\_PORT=8080
    - ENABLE\_NEURO=Yes

\#### IVM and EVM Parameters
    - START\_MONITORA\_INCIDENTES=FALSE
    - JDBC\_ALIAS\_REPORTS=
    - JDBC\_ALIAS\_BPM=
    - JDBC\_ALIAS\_BPM\_EVENTOS=
    - START\_VERIFICA\_EVENTOS=FALSE
    - QUANTIDADE\_BACKUPLOGDADOS=1000
    - START\_MODE\_RULES=FALSE
    - START\_MODE\_ITSM=FALSE
    - INICIAR\_PROCESSAMENTOS\_BATCH=TRUE
    - DBQUARTZ=STANDALONE

\##### Deploys
    - CITSMART\_APP=Helium-2.3.3.war
    - CITNEURO\_APP=citsmart-neuro-builder-1.3.7.7.war
    - CITPROFILE\_APP=
    - CITSMARTEVM\_APP=
    - CITSMARTINV\_APP=
    - CITAUDIT\_APP=
    - EVM\_INV\_ONLY=No

    # If EVM\_INV\_ONLY=Yes you need to set FULL\_STACK=Yes
    - FULL\_STACK=Yes
    - LOG\_LEVEL=INFO
    - DB\_SYSTEM=postgres
    - ITSM\_FLAVOR=citsmart

    ports:
    - 8080:8080
    - 443:8443
    - 9990:9990

    volumes:
    - /storage/my4biz/deploys\:/opt/deploys
    - /storage/my4biz/citsmart:/opt/citsmart
    - /storage/my4biz/certs\:/opt/wildfly/certs
    - /storage/my4biz/log:/opt/wildfly/standalone/log
    - /storage/my4biz/mp4:/opt/wildfly/mp4
    - /storage/my4biz/assets\:/opt/wildfly/assets
    - /storage/my4biz/attachments\:/opt/attachments/
:::

![](https://api.archbee.com/api/optimize/pu5VMc-2TW3GQX4ly5Xp7/zjcNOXXIHDUbahrK5c_Ks_image.png)

### Config File

The following properties must be set in the config.properties file of the Graph Mail Project, according to the client scenario:

:::BlockQuote
*JMS\_CONNECTION\_FACTORY\_JNDI = jms/RemoteConnectionFactory
JMS\_WILDFLY\_REMOTING\_URL = http-remoting://172.18.0.4:8080
JMS\_QUEUE\_JNDI = jms/queue/queue/graphMailQueue
JMS\_READ\_MAIL\_QUEUE\_JNDI = jms/queue/queue/readGraphMailQueue
JMS\_USERNAME = jmsuser&#xA;*&#x4A;MS\_PASSWORD = 352TEDDWtHpfRObR166VOuOBI1F4
GRAPH\_APP\_ID = 51255c25-165446-25d5sd5d5-dssdsd
GRAPH\_USERNAME = [seue-mail@seudominio.gov.br](#)
GRAPH\_PASSWORD = QsPlWSOK
GRAPH\_MAIL\_FOLDERS\_LIST = Inbox
:::

### Dependency

The Graph Mail Project depends on the Service Management project, so it should only be executed when the Service Management one is running.

**Functioning**

- A Thread or Job:
  - Obtains the e-mail messages occasionally and extracts the: **sender**, **subject**, **body**, and **attachments&#x20;**&#x66;rom the parameterized list of folders;
  - Registers messages received in a specific queue for registration of tickets in WildFly, containing the name of the folder, the queue, and the content of the email, including the list of attachments;
  - Etches the attachments to a mapped folder on a volume that SM is able to access;
  - Performs the "Email control procedure":
    - Processing control: the system reads a predefined folder, allowing the user to create filtering rules, specific to the ticket registration. It can be an incident, problem, change or release ticket: what determines it is the automatic action registration;
    - ﻿<font color="#ff0004">Destination of the processed message: the system marks the already processed message as read.﻿</font>
    - Mailbox sharing:&#x20;
      - It can be used by the user and the system - if the folder for reading is implemented;
      - It will also be used for sending e-mails.

