@jwz I was pulling data *out* of GMail over IMAP using fetchmail earlier, and I believe it can be used to *write* to IMAP as well. I'm not usre if it can be used in your scenario, though.
The problem here being that you need OAuth; I switched over to a self-hosted account for this instead of trying to get OAuth up and running.