I tried to debug this a little myself. It looks like Gmail changed things around a bit.
I was able to get the login to work by first changing the LOGIN_URL in the module to this:
our $LOGIN_URL = "https://www.google.com/accounts/ServiceLoginAuth?service=mail&rm=false&continue=h
+ttp://mail.google.com/mail/";
And then changing some of the code in the login() sub from:
if ( $res->is_success() ) {
update_tokens( $self, $res );
if ( $res->content() =~ /top.location = "(.*?)";/ ) {
$req = HTTP::Request->new( GET => "https://www.google.com/accounts/$1" );
$req->header( 'Cookie' => $self->{_cookie} );
$res = $self->{_ua}->request( $req );
if ( $res->content() =~ /location.replace\("(.*?)"\)/ ) {
update_tokens( $self, $res );
$req = HTTP::Request->new( GET => $1 );
$req->header( 'Cookie' => $self->{_cookie} );
$res = $self->{_ua}->request( $req );
if ( $res->content() =~ /<script src="(.*?)">/ ) {
if ($res->code == 302) {
update_tokens( $self, $res );
my $checkcookie_url = $res->header('Location');
if ($checkcookie_url =~ /CheckCookie/) {
$req = HTTP::Request->new( GET => $checkcookie_url );
$req->header( 'Cookie' => $self->{_cookie} );
$res = $self->{_ua}->request( $req );
if ( $res->content() =~ /location.replace\("(.*?)"\)/ ) {
update_tokens( $self, $res );
$req = HTTP::Request->new( GET => $1 );
$req->header( 'Cookie' => $self->{_cookie} );
$res = $self->{_ua}->request( $req );
if ( $res->content() =~ /<script type=text\/javascript src="(.*?)">/ ) {
But even then, it seems like more of the functions are broken.
Perhaps Allen is already looking into things, but if I come up with any more patches, I'll post them here.
--Karl.