0 votes

I have some code which tries to get all the UIDs which came after the last time I fetched an update.

I'm getting an error with this line of code when it tried to pull emails with a specific Gmail account.

This is calling Gmail when it gives this error:

List<long> allUIDs = client.Search().Where(
    Expression.UID(Range.From(sequenceToFetchMinUID)));

I just downloaded this library on Saturday through NuGet and purchased it. Any idea what I'm doing wrong?

Here is the exception.

Limilabs.Client.ServerException: Could not parse command
   at Limilabs.Client.IMAP.FluentSearch.GetList()
   at Limilabs.Client.IMAP.FluentSearch.op_Implicit(FluentSearch search)

Before this I was using IMAPX and I could just pass a search command like "UID 32332:*" which is really what I want to accomplish. Am I not doing that anymore? It seems like some accounts work fine but just this one particular Gmail account has an issue.

by

1 Answer

0 votes
 
Best answer

"Could not parse command" is an error message returned by the IMAP server.
Gmail returns this error, for example, if uid is less or equal to 0.

"UID 32332:*"

This is not a valid IMAP command, "UID SEARCH 20391:*" is - and this is, more or less, what Mail.dll sends.

If possible (supported by the IMAP server) Mail.dll uses IMAP's ESEARCH extension, which is more efficient in terms of downloading large amount of uids:

C: 5dedd89272434bc5 UID SEARCH RETURN (ALL) UID 20391:*
S: * ESEARCH (TAG "5dedd89272434bc5") UID ALL 20391
S: 5dedd89272434bc5 OK SEARCH completed (Success)
by (301k points)
Thank you, that was it exactly! I was sending a 0 UID start range. This library has been great. I was using IMAPX before and it was a disaster.
...