Share

libgmail

Tracker: Bugs

5 Modifications to work with new GALX cookie - ID: 2871172
Last Update: Comment added ( nobody )

It looks like recent changes to gmail authentication added a new cookie,
GALX, that breaks libgmail login. Here's the slight modifications I made
to the new login() function to deal with this change. libgmail is now
working for me again! For ease of reference, I'll just post the new
beginning of login(), from libgmail.py:
---
def login(self):
"""
"""
# TODO: Throw exception if we were instantiated with state?
if self.domain:
data_map = {'continue': URL_GMAIL,
'at' : 'null',
'service' : 'mail',
'Email': self.name,
'Passwd': self._pw,
}
else:
data_map = {'continue': URL_GMAIL,
'Email': self.name,
'Passwd': self._pw,
}

data = urllib.urlencode(data_map)
headers = {'Host': 'www.google.com',
'User-Agent': 'Mozilla/5.0 (Compatible;
libgmail-python)'}

req = ClientCookie.Request(URL_LOGIN, data=data, headers=headers)
pageData = self._retrievePage(req)

# We need to re-fetch the page with the proper GALX value.
data_map['GALX'] = self.getCookie('GALX')
data = urllib.urlencode(data_map)
req = ClientCookie.Request(URL_LOGIN, data=data, headers=headers)
pageData = self._retrievePage(req)
---

Everything past this point is the same.


Nobody/Anonymous ( nobody ) - 2009-10-01 07:56

5

Open

None

Nobody/Anonymous

None

None

Public


Comments ( 4 )




Date: 2009-11-22 01:28
Sender: nobody

It works! Nice Job!
Thanks


Date: 2009-10-20 16:15
Sender: nobody

It doesn't work using domains... at least for me.


Date: 2009-10-15 09:49
Sender: Mihkel

yes, thank you;
also gmailftpd.py rocks like this again!
(for today at least ;o)



Date: 2009-10-01 19:04
Sender: nobody

Thanks a lot for posting this fix;
I implemented your changes, and it works like a charm!

JP


Log in to comment.




Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.