JEMHC / O365 : The refresh token has expired due to inactivity

Tokens from Office365 for Mail retrieval and Sending must be kept active, if no usage occurs for 90 days they become expired, the JEMHC > Auditing > Events will show up as Send Failure (filter for Error status), the report accessed by the Cog on the right of each audit item will give access to the last Report, that will show something like:

Error: SimpleHttpClientException: EWS. invalid_grant - AADSTS700082: The refresh token has expired due to inactivity. The token was issued on 2020-04-16T13:23:20.9979808Z and was inactive for 90.00:00:00

 

Solving this requires you to currently do the following (being able to simply re-auth is in progress.

  1. Remove references to the O365 Outbound from all Notification Mappings using it and select an alternate mail server (you may need to create another temporarily, it can’t be the ‘same’).

  2. Delete the O365 Outbound

  3. Recreate the O365 Outbound, reauthorizing.

  4. Update Notification Mappings to use the new outbound.