Apple Mail removes the emails from inbox

gmailimapmail.app

My mail.app uses IMAP to fetch email from GMail. I use the standard settings given by the configuration wizard in OSX Mountain Lion.

The problem I am facing is that mail.app removes all incoming emails from the inbox. I can only find the emails in the folder All Mail. This happens in mail.app and in GMail (accessed through webmail), as well. The problem must be caused by mail.app, because it resolves when I removed my the GMail account from mail.app.

Is there a way to debug this problem? Any way I can see what instructions mail.app is sending to GMail through IMAP?

Best Answer

Debugging Mail.app on OS X is fairly easy - especially in the case you describe where the problem is with one account.

  • Get the Incoming Mail server name from preferences (Mail --> Preferences... --> Accounts --> (your account) --> Incoming Mail Server) - it's likely something like mail.gmail.com or imap.gmail.com
  • Quit Mail
  • Open terminal and type this all as one long line (it's split here for readability):

    /Applications/Mail.app/Contents/MacOS/Mail -LogActivityOnHost imap.gmail.com -LogIMAPErrors YES >& ~/Desktop/MailConnection.log &

The harder part becomes making sense of the volume of data being logged, but again it seems you have a good handle on the scope of the issue. I would take a gander at your IMAP and label settings in gmail preferences to be sure your account isn't suppressing those folders for IMAP delivery.