We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Sometimes Aspose cannot connect to outlook.office365.com by SSL IMAP

Hi,

Our customer has problem with IMAP SSL connection. Please see trace logs:
1.
Aspose.Email.TimeoutException: Connection failure. Timeout ‘200000’ has been reached.
at #=z9zOEL5lhGpMCYtI8wYqBzYjE2PwqnKvLl$G0D9Q=.#=zbcs5FBZEOWlW(String #=zYPfbb44=, Int32 #=zQu4oR6E=)
at #=z9kanu6b5GnhomjAKJ$HOn25yc7C7.#=z1IoZtCg=(Int32 #=zvNzBSyQ=)
at #=z9kanu6b5GnhomjAKJ$HOn25yc7C7.#=z1IoZtCg=()
at Aspose.Email.Clients.Imap.ImapClient.BeginSelectFolder(IConnection iConnection, String folderName, Boolean readOnly, AsyncCallback callback, Object state)
at Aspose.Email.Clients.Imap.ImapClient.SelectFolder(IConnection iConnection, String folderName, Boolean readOnly)
at Aspose.Email.Clients.Imap.ImapClient.SelectFolder(String folderName)

Aspose.Email.AsposeException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. —> System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. —> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
— End of inner exception stack trace —
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at #=zRJmbovHUNdx0$p2Br9SGzhlaTnlPK05hZA==.#=zVFw$rvlHxjxg(Object #=ztfJpLhk=)
at #=zRJmbovHUNdx0$p2Br9SGzhlaTnlPK05hZA==.#=zmh88C7HWvoFh()
at #=zRJmbovHUNdx0$p2Br9SGzhlaTnlPK05hZA==.Read(Byte[] #=zXqJ1twg=, Int32 #=zM8WmM20=, Int32 #=zKMgZEas=)
at #=zYCIZDFkFP4rlXhgdUs$Ff2$aLG7HiV6eBw==.Read(Byte[] #=zXqJ1twg=, Int32 #=zM8WmM20=, Int32 #=zKMgZEas=)
at #=zFd62nBer3OENiwg8hfEY5BywV9a7.#=zq$HcEyg=(Byte[] #=zXqJ1twg=, Int32 #=zM8WmM20=, Int32 #=zsJHE$qI=)
at #=zFd62nBer3OENiwg8hfEY5BywV9a7.#=zq$HcEyg=(Byte[] #=zXqJ1twg=)
at #=zD7C_ADN1L2VlFuSPOWa1e7bIhKa36qggDByJlvU=.#=zoOVO_UKT$OFb(Boolean #=zGGe1NxG3mQ$M)
at #=zD7C_ADN1L2VlFuSPOWa1e7bIhKa36qggDByJlvU=.#=zzMthAHc=(Object #=ztfJpLhk=)
— End of inner exception stack trace —
at #=z4MxDMG77tF$BsOLsyiqozSjdtDYR.#=zoYkIfxo=(IAsyncResult #=z53gCis0=)
at #=z4MxDMG77tF$BsOLsyiqozSjdtDYR.#=zS$_6Ojc=()
at #=z9zOEL5lhGpMCYtI8wYqBzYjE2PwqnKvLl$G0D9Q=.#=zGwDIS3owmCHt(String #=zYPfbb44=, Int32 #=zQu4oR6E=, SecurityOptions #=zVxiVQ$O9C84z, Int32 #=z_bf$E$I=)
at #=z9zOEL5lhGpMCYtI8wYqBzYjE2PwqnKvLl$G0D9Q=.#=zumfex1ZFNv$P(String #=zYPfbb44=, Int32 #=zQu4oR6E=)
— End of inner exception stack trace —
at #=z9zOEL5lhGpMCYtI8wYqBzYjE2PwqnKvLl$G0D9Q=.#=zumfex1ZFNv$P(String #=zYPfbb44=, Int32 #=zQu4oR6E=)
at #=z9zOEL5lhGpMCYtI8wYqBzYjE2PwqnKvLl$G0D9Q=.#=z7y7A1hoMLyTNd5YhI5ivRc8=.#=zj4pDglgxw4Rg5YMEqw==(Object #=ztfJpLhk=)
— End of inner exception stack trace —
at #=z9zOEL5lhGpMCYtI8wYqBzYjE2PwqnKvLl$G0D9Q=.#=zbcs5FBZEOWlW(String #=zYPfbb44=, Int32 #=zQu4oR6E=)
at #=z9kanu6b5GnhomjAKJ$HOn25yc7C7.#=z1IoZtCg=(Int32 #=zvNzBSyQ=)
at #=z9kanu6b5GnhomjAKJ$HOn25yc7C7.#=z1IoZtCg=()
at Aspose.Email.Clients.Imap.ImapClient.BeginSelectFolder(IConnection iConnection, String folderName, Boolean readOnly, AsyncCallback callback, Object state)
at Aspose.Email.Clients.Imap.ImapClient.SelectFolder(IConnection iConnection, String folderName, Boolean readOnly)
at Aspose.Email.Clients.Imap.ImapClient.SelectFolder(String folderName)

This problem isn’t reproduced always, error occurs several times per date. Customer connects to outlook.office365.com and problem is reproduced for all accounts.
We use Aspose.Email for .NET 4.0 version 18.3.
We set SecurityOptions to SecurityOptions.SSLAuto for SSL IMAP connection:

        imapClientConnection = new ImapClient();
        imapClientConnection.Host = ServerConfiguration.Server;

        // 0 means using the default port
        if (ServerConfiguration.Port != 0)
        {
            imapClientConnection.Port = ServerConfiguration.Port;
        }
        else if (ServerConfiguration.SSL)
        {
            imapClientConnection.Port = 993;
        }
      
        imapClientConnection.Username = ServerConfiguration.User;
        imapClientConnection.Password = ServerConfiguration.Password;
        
        SecurityOptions securityOptions = ServerConfiguration.SSL ? SecurityOptions.SSLAuto : SecurityOptions.None;
        imapClientConnection.SecurityOptions = securityOptions;

        imapClientConnection.SelectFolder(ServerConfiguration.InboxFolder);

Do you have any suggestions? How can it be fixed?

Regards,
Irina

@cap.aspose,

Thank you for contacting Aspose support team.

I have tried this scenario by connecting to my test account through Imap about 100 of times in a loop but could not observe this issue. We need some test application which can be compiled and executed here to reproduce the scenario. I am afraid that without this we won’t be able to provide assistance properly. Could you please arrange some application (and test account if possible) for our analysis here?

Hi Kashif,

I suppose that it’s a environment problem.
Thanks.

Regards,
Irina

@cap.aspose,

Thank you for sharing the update with us. Please feel free to write to us if you have any further query related to the API.