Gmail is primarily a search based inbox. If you (like the person earlier) are making something based around IMAP then you're doing a 90's era web mail app. Nothing wrong with that, it's just not gmail.
If what worries you about gmail is privacy, then yahoo won't be an alternative. There are a few alternatives suggested in http://prism-break.org (including guidelines to install your own one)
As for IMAP clients, I like http://airmailapp.com/.
They also have read-only LDAP access to the addressbook. If it allowed writes, I'd have thunderbird save contacts to it, but it's a step.
During the start of the whole NSA/Prism spying thing, many people mentioned that those were two they were switching to.