0 votes

Hello,

I am evaluating the product in the hope to register it. I have come across one hurdle which I am unable to resolve and am hoping someone can point me in the correct direction. I am running the following method and have no problem with it except on add-hoc email messages. imap.GetMessageInfoByUID(uids) . It returns "An exception of type 'System.InvalidCastException' occurred in Mail.dll but was not handled in user code" Unable to cast object of type 'Limilabs.Client.IMAP.MimeTextStructure' to type ' '.
My understanding is it might be something funny with particular email messages that it don't like.

Out of trial and error I can find the problem email but am unable to find out whats causing the problem in the email.

by
Can you please contact us directly (email is in the page footer) and send us the log:
https://www.limilabs.com/blog/logging-in-mail-dll

1 Answer

0 votes

The problem is that this IMAP server doesn't escape backslash characters properly.

RFC 2683 (IMAP4 Implementation Recommendations) states:

Certain characters, currently the double-quote and the backslash, may
not be sent as-is inside a quoted string. These characters must be
preceded by the escape character if they are in a quoted string
, or
else the string must be sent as a literal. [...] Example:

   C: 001 LIST "" %
   S: * LIST () "" INBOX
   S: * LIST () "\\" TEST
   S: * LIST () "\\" {12}
   S: "My" mailbox
   S: 001 OK done
   C: 002 LIST "" "\"My\" mailbox\\%"
   S: * LIST () "\\" {17}
   S: "My" mailbox\Junk

This is what your IMAP server sends:

("FILENAME" "You have replied to this Ad on Gumtree: \an \")

This is what it should be sending:

("FILENAME" "You have replied to this Ad on Gumtree: \\an \\")

We'll correct Mail.dll, so it doesn't throw an exception. However it is impossible to correctly parse this broken output.

You should report this bug to the IMAP server producer. What is the name of the server by the way?

by (301k points)
edited by
...