I am using Jira Service Management version 8.20.2. I am trying to create an issue through a mail receive handler. But it doesn't work properly.
https://confluence.atlassian.com/jirakb/imap-fails-with-a3-bad-user-is-authenticated-but-not-connected-error-in-jira-server-integrated-with-office365-665420269.
I tried a few things by looking at the html link.
1. Make sure "IMAP4" is added to Client Access Rules in O365, and when testing the input in O365 using Jira context, the test is completed successfully.

2. You can solve this problem by using OAuth 2.0, which is supported in Jira 8.10 and later.

But when I test the mail handler I get an error.
```
Messaging Exception in service 'com.atlassian.jira.service.services.mail.MailFetcherService$MessageProviderImpl' when getting mail: QE3 BAD User is authenticated but not connected.javax.mail.MessagingException: QE3 BAD User is authenticated but not connected.
The connection is no longer open, messages marked as deleted will not be purged from the remote server: outlook.office365.com until the next run.
```
I would appreciate it if you could tell me how to solve it.