{"action":"opened","issue":{"url":"https://api.github.com/repos/jstedfast/MailKit/issues/228","labels_url":"https://api.github.com/repos/jstedfast/MailKit/issues/228/labels{/name}","comments_url":"https://api.github.com/repos/jstedfast/MailKit/issues/228/comments","events_url":"https://api.github.com/repos/jstedfast/MailKit/issues/228/events","html_url":"https://github.com/jstedfast/MailKit/issues/228","id":100919788,"number":228,"title":"Setting Deleted flag on message in Gmail folder throws Protocol Exception","user":{"login":"brettmarl","id":1099372,"avatar_url":"https://avatars.githubusercontent.com/u/1099372?v=3","gravatar_id":"","url":"https://api.github.com/users/brettmarl","html_url":"https://github.com/brettmarl","followers_url":"https://api.github.com/users/brettmarl/followers","following_url":"https://api.github.com/users/brettmarl/following{/other_user}","gists_url":"https://api.github.com/users/brettmarl/gists{/gist_id}","starred_url":"https://api.github.com/users/brettmarl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brettmarl/subscriptions","organizations_url":"https://api.github.com/users/brettmarl/orgs","repos_url":"https://api.github.com/users/brettmarl/repos","events_url":"https://api.github.com/users/brettmarl/events{/privacy}","received_events_url":"https://api.github.com/users/brettmarl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-14T02:57:29Z","updated_at":"2015-08-14T02:57:29Z","closed_at":null,"body":"Relevant code is:\r\n\r\n    ImapClient c = new ImapClient();\r\n    c.Connect(\"imap.gmail.com\", 993, true);\r\n    c.Authenticate(...);\r\n\r\n    var folderSrc = c.GetFolder(\"[Gmail]/All Mail\");\r\n    folderSrc.Open(FolderAccess.ReadWrite);\r\n    for (int i = 0; i <folderSrc.Count; i++)\r\n    {\r\n        var message = folderSrc.GetMessage(i);\r\n        folderSrc.AddFlags(i, MessageFlags.Deleted, false);\r\n    }\r\n\r\nAddFlags throws a protocol exception:\r\n[MailKit.Net.Imap.ImapProtocolException]\t{\"Unexpected token in IMAP response: [atom: 0]\"}\t\r\nHResult = 0x80131500\r\n\r\nProtocol Logger says:\r\n\r\n    C: A00000009 STORE 1 +FLAGS (\\Deleted)\r\n    S: * 1 FETCH (FLAGS (\\Deleted) MODSEQ (0))\r\n    S: A00000009 OK Success\r\n\r\nServer is Gmail on a Google Apps domain."}}