- When an instance of Imap object is disconnected and then connected again, the session state is lost. When reconnecting, you are not restarting the failed session, you are creating a new one. The new session behaves the same as if you simply disposed the Imap object and created/connected a new one. This is due to the nature of the IMAP protocol and there is no way around it.
- No software is bug free (and Rebex Secure Mail is not an exception - see
https://www.rebex.net/secure-mail.net/history.aspx), so it is a generally a good practice to write code in a way that minimizes the risk of possible unknown bugs affecting its operation. In our view, reusing a single instance of Imap object does not provide any actual benefits, while increasing the risk of failure.
- In practice, unique IDs of emails are persistent and stay the same even if you disconnect and reconnect. Even though an IMAP server is allowed to change unique IDs in a folder, this is very rare, and the server must do so in a way that makes the old IDs invalid.