Wow, I love the idea.
I have always wanted to manage my mail via terminal, but didn't want to set up Mutt or something similar.
set folder=imaps://imap.gmail.com:993
set spoolfile=+INBOX
set imap_user='your_username@gmail.com'
set smtp_url = "smtp://your_username@smtp.gmail.com:587/"
If you don't want to enter your password every time, you can set it as imap_pass (for reading) and smtp_pass (for sending).Note also that you must use caution when using Google's smtp and other network services, as they tend to do whatever they want, regardless of RFCs and standards[1].
If you're on Linux, it's also rather simple to store this in a keyring such as gnome-keyring (Seahorse).