How do I get archive to work in Mail.app in Lion?

I can't get archive to work on Lion. When I choose archive in Mail.app it creates a folder called Archived. That's not what I want. When I choose delete it doesn't remove the message from my inbox. It is just greyed out. Right now I leave the messages in the inbox and archive them from my iPhone, which works great. Please help me get this working.


If you're okay using Mail's delete function as archive, then simply go into Mail > Preferences > Accounts > Gmail > Mailbox Behaviors and deselect both of these options:

[ ] Move deleted messages to the Trash mailbox

[ ] Store deleted messages on the server

Screenshot:

Screenshot of settings

Then when you delete a message in Mail, you'll be archiving it.

Reference here:

https://mail.google.com/support/bin/answer.py?hl=en&answer=78892