The IMAP server replied to the 'CLOSE' command with a 'NO' response: CLOSE Entry not found in index

Hello,

I get the following error when trying to move a mail in a lotus notes mailbox.

Following log:

The IMAP server replied to the 'CLOSE' command with a 'NO' response: CLOSE Entry not found in index

MailKit.Net.Imap.ImapCommandException: The IMAP server replied to the 'CLOSE' command with a 'NO' response: CLOSE Entry not found in index at MailKit.Net.Imap.ImapFolder.d__32.MoveNext() in D:\src\MailKit\MailKit\Net\Imap\ImapFolder.cs:line 639
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MailKit.Net.Imap.ImapFolder.Close(Boolean expunge, CancellationToken cancellationToken) in D:\src\MailKit\MailKit\Net\Imap\ImapFolder.cs:line 685
at UiPath.Mail.MimeMailService.MoveIMAPMailToFolder(UserSettings userSettings, ServerSettings serverSettings, String mailfolder, String fromFolder, MailMessage mailMessage, SecureSocketEncryption SecureConnection, CancellationToken cancellationToken)
at UiPath.Mail.IMAP.Activities.MoveIMAPMailMessageToFolder.<>c__DisplayClass60_0.b__0()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.Mail.IMAP.Activities.MoveIMAPMailMessageToFolder.d__59.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at UiPath.Shared.Activities.AsyncTaskCodeActivityImplementation.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at UiPath.Shared.Activities.AsyncTaskCodeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

The same move mail activity works in another process, which has never gotten this error.
Does somebody know how to fix this?

Hi @titatarik ,

You might find this useful,

Check the email message: Ensure that the email message you are attempting to close is still available in the mailbox and has not been deleted or moved to a different folder.
Verify the mailbox connection: Check that the connection to the mailbox is still active and that the server is responding correctly to the UiPath activities. You can test the connection by using the “Get IMAP Mail Messages” activity to retrieve emails from the mailbox.
Check the CLOSE command syntax: Make sure that the syntax of the CLOSE command being sent to the IMAP server is correct. The syntax should be “CLOSE mailbox_name” where “mailbox_name” is the name of the mailbox or folder from which you want to close the email message.
Try a different email message: If the issue persists, try closing a different email message from the same mailbox to see if the problem is specific to that particular message.

Happy Automation,

Regards,
@pratik.maskar

I am sure it is nothing to do with connection or other issue.

Just use try catch

Hi guys, unfortunately I do not know why it did not work.
After a server restart, everything worked again, Also I did increase the seconds to timeout of this activity.