--- checkgmail.old 2007-06-19 10:18:55.000000000 +0200 +++ checkgmail 2007-12-16 21:07:13.000000000 +0100 @@ -276,6 +276,8 @@ my $icons_dir : shared; my $gmail_at : shared; my $gmail_hid : shared; +my $gmail_sid : shared; +my $gmail_gausr : shared; my $delay : shared; my %label_delay : shared; # my @labels : shared; @@ -656,8 +658,10 @@ # deciphering the login form! :) unless ($hosted) { # Normal Gmail login action ... - $error = http_get("https://www.google.com/accounts/ServiceLoginAuth?ltmpl=yj_wsad<mplcache=2&continue=https%3A%2F%2Fmail.google.com%2Fmail%3F&service=mail&rm=false<mpl=yj_wsad&Email=$URI_user&Passwd=$URI_passwd&rmShown=1&null=Sign+in", "LOGIN"); - } else { + $error = http_get("https://www.google.com/accounts/ServiceLoginAuth?ltmpl=yj_wsad<mplcache=2&continue=https%3A%2F%2Fmail.google.com%2Fmail%3F&service=mail&rm=false<mpl=yj_wsad&Email=$URI_user&Passwd=$URI_passwd&rmShown=1&null=Sign+in", "LOGIN"); + $cookie_jar->scan(\&scan_at); + $error = http_get("https://mail.google.com/mail?nsr=0&auth=$gmail_sid&gausr=$gmail_gausr", "LOGIN"); + } else { # hosted domains work differently ... # First we POST a login $error = http_get("https://www.google.com/a/$hosted/LoginAction|at=null&continue=http%3A%2F%2Fmail.google.com%2Fa%2F$hosted&service=mail&userName=$URI_user&password=$URI_passwd", "POST"); @@ -672,6 +676,7 @@ } $cookie_jar->scan(\&scan_at); + unless ($gmail_at) { unless ($error) { $http_status->enqueue("Error: 401 Unauthorised"); @@ -723,10 +728,16 @@ if ($cookie_ref->[1] =~ m/GMAIL_AT/) { $gmail_at = $cookie_ref->[2]; } - if ($cookie_ref->[1] =~ m/HID/) { $gmail_hid = $cookie_ref->[2]; } + if ($cookie_ref->[1] =~ m/GAUSR/) { + $gmail_gausr = $cookie_ref->[2]; + } + + if ($cookie_ref->[1] =~ m/SID/) { + $gmail_sid = $cookie_ref->[2]; + } } @@ -780,7 +791,7 @@ $error = "Error: $code $message"; $http_status->enqueue($error); } - my $http = $response->content; + #my $http = $response->content; } return $error;