Professional Documents
Culture Documents
Graph Mail Documentation
Graph Mail Documentation
Graph Mail Documentation
Purpose
This program uses Azure Graph platform to send and read microsoft emails, Using Wildfly
ActiveMQ queue to comunicate with SM project. This integration can be used in the same time
with SM project's POP3, SMTP and IMAP configuration.
The e-mail reading is performed to trigger automatic actions in the SM project by sending e-mails
to a specific mailbox and filtering for a list of folders defined in the automatic actions register
and in the config: GRAPH_MAIL_FOLDERS_LIST.
Azure
It is necessary to register an APP on the Microsoft Azure platform and give the following
permissions:
Mail.Send
Mail.Send.Shared
Mail.Read
Mail.Read.Shared
Mail.ReadWrite
Mail.ReadWrite.Shared
WildFly
standalone.xml
user:
Create jms user for communication, command line example:
sh add-user.sh -a -u jmsuser -p 1 -g guest\
Queue config:
In config files, like standalone.xml in tag <subsystem
xmlns="urn:jboss:domain:messaging-activemq:3.0"> put ActiveMQ queue
config tag, one for send and another to read emails. 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:
We need to configure in standalone.xml, a system property to define dynamic listeners list for the
existing queues for receive emails from Graph-Mail project. Example:
<property name="jms.readGraphMailQueue.list" value="readGraphMailQueue,
readGraphMailQueue2, readGraphMailQueue3"/>\
SM - Service Management
or Mailbox screen:
• If you use e-mail boxes per contract, so configure them with one queue name for each mail
box and choose in Mail authentication type Microsoft Graph Mail
CONFIG_PROPERTIES_FILE_PATH\
• Description: full path to the settings file, including file name and extension\
• Example: ./home/run2biz/Documents/config.properties\
ATTACHMENTS_DIRECTORY\
• Description: directory used by citsmart/4biz to store files that are used as email
attachments\
• Example: /opt/attachments\
• Files: The files and sub-folders are deleted when the processing is finished.
IMAGE_GALLERY_DIRECTORY\
• Description: directory used by citsmart/4biz to store images that are used in
email construction\
• No need configuration! Will be automatically created inside the
ATTACHMENTS_DIRECTORY\
• Example: /opt/attachments/imageGallery\
• Files: The files are not deleted when the processing is finished. Because they
will be used again!
READ_FILE_DIRECTORY\
• Description: directory used by citsmart/4biz to store attachment files read to
send to SM project\
• No need configuration! Will be automatically created inside the
ATTACHMENTS_DIRECTORY\
• Example: /opt/attachments/readFile\
• Files: The files and sub-folders are deleted when the processing is finished.
Operation
Will Log
To aid in configuring Graph Mail, it recursively loops through and lists the folders found in the
mailbox:
[main] INFO br.com.mail.graph.thread.ThreadGraphMailReader - Existing folder:
XXXX
When the folders parameterized in the GRAPH MAIL FOLDERS LIST property are not found:
[br.com.mail.graph.thread.ThreadGraphMailReader] WARN
br.com.mail.graph.thread.ThreadGraphMailReader - Parameterized folders no found!