Currently mailutils movemail works with gmail imap using this:
movemail 'imaps://carlosjosepita%40gmail.com:X
XXX@imap.gmail.com/INBOX' RMAIL
but not this:
I wouldn't be difficult to support imaps in rmail, as it's just forwarding the request to movemail, which already supports it. This way it would be possible to use gmail imap in rmail.