Got Your Back (GYB) is a command line tool for backing up your Gmail messages to your local computer. It uses the standard IMAP protocol but also takes advantage of some custom Gmail IMAP extensions.