0 votes

Dear Sir or Madam,

I have the problem that the IMAP server of the German E-Post denied the command "UID SEARCH ALL" with "NO This operation is not supported".

E-Post is a nationwide service of "Deutsche Post".

Do you know such a behavior? Is there a way to bypass and get the list of ID anyway?

The Mail.dll version is up-to-date.

Below you will find IMAP log of Mail.dll and a fragment of my test code.

3.0.17128.1137
Checking if license file is present.
Connecting to 'op.epost.de:993', SSL: True.
S: * OK EPOP IMAP4 server ready
C: 692A0000 CAPABILITY
S: * CAPABILITY IMAP4rev1 AUTH=PLAIN CHILDREN
S: 692A0000 OK CAPABILITY completed
C: 692A0001 LOGIN *****@***.eu.epost.de *****
S: 692A0001 OK LOGIN completed
C: 692A0002 CAPABILITY
S: * CAPABILITY IMAP4rev1 AUTH=PLAIN CHILDREN
S: 692A0002 OK CAPABILITY completed
C: 692A0003 LIST "" ""
S: * LIST (\Noselect) "." ""
S: 692A0003 OK LIST completed
C: 692A0004 SELECT INBOX
S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
S: * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft)]
S: * 3 EXISTS
S: * 0 RECENT
S: * OK [UIDVALIDITY 1063302578]
S: * OK [UIDNEXT 4]
S: * OK [NOMODSEQ]
S: 692A0004 OK [READ-WRITE] SELECT completed
C: 692A0005 UID SEARCH ALL
S: 692A0005 NO Diese Operation wird nicht unterstuetzt
C: 692A0006 LOGOUT
S: BYE LOGOUT received
S: 692A0006 OK

Here's my code that connects to the IMAP server and uses Imap GetAll to retrieve all UIDs stored in the INBOX email folder:

Imap imapClient = new Imap();
Limilabs.Mail.Log.Enabled = true;
try
{
        Log("Connecting to IMAP Server");
        imapClient.Connect(host, port, true);
        Log("Connected");

        Log("Login to IMAP Server");
        imapClient.Login(username, password);
        Log("Logged in");

        var folderStatus  = imapClient.SelectInbox();
        var uids = imapClient.GetAll();
        Log(uids.Count + " mails found");
        Log("Done");
}
catch (Exception ex)
{
        Log("Error: " + ex.Message);
        Log(ex.StackTrace);
}
imapClient.Close(false);
by (298k points)

1 Answer

0 votes
 
Best answer

You should report that as a bug to the server administrator.

UID SEARCH ALL is the most basic IMAP command:
https://tools.ietf.org/html/rfc3501#section-6.4.4

As a workaround you may try using following command instead of Imap.GetAll():

imap.Search(Expression.UID(Range.From(1)));

-or-

imap.Search(Expression.Since(new DateTime(2001, 1, 1)));

--

[Update]

After some client testing it turns out that UID SEARCH UID also doesn't work properly, and UID SEARCH SINCE returns invalid SEARCH response (SEARCH keyword is duplicated). Fortunately Mail.dll IMAP client library correctly parses this server response:

C: 692A0005 UID SEARCH ALL
S: 692A0005 NO Diese Operation wird nicht unterstuetzt

C: EFB90005 UID SEARCH UID 1:*
S: EFB90005 NO Diese Operation wird nicht unterstuetzt

C: EFB90006 UID SEARCH SINCE 01-Jan-2001
S: * SEARCH * SEARCH 1 2 3
S: EFB90006 OK SEARCH completed
by (298k points)
edited by
I am running into the same situation.  Search(Expression.UID(Range.From(1))) and Expression.Since(new DateTime(2001, 1, 1)) both throw the error: UID SEARCH failed: Can't search that criteria.  So how did you get this to work?  If it helps, my app is trying to get emails from a CallPilot mail server.
@AlanLau Please ask a separate question. This has been solved by using UID SEARCH SINCE 01-Jan-2001, also does regular GetAll() works?
...