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.
Thanks a lot for posting this fix;
I implemented your changes, and it works like a charm!
JP
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
yes, thank you;
also gmailftpd.py rocks like this again!
(for today at least ;o)
It doesn't work using domains... at least for me.
It works! Nice Job!
Thanks