It is a most unpredictable piece of code. I have outlook installed on three different devices with two IMAP accounts on each with different providers.
On all three devices the inbox got stuck with the dreaded "getting new messages" , but on different days.
Deleting the app, rebooting the device, reinstalling and reconfiguring the IMAP accounts worked on all three devices. Port numbers are specified in the advaced settings and I'm using special characters in the IMAP passwords
On one device the inbox gave "getting new messages" again for hours in the evening last week, but the inbox was back in the morning.
Since then the app has had no hick-ups on any of three devices. I keep my fingers crossed.
I cannot understand why a respectable company like Microsoft doesn't provide better support and an explanation of what is gong on with their outlook app.