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?