Monitored Inbox Settings not working for office365 and gmail

Your software
My PHP version is : 7.4.23
My Mautic version is : 4.4
My MySQL/MariaDB version is (delete as applicable): 10.3.37-MariaDB-0ubuntu0.20.04.1

Your problem
My problem is : In Monitored Inbox Settings IMAP configuration is not working for office365,gmail.
Please let us know how we can configure Monitored Inbox Settings to fetch bounce mail.
Awaiting for you reply.