Platform Administration
...
Automation
Graph Mail

Development Guidelines

14min

This implementation does not substitute the previous POP3, SMT, and 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.
Document image

Document image

Document image

Document image

  • Set the following permissions:
Document image

  • Set the application access to the email account that will be used:
Document image

  • Allow the public-client flow for the application:
Document image

  • APP ID: Save this ID for future configuration.
Document image

  • 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:

<jms-queue name="graphMailQueue" entries="queue/graphMailQueue java:jboss/exported/jms/queue/queue/graphMailQueue"/>
<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:

<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.

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/
Document image


Config File

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

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 JMS_PASSWORD = 352TEDDWtHpfRObR166VOuOBI1F4 GRAPH_APP_ID = 51255c25-165446-25d5sd5d5-dssdsd GRAPH_USERNAME = [email protected] 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 from 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;
      • Destination of the processed message: the system marks the already processed message as read.
      • Mailbox sharing:
        • 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.