Google is now offering Gmail users IMAP access along with a few iPhone tips.
When setting up Gmail for IMAP use, the key is not to select Gmail, but rather select Other and proceed with configuration variables. According to Google, they are working on resolving the issue. View the video below from Google for complete directions.
Source: MacNN
