I'm encountering a issue using the GetFolder function of MailKit using multiple threads. The case is them I'm running a thread that will move my emails around (which among other function does use the GetFolder to find my source folder and destionation folder for the email to move), and another thread that will search for an email while the first one is running (the second thread does you GetFolder function too).
Most of the times I'm getting an InvalidOperationException telling me that "The ImapClient is currently busy processing a command."
How can I ensure that this won't happen?? I try'd to change all my GetFolder and other MailKit operations to Async, and wait for the task to complete, but without any luck of doing this more or less simultanous.
I'm using the same ImapClient for both threads.