Advanced IMAP Controls, a Labs feature that lets you fine-tune your Gmail IMAP experience. You can choose which labels to sync in IMAP -- useful if you find your mail client choking on a big [Gmail]/All Mail folder.
This is enabled by logging onto the Google Mail web interface going to “Settings” then the “Labs tab”.
Scroll down to the “Advanced IMAP Controls” select “Enabled”
then scroll to the bottom of the page and select “Save Changes”
After enabling this Lab, go to the “Labels” tab under “Settings”. You'll see a
new “Show in IMAP” checkbox next to each of your labels.

Uncheck “Show in IMAP” for “All Mail”

Under “Settings” go to the “Forwarding and POP/IMAP” tab

Under “IMAP Access”
Select “Do not automatically expunge messages” under “Auto-Expunge”
Select “Move the message to the Bin (or Trash)” under “When a message is expunged from the last visible IMAP Folder:”
Select “Save Changes”
Once these changes have been made any messages deleted via IMAP will go to “Bin” (or “Trash”) folder.
From there they will be permanently deleted automatically after 30 days.
