Just tried to enable internet_mail with my gmail account and it fails authentication.
Is this working for anyone else? If yes, what version of MAIL::IMAPClient.pm (and dependencies) is working? 
After deeper investigation, this currently fails because imap_utils.pl expects an "automatic login" when calling Mail::IMAPClient->new(). However, IMAPClient.pm->new() [v2.2.9... debian etch standard] only gets to login() thru connect() as follows:
    return $self->connect if $self->Server and !$self->Socket;
    return $self;
We already have a socket [before we call new()], so we don't go to connect() and then login().
IMAPClient.pm->new() [v3.1.1, CPAN's current] does this:
    !$self->{Socket} && $self->{Server} ?  $self->connect : $self;
Again, we already have a socket, so we don't call connect(), but even so, connect no longer calls login() in IMAPClient 3.1.1.
I also noticed that net_mail_account_1_server_port is not being referenced in internet_mail.pl, but only net_mail_account_1_server_send_port. Since gmail requires different servers and ports for imap and smtp, we need different sockets depending on wether we're sending or receiving. I don't think this is currently happening.
Am I the only one trying to access gmail in the mh web interface?
If not, what are you using? 
Thanks, Rick