Cleanup Gmail Trash
I can stop complaining now. Finally figured out how to delete all emails from gmail's Trash folder...Got the sources for GMail API For Java (g4j), mucked around with it for a bit and came up with a simple gmail.test.EmptyTrash command line. g4j uses Commons HTTPClient to do the heavy lifting. I had to tweak the g4j login code (to gmail) to get it working. Wish i had not reformatted the code, then i could just have submitted it back to g4j as a diff. Get the full zip here.
PS: Read the G4J FAQ before you run the command line.
PPS: Had a lot of help from FireFox's DOMInspector, the LiveHTTPHeaders plugin and last but not the least the sources of Mail::Webmail::GMail
Comments
Apologies for being stupid but how do I actually get this to work ? I've got thousands of Trash messages that I want to delete and this seems ideal. I've installed g4j and succesfully accessed my account but what after that to get your app to run ?
Posted by: Darren Fricker | May 8, 2005 04:27 AM
The solution seem not work any more. Here is the error I got. Any idea ?
trying to connect
Aug 4, 2005 1:10:47 AM org.apache.commons.httpclient.HttpMethodBase getResponseBody
WARNING: Going to buffer response body of large or unknown size. Using getResponseAsStream instead is recommended.
Aug 4, 2005 1:10:48 AM gmail.GMConnector parseDataPacket
WARNING: Message: top.location
Posted by: Steve | August 4, 2005 04:28 AM
The solution seem not work any more. Here is the error I got. Any idea ?
trying to connect
WARNING Cannot parse response from google!
Message Unknown message type!
Posted by: Steve | August 4, 2005 04:29 AM