1

Closed

client.Messages fails

description

I am trying to use the Imap interface and have somne very simple code.

After authentication, I select the mailbox, and then do a

Dim query = client.Messages
For Each q In query
Debug.WriteLine("")
Next

This fails, with the following message
{"startIndex cannot be larger than length of string.
Parameter name: startIndex"}


but client.messages.Select(Function(c)(c.Envelope)) works

What's up?

No files are attached

Closed Jan 20 at 6:48 AM by Krasshirsch

not an issue


comments

Krasshirsch wrote Jan 20 at 6:48 AM

Hi there,

this
<<
Dim query = client.Messages
For Each q In query
Debug.WriteLine("")
Next
>>

can't work since the LINQ parser does need a select and a where clause for now, the IMAP protocol enforces this constraint, automated select and where generation is not implemented yet.

mbcooper wrote Jan 19 at 9:31 PM

OK -- I have multiple problems ...
When I try client=New ImapClient()

then
dim messages = client.messages

then try to enumerate or list -- i track a crash down to
Crystalbyte.Equinox.Imap\Linq\SearchTranslationResult.cs

method ValidateSearchNecessity

the SearchCommand is "SEARCH" and IsUid is false, so it tries to get the "tail" starting at char # 15 ... to far and it crashes

mbcooper wrote Jan 19 at 9:15 PM

Here is where I have tracked the problem down to
in Imap project
method: public IEnumerator<T> GetEnumerator()

it creates an object of type: {Crystalbyte.Equinox.Imap.Linq.ImapQueryResponseReader<bool>}

We try to cast this as IEnumerable<T>, and that is where it crashes.

FYI: I am using this from a vb.net client -- has anyone tested LINQ with vb?

--mike