https://support.google.com/mail/answer/78892?hl=en
From the Tools menu, select Account Settings and highlight your Gmail address. There appears to be a setting (marked in bold) that might prevent mail in the inbox from being deleted.
On the Server Settings tab:
Check for new messages at startup > checked
Check for new messages every 10 minutes > checked
When I delete a message > Mark it as deleted
Clean up ("Expunge"
Inbox on Exit > leave unchecked
Empty Trash on Exit > leave unchecked
On the Copies & Folders tab in the When sending messages, automatically section:
Place a copy in > leave unchecked
On the Copies & Folders tab in the Drafts and Templates section:
Keep message drafts in > Other
Other >[Your Gmail address] > [Gmail] > Drafts
On the Junk Settings tab
Enable adaptive junk mail controls > leave unchecked
Click OK to save and close your account settings.
If you'd like to to further enhance your IMAP experience, follow these additional steps:
In the 'Tools' menu, open Options.
On the 'Advanced' tab, open the General section.
Click the Config Editor button.
In the 'Filter' box, type 'browser.cache.memory.capacity'
Double-click on the browser.cache.memory.capacity entry to edit its value.
Change the value to '30720' and click OK.
Delete the text in the 'Filter' box and type 'mail.server.default.fetch_by_chunks'
Double-click on the mail.server.default.fetch_by_chunks entry to set its value to false.
Close the 'about:config' window and then close 'Options' by clicking OK.