I have the list of unique keys of unseen emails and my current logic is to process it in one session/connection. However, sometimes server[rebex] crashes and sends an error *
Rebex.Net.ImapException: The server has closed the connection.
at below point.
- client.GetMailMessage(unique_key); //get information of particular email from unique key
Here, it will mark particular email's status seen though it generates an error. So, next time if I try to get information of unseen emails this particular unique key email will be missed.
Here, I have explored some possible ways
- To mark that error email unseen.
- Again create connection for that particular email and fetch information from that.
- Make IMAP client singleton and whenever it crashes, create a new one.
Are there any more optimized solutions? Thanks