Why do so many IMAP providers not work properly with Mail.app?
You might want to avoid things like Notes, Calendars &amp; Reminders as these try to create folders on you IMAP server and put data from your Notes.app and Calendar.app in those folders that the IMAP server may not like. At least from Lion up, when you setup email from the System Preferences, it tries to create these other services on the IMAP server.

Note that IMAP is a standard which means every one that makes an IMAP server might have a different "standard"; remember "The nice thing about standards is that you have so many to choose from." --Andy Tanenbaum

Regarding GMail, personally I have a GMail account as my Apple ID and added iCloud email under that account. So when I set up my iCloud service it only sets up everything on iCloud. Then I setup GMail using the System Preferences, but turn off Notes (keeping Calendar &amp; Reminders). If you leave Notes checked, it puts a "[IMAP]/Notes" LABEL in your GMail.