Any EIdReply...
exception means that the server returned a protocol-appropriate error reply in response to a command that your app sent to it. In this case, your app sent an IMAP-related command, and the server replied with an IMAP-related error. The properties of the EIdReply...
exception contain the server's error details (error codes, string messages, etc).
Some TIdIMAP
methods send single commands, but other methods send multiple commands internally, so to really know which exact command is failing, you need to log the actual commands/responses being exchanged. Since SSL/TLS is involved, that usually rules out using an external sniffer, like WireShark. However, Indy has its own logging capabilities. You can attach one of Indy's TIdLog...
components, such as TIdLogFile or
TIdLogEvent, to the TIdIMAP.Intercept
property. That will capture all of the pre-encrypted/post-decrypted data being sent back and forth. Then you can troubleshoot what the server is complaining about.