When configuring ITPAM to connect to a remote mailbox, it is best to start by the reviewing our provided documentation.
The basic steps are found in the release notes for ITPAM 4.3.05 CP08, and ITPAM 4.4 CP02. This document adds a little more detail to the instructions already given.
IT Process Automation 4.3 SP05 CP06 or higher and 4.4 CP02 or higher
Azure Mailbox using OAuth to connect to PAM to handle mail
Install-Module -Name ExchangeOnlineManagement
Import-module ExchangeOnlineManagement
Connect-ExchangeOnline -Organization <tenantId>
$MyApp = Get-AzureADServicePrincipal -SearchString "ITPAM Mail Trigger"
New-ServicePrincipal -AppId $MyApp.AppID -ServiceID $MyApp.ObjectId -DisplayName "Service Principal for IMAP APP"
Add-MailboxPermission -Identity "xxx@yyyy.onmicrosoft.com" -User $MyApp.ObjectId -AccessRights FullAccess