If you get below error when using Outlook 2010 or 2013 to connect to server with IMAP:
Kindly follow below solution to overcome the error:
1. Navigate to File >> Options >> Advanced >> scroll down to the send/receive heading >> click on the send/receive button on the right
2. On the right hand side of the send/receive groups window that opens click on the Edit button
3. Un-check the "Get folder unread count for subscribed folders"
4. Under Received mail items, check the option "User the custom behavior defined below"
5. In the window below that displays your Gmail folders just select inbox and leave the others unchecked
6. Click Ok and then exit out of options and perform a send/receive to test if it is now working.