andyedinborough / aenetmail

C# POP/IMAP Mail Client
369 stars 153 forks source link

Errors with Gmail at login and at deleting #187

Open Dongorath opened 8 years ago

Dongorath commented 8 years ago

Hello,

I encountered two problems while trying to work with mails on a gmail account :

  1. At login, before it checked if the response was OK, it fired a SelectMailBox() which generated a new tag so the check in OnLogin failed.
  2. Once the first problem resolved, the call to Supports("X-GM-EXT-1") failed because no mailbox was selected.
  3. This one may be specific to gmail : when calling Delete() on a message, the server returned, among it's untagged responses a * 1 EXPUNGE which was returned to the function (HandleUntaggedResponse returns the response in the last else in the while (response.StartsWith("*"))

My solutions are as follow :

  1. In SendCommandGetResponse, passing the mailbox parameter to HandleUntaggedResponse and not the Mailbox property.
  2. Calling CheckMailboxSelected(); before the call to Supports()
  3. Ignoring any untagged response beggining with an integer not already catched by previous conditions. They do work in my case, but I don't know these will have side effects

Best regards.

Hineynu commented 8 years ago

I seem to have the same error when I updated to the latest build:

Message: 1 EXPUNGE Source: AE.Net.Mail TargetSite: Void CheckResultOK(System.String) StackTrace: at AE.Net.Mail.ImapClient.CheckResultOK(String response) in C:\Users\mfox_000\Google Drive\Work\Hineynu\Tracker\Code\Resources\aenetmail-master Dec 17, 2015\ImapClient.cs:line 956 at AE.Net.Mail.ImapClient.Store(String messageset, Boolean replace, String flags) in C:\Users\mfox_000\Google Drive\Work\Hineynu\Tracker\Code\Resources\aenetmail-master Dec 17, 2015\ImapClient.cs:line 929 at AE.Net.Mail.ImapClient.DeleteMessage(String uid) in C:\Users\mfox_000\Google Drive\Work\Hineynu\Tracker\Code\Resources\aenetmail-master Dec 17, 2015\ImapClient.cs:line 376 at AE.Net.Mail.ImapClient.DeleteMessage(MailMessage msg) in C:\Users\mfox_000\Google Drive\Work\Hineynu\Tracker\Code\Resources\aenetmail-master Dec 17, 2015\ImapClient.cs:line 370

When I switched to the build I've been using from May 2014 everything works.