Hello,
The log suggests that this is most likely a bug in the IMAP server. In response to FETCH
command (used by GetMailMessage
method), the server indicated it's sending a message of 198862 bytes, but sent slightly less message data, which caused the IMAP client to treat the first few bytes of the expected "R00007 OK FETCH completed" response as message data:
Response: R00006 OK FETCH completed
Command: R00007 UID FETCH 40338 (UID BODY[])
Response: * 1 FETCH (UID 40338 BODY[] {198862}
Response: ...198862 bytes...
Response: completed
Note the last line that contains the ending part of the expected response.
To verify this is indeed the case, set logging level to LogLevel.Verbose
before calling the GetMailMessage
method, making it possible to inspect the actual message data and confirm this is indeed a server-side bug. Alternatively, use a network protocol analyzer such as Wireshark to capture and inspect the communication at the network level.
Does Lotus Notes use IMAP to receive the e-mail? If not, that would explain why it doesn't suffer from the same issue.
In the past, some of our clients encountered very similar issues with Lotus Notes, although less severe. We added a workaround for that, but it was not effective for the more severe form of the bug you encountered.
If this is confirmed to be a server bug (and that looks very likely), the proper solution would be to fix the server. Implementing a workaround at the client-side is another option, but this is non-trivial, outside the scope of Rebex support and futher complicated by the fact that we are unable to reproduce this ourselves. If you would like to pursue this solution, please get in touch with us at support@rebex.net.