Based on __Microsoft Graph REST API__ ( More info: [Message Resource Type Link| https://docs.microsoft.com/en-us/graph/api/resources/message?view=graph-rest-1.0]).\\
\\
__!!! Proxy Configuration:__ If your server accesses the internet through a proxy, make sure to whitelist the following domains to allow authentication and Microsoft Graph API access:\\
	•	login.microsoftonline.com\\
	•	graph.microsoft.com\\
\\
!Microsoft Graph Application Registration
\\
It requires Microsoft Graph Application registration. Start at the Microsoft Azure portal:\\
[https://azure.microsoft.com/en-us/features/azure-portal/]\\
\\
\\
Open the __Microsoft Azure Portal__: [Link|https://azure.microsoft.com/en-us/features/azure-portal]\\
\\
__Application registration:__ Navigate to App registrations in the Azure Portal. Click on __New registration__ to create a new application.\\
\\
[SharePoint Integration|new_registration.png]\\
\\
The Redirect URL must end with __"register_microsoft_graph_api/"__.\\
\\
{{{

    http://localhost:9090/register_microsoft_graph_api/

}}}\\
or
{{{
    
    https://your.crushftp.domain.com/register_microsoft_graph_api/
    
}}}\\
\\
__Secret key__: A new client secret must be created. Go to Certificates & secrets, and generate a new client secret by clicking on New client secret. Ensure you copy over the __value__ immediately!\\
\\
[SharePoint Integration/new_secret.png]\\
\\
[SharePoint Integration/secret_value.png]\\
\\
\\
__API permissions__ :\\
\\
Go to __API permissions__, click __Add a permission__, and select __Microsoft Graph__. Then choose __Application permissions__ and add the following permissions:\\
\\
[attachments|permission_microsoft_graph.png]\\
[attachments|permission_app_permissions.png]\\
[attachments|permission_user.png]\\
[attachments|permissions_mail.png]\\
\\
To grant permission for CrushFTP click on the "Get Admin consent" button. Make sure your Webinterface host and port match with the host and port specified in the App registration's redirect URL.\\
\\
[attachments|admin_consent.png]\\
[attachments|client_id.png]\\

\\
You need to log in with an admin account and grant permissions for your CrushFTP. Any changes on Azure App Registration -> API permissions require new admin consent.  
\\
!Settings\\
\\
[attachments|mail_task.png]\\
\\
Client ID, Client Secret, Tenant: Authentication-related setting. Azure App registration -> Overview.\\
Folder: Supports subfolders too like Folder/Subbolder/SubSubFolder\\
Search query: Search settings for messages. See [https://docs.microsoft.com/en-us/graph/query-parameters#search-parameter].\\
After processing copy message to this mailbox: Supports subfolders too.\\
\\
Variable patterns:\\
\\
Message-related variables:\\
{{{
{mail_id}, {mail_createdDateTime}, {mail_lastModifiedDateTime}, {mail_hangeKey}, {mail_sentDateTime}, {mail_receivedDateTime}, {mail_hasAttachments}, {mail_internetMessageId}, {mail_subject}, {mail_body_content}, {mail_body_type}, {mail_importance}, {mail_parentFolderId}, {mail_conversationId}, {mail_isRead}, {mail_isDraft}, {mail_sender}, {mail_from} , {mail_to}, {mail_cc}, {mail_bcc}, {mail_reply_to}
}}} \\
\\ 
Attachment-related variables:\\
{{{
{id}, {contentType}, {size}, {name}, {lastModifiedDateTime}
}}}