Set up Gmail to work properly with Apple Mail I often can't find my sent mail in my Gmail account viewed on my Mac in Apple Mail. I did not set up these folders, but I have both a "Sent Mail" folder indented under a "Gmail" folder and a "Sent Messages (gmail [accountname])" folder in my Gmail account in Apple Mail. Sometimes a sent messages shows up in neither of those, but I can find it by searching for it.
Some incoming messages do not appear in my Inbox, but are in a box I did not set up labeled "Important."


How do I set the Gmail settings and filters to avoid these two problems?
Besides Google's "official" guide to configure GMail with a desktop client (see Wheat Williams' answer) I think this guide is pretty good and helpful:

http://www.macworld.com/article/157846/2011/03/mailgmail.html

It' a detailed step-by-step guide an features several screenshots.

Regarding the sent messages (your first point):


  "Select the [Gmail] -> Sent Mail subfolder and choose Mailbox -> Use This Mailbox For -> Sent"