This article presents details on how to ensure that messages in Gmail IMAP accounts are deleted after FogBugz retrieves them.
Let's assume you have configured a new Mailbox that retrieves incoming cases from Gmail to FogBugz using IMAP. The messages are being read and are creating new cases in FogBugz as expected. The problem is that the messages are not being deleted from the Gmail account, only archived. If those emails are not deleted manually, there is a risk of exceeding data limits on the account.
The default behavior for FogBugz is to mark emails as read after retrieving them. Even if you choose to “delete” incoming email, the Gmail IMAP standard process is to “archive” the message, as shown below.
Follow the process below for changing settings to have email deleted after being retrieved from the Gmail server:
In the FogBugz Mailbox configuration, select the option to Delete Messages.
In Gmail Settings, select these options:
- "Auto-Expunge off - Wait for the client to update the server."
- "Immediately delete the message forever"
Emails Still Not Deleted
Although Gmail recommends the process mentioned above, we are aware that it may not work for some customers.
When you delete messages from Gmail through IMAP, those messages are not technically removed from the server. Instead, Gmail removes the current inbox label and marks the mail as "archived." To delete emails from the server through IMAP, manually move those messages to the Gmail Trash folder.
For more information about this issue, you can review the discussion on the Google Gmail Forum.