Is there any limits on how many concurrent clients you can connect to one mail account?
I have an app that opens a new ImapClient on each request. The ImapClient will open INBOX and FolderA, and move a mail by UID from one to another. The multiple clients will never access the same mail concurrent, but probably move multiple mails in same account concurrent.
Errors seems to occur once I hit about 5+ clients simultanious, using Exchange, and response with a lot of different errors as: "The IMAP server replied to the 'COPY' command with a 'NO' response." "The IMAP server replied to the 'EXPUNGE' command with a 'NO' response."
When I'm moving mails I do following sequence:
- Using a new ImapClient
- Connect and auth the client
- GetFolderAsync of INBOX and FolderA, then wait for the response
- Open the INBOX with OpenSync() with ReadWrite, and wait for the task.
- Fetch INBOX with FetchAsync(), looping through the result to find the wanted UID based on MessageID
- Calling MoveToAsync() moving the mail based on uid to the FolderA, and waiting
- FolderA.SetFlagAsync() with new UID, and flagging the mail with SEEN
- Waiting on 6. & 7.
- INBOX.SetFlagAsync() with the previous UID, and flagging the mail with DELETED, wait for the operation
- Closing IMAP folders using INBOX.CloseAsync and FolderA.CloseAsync