Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.Exception while moving mail on Gmail #194

Open
Atrejoe opened this issue Aug 16, 2016 · 1 comment
Open

System.Exception while moving mail on Gmail #194

Atrejoe opened this issue Aug 16, 2016 · 1 comment

Comments

@Atrejoe
Copy link

Atrejoe commented Aug 16, 2016

Using 1.7.10.0 (See also #193):

When moving a mail from one folder to another in Gmail (which will present this as tags), I always seems to get an error on the first try.

using (var client = GetMailClient())
{
    client.SelectMailbox(currentfolder);

    try
    {
        client.MoveMessage(messageId, targetFolder);
    }
    catch (Exception)
    {
        //Quite often (almost always) when moving a message a generic system.exception is thrown (during the delete part)
        //, which seems to be a misunderstanding between either AE.Net.Mail or the Gmail IMAP interface
        client.MoveMessage(messageId, targetFolder); //The second pass always seems to succeed.
    }
}

System.Exception.Message: 1 FETCH (UID 23 FLAGS (\\Flagged)) (or some variation)

Stack trace:

   at AE.Net.Mail.ImapClient.CheckResultOK(String response) in c:\Repos\aenetmail\ImapClient.cs:line 821
   at AE.Net.Mail.TextClient.SendCommandCheckOK(String command) in c:\Repos\aenetmail\TextClient.cs:line 121
   at AE.Net.Mail.ImapClient.Copy(String messageset, String destination) in c:\Repos\aenetmail\ImapClient.cs:line 257
   at AE.Net.Mail.ImapClient.MoveMessage(String uid, String folderName) in c:\Repos\aenetmail\ImapClient.cs:line 339

The message IS actually copied to the correct folder, but as an exception is thrown, it is not deleted from the original folder.

Upon the second attempt all goes well, hence the blind retry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@Atrejoe and others