Description: pass GALX as cookie, to avoid continuos pop-up for auth
Author: Jan Jergus
Bug: http://sourceforge.net/tracker/?func=detail&aid=3406322&group_id=137480&atid=738663
Bug-Debian: http://bugs.debian.org/650454
Forwarded: not-needed

Index: checkgmail/checkgmail
===================================================================
--- checkgmail.orig/checkgmail	2012-01-08 18:14:20.369935655 +0100
+++ checkgmail/checkgmail	2012-01-08 18:16:16.170116161 +0100
@@ -891,7 +891,8 @@
 			print "Error: No GALX input field found\n";
 			return "Error: No GALX input field found";
 		}
-		$post_galx = URI_escape(URI_unescape($1));
+		my $galx = URI_unescape($1);
+		$post_galx = URI_escape($galx);
 		
 		# Find the data to post
 		my $post_data;
@@ -907,6 +908,7 @@
 		my $post_req = HTTP::Request->new('POST' => "https://www.google.com/accounts/ServiceLoginAuth?service=mail");
 		$post_req->content_type('application/x-www-form-urlencoded');
 		$post_req->content($post_data);
+		$post_req->header('Cookie' => "GALX=$galx");
 		my $post_response = $ua->request($post_req);
 		if ($post_response->is_error) {
 			my $code = $response->code;
