Steven Van Ingelgem
Steven Van Ingelgem

Reputation: 1019

Delete GMail chats via IMAP

I've created a small script with Zend_Mail_Storage_Imap to interact with GMail. Everything works fine so far, but I can't remove my chats? So I tried moving them to 'Bin':

REQUEST: TAG18 COPY 1,2,3,4,5,6,7,8,9,10 "[Google Mail]/Bin"
RESPONSE: TAG18 NO [ALERT] Chats can only exist in the Chat folder (Failure)

Didn't work obviously... Than I tried setting the deleted flag on them:

REQUEST: TAG19 STORE 1,2,3,4,5,6,7,8,9,10 +FLAGS (\Deleted)
RESPONSE: TAG19 NO STORE attempt on READ-ONLY folder (Failure)

Didn't work out either.

What could I do to move the chats to the Trash? I can do it manually within the GMail interface, but I'd like to do it automatically...

Thanks!

Upvotes: 2

Views: 621

Answers (1)

JSuar
JSuar

Reputation: 21091

Searching around you see that other programmers have encountered the same issue: that the chats label appears read-only. All the search results are other programmers providing their own feedback on the problem and confirming that the chats label is indeed read-only. Frustratingly, I could locate no official documentation from Google specifically on the subject.

The closest "official" post I could find on the subject was from a comment made by Googler Brandon Long on a Google+ post: Gmail Liberates Recorded Chat Logs Via IMAP - Data Liberation. Emphasis added.

Comment on Sep 15, 2011

Yes, currently chats are only displayed in the Chats folder. The Chats folder is also currently read-only, you can only export chats from there... though you can then upload those chats to another folder usually without issue. There are some technological reasons for this, chats have a bunch of special handling in the Gmail server, and are not 'real' email messages. This means that in some cases, a chat message may violate the IMAP spec in terms of message immutability. It was considered safer to silo them only in the Chats folder, which could ultimately be unsubscribed from or hidden entirely from IMAP if a user encounters problems with their client. We have fixed a number of bugs with chat exposure, hence the reason this has launched, but we're still a bit leery of potentially breaking things. Historical note, chats were exposed up until the last couple weeks before the initial IMAP launch, but the large number of bugs made us decide to just hide them. The DLF team has been instrumental in working to expose them for your liberation pleasure.

Note you can access the full list of labels on any message (chat or otherwise) by using the X-GM-EXT1 extension, http://code.google.com/apis/gmail/imap/, and using the X-GM-LABELS message fetch attribute

Upvotes: 2

Related Questions