It is easy to give Mail.app and Gmail something very close to synchronized inbox and sent mail boxes. Any message sent in Mail.app will be stored in Gmail's serverside sent box, any message sent through Gmail's web interface will store a copy in your Mac's sent mail box, and any received message will also be available through the web interface or on your own computer. This is most useful because it allows access of any of your email from anywhere through Gmail's nice interface, and it allows you to download your email and keep it offline and able to be read without an internet connection.
First, enable POP access in Gmail. Next, set up Mail.app to use gmail's POP server and SMTP server. (Using your ISP's SMTP server instead will not allow messages sent from Mail.app to be stored in Gmail.) Finally, add a rule in Mail.app and put it toward the very top of the priority list:
If all of the following conditions are met:
Mac OS X Hints
http://hints.macworld.com/article.php?story=20060825175256294