0 votes

I am currently testing your Mail.dll. While using your C#-example "ImapDownload" I am getting an unhandled ImapResponseException at GetMessageByUID(). I iterate throug all messages in the inbox-folder (>2900). More than 200 mails are processed successfully, but one uid is always throwing an exception.
I enabled logging with "Limilabs.Mail.Log.Enabled = true;" and here is the trace:

Mail.dll:  9 13:46:02 C: 635d83785a544a6b UID FETCH 11750489 (UID BODY[])
Mail.dll:  9 13:46:08 S: * OK wait please...
Mail.dll:  9 13:46:13 S: * OK wait please...
Mail.dll:  9 13:46:17 S: d3DDv8AjU0LFUIBIBGDjvVc2qTjbuww6D2q2bOJWJWM
Mail.dll:  9 13:46:17 S: vwcqT/Ks3U9Fgkt7loLQSSup2ru2jd65pMGpY4hJHIc4dBu5PBHf8aEdkDBWIDDBx3poTI68
Mail.dll:  9 13:46:17 S: +lQ539O1MK0+WGW2dgenrUAmO7Crk1luSozI20+mK8+k0+9Wf7LJaSLLTKKCMUVJnsaKrI8j

The IMAP-Server is "Zarafa".

Can you please help?

Thanks!

by

1 Answer

+1 vote

This server response is definitely incorrect, complete garbage.

Regular response should look like this:

C: 0e3373563cbb4877 UID FETCH 5795 (UID BODY[])
S: * 1 FETCH (UID 5795 BODY[] {28}
S: subject: message23

Text

S: )
S: 0e3373563cbb4877 OK UID completed

I think you should report this to the IMAP server vendor.

If you want us to investigate this further, you can provide us access to this account (use the support email address you can find in the page footer).

Does this also happen if this is the first command (GetMessageByUID("11750489")) after selecting Inbox?

What happens if you use GetFlagsByUID or GetMessageInfoByUID or GetHeadersByUID on this uid?

[Edit]

The problem was an antivirus scanner:

At the end, Kaspersky Endpoint Security 10 was causing the problem.
The software inspects the traffic (POP3, SMTP, IMAP) and has
apparently problems with some of the emails from the imap-server while
accessing them with your Mail.dll. When I stop the scanner, everything
works fine!

by (301k points)
GetFlagsByUID, GetMessageInfoByUID and GetHeadersByUID work perfectly for this UID, but GetMessageByUID doesn't even work directly after SelectInbox(). I just tested your sample "Download parts of email message" and this works even with this uid.
Since the mailserver is not accessible from the internet, I can't give you access to this account. As a workaround I will first attempt to use GetMessageByUID() to download the complete message and if this exception occurs I instead use GetMessageInfoByUID, GetTextByUID, GetDataByUID.

Thank you very much for your help!
Very strange indeed.

Does the log for:
imap.SendCommand("UID FETCH 11750489 (UID RFC822)");
look any better?
No, the ImapResponseException occurs again. The log file is:

Mail.dll:  8 15:45:19 C: c8a8a13a8acb4860 UID FETCH 11750489 (UID RFC822)
Mail.dll:  8 15:45:25 S: * OK wait please...
Mail.dll:  8 15:45:30 S: * OK wait please...
Mail.dll:  8 15:45:35 S: * OK wait please...
Mail.dll:  8 15:45:36 S: XaWR0aCAxOTYKL0hlaWdodCAxNDYKL0Jp...

Thanks again!
This looks like a serious server side problem, report it, don't think you can do anything else.
At the end, Kaspersky Endpoint Security 10 was causing the problem. The software inspects the traffic (POP3, SMTP, IMAP) and has apparently problems with some of the emails from the imap-server while accessing them with your Mail.dll. When I stop the scanner, everything works fine!
...