Here is another tip for Gmail users that want to work in Mail.app.
When you set up a Gmail account in Mail.app it will default to POP. Now that Gmail supports IMAP you can use that instead. The difference between the two is simply that POP downloads everything from the server and works locally where as IMAP access the server and works directly there.
The two major benefits to using IMAP are that any changes you make to your mailbox locally. First of moving a message from one folder to anther is reflected on the server and secondly only a list of message is retrieved instead of the entire mailbox.
The second benefit isn't quite true though as Mail.app by default downloads the entire mailbox and all the attachments for offline viewing. Now as I rarely use Mail.app and furthermore never use the offline mode, I disabled this feature and substantially improved the Gmail synchronization. Not only the headers are cached and the message and attachments are retrieved when I open a message.
To change this setting you will need to remove your Gmail account, to clear out the cache, and add it again, this time manually set it up and on the last screen uncheck "Take this account online". This will prevent syncing. Now go to the Advanced tab and change "Keep a copies of messages for offline viewing" to "Don't keep copies of any messages".