Google adds another opt-in feature to its roster of Gmail Labs experiments: Advanced IMAP Controls, a way to selectively decided which of your Gmail labels are available to your IMAP client plus other tweaks. With the new feature enabled, go to the Labels tab under your Gmail account's Settings area to select and de-select "Show in IMAP" on a per-label basis. Google describes a few other "obscure" IMAP features you can configure, as well.
The IMAP protocol allows messages to be marked for deletion, a sort of limbo state where a message is still present in the folder but slated to be deleted the next time the folder is expunged. In our standard IMAP implementation, when you mark a message as deleted, Gmail doesn't let it linger in that state — it deletes (or auto-expunges) it from the folder right away. If you want the two-stage delete process, after you've enabled this Lab, just select 'Do not automatically expunge messages' under the 'Forwarding and POP/IMAP' tab in Settings.
Similarly, most IMAP systems don't share Gmail's concept of archiving messages (sending messages to the [Gmail] /All Mail folder rather than [Gmail] /Trash). If you'd prefer that deleted messages not remaining in any other visible IMAP folders are sent to [Gmail] /Trash instead, Advanced IMAP Controls lets you set your preferences this way. In the 'IMAP Access:' section of the 'Forwarding and POP/IMAP' tab, find the 'When a message is deleted from the last visible IMAP folder:' option. Select 'Move the message to the Gmail Trash.' If you want to take it one step further, you can select 'Immediately delete the message forever.'
Enable advanced IMAP controls in the Labs area; click the beaker on the top right bar inside your Gmail account to get there.