0 votes
by (120 points)

Hello!

This code sucsessfully works on IIS server:

using (var client = new Rebex.Net.Ews())
{
    client.LogWriter = new Rebex.FileLogWriter(@"selfLogging.log", Rebex.LogLevel.Debug);
    client.Settings.SslAcceptAllCertificates = true;
    client.Connect("pochta", SslMode.Implicit);
    client.Login("dev@pochta", "Password", EwsAuthentication.Ntlm);

    var unreadableList = client.SearchItems(EwsFolderId.Inbox, EwsSearchParameter.IsRead(false));

    foreach (var messageInfo in unreadableList)
    {
        var meta = new EwsMessageMetadata
        {
            IsRead = true
        };
        client.UpdateItem(messageInfo.Id, meta);
    }

    // disconnect (not required, but polite)
    client.Disconnect();
}

But, it do not work in Docker container.

In the log file I see the following:

2023-09-19 16:41:57.789 ERROR Ews(1)[12] EWS: GetFolderId failed: Rebex.Net.EwsException: Error while executing request.
 ---> zwiap.smntu: Server requires authentication, but none of the authentication methods is supported or allowed.
   at zwiap.occyr.jtoyz(String p0, Boolean p1, SspiAuthentication& p2, Boolean& p3)
   at zwiap.occyr.umvxj()
   at zwiap.flxpm.lpvpn[T](String p0, Object p1)
   --- End of inner exception stack trace ---
   at zwiap.flxpm.lpvpn[T](String p0, Object p1)
   at zwiap.flxpm.htnly(lwdes p0)
   at Rebex.Net.Ews.fkghw(EwsFolderId p0, ishof p1)
   at Rebex.Net.Ews.azzus.hipjd()
   at Rebex.Net.Ews.mrudi[T](String p0, Func`1 p1, jmaah p2)

Why is this happening?
What am I doing wrong?

Applies to: Rebex FTP/SSL

1 Answer

0 votes
by (144k points)

Is is a Linux-based Docker container? In that case, you have to use a NTLM plugin (see the KB article for further instructions).

by (120 points)
Good afternoon.
Thanks for the quick and accurate answer!
Everything worked!
...