Ohh my bad... thanks a lot for replying Alf..
The error which I've pasted above, was thrown before I modified the code a bit.. Here's the error thrown on running the code I've pasted above.. there's not much of a difference in the error though. HTTP Error 500: Internal Server Error Traceback (most recent call last): File "test_libgmail.py", line 40, in <module> ArchiveAll() File "test_libgmail.py", line 35, in ArchiveAll _archiveAndMarkRead(email) File "test_libgmail.py", line 28, in _archiveAndMarkRead ga._doThreadAction(ARCHIVE_ACTION, email) File "/home/3rdparty/test/libgmail/libgmail.py", line 670, in _doThreadAction items = self._parsePage(_buildURL(**params)) File "/home/3rdparty/test/libgmail/libgmail.py", line 384, in _parsePage items = _parsePage(self._retrievePage(urlOrRequest)) File "/home/3rdparty/test/libgmail/libgmail.py", line 99, in _parsePage lines = pageContent.splitlines() AttributeError: 'NoneType' object has no attribute 'splitlines' I tried to debug the issue here, when self._retrievePage(urlOrRequest) is called (it is called internally in libgmail) a 500 internal server error is thrown. And hence further processing on the response can not be done. I also caught the url which throws 500: https://mail.google.com/mail/?ui=1&search=all&t=129374b41acebfcd&view=up&at=&act=rc_^i Now I don't know why 500 is thrown and on which side the exact problem lies, i.e. the libgmail side or the gmail side. And there's a email library provided in Python (supports both POP and SMTP) but I dont know whether it allows us to archive mails or mark them as read for that matter. -- http://mail.python.org/mailman/listinfo/python-list