Http 440 Timeout exception with EWS Exchange server

Hi

I have a customer with an exchange server (EWS from the customer). I can access this email through Google Chrome, but cannot access in my code. Below is my code snippet. I am creating an ExcahngeWebServiceClient first, which succeeds. However, the GetMailBoxSize() call always give me an “http 440 Timeout” exception. This exception was thrown so fast that I do not think it is a real timeout. can anyone help me on this? Thanks.

Moreover, this email server URL has some extra info so that the user has permission to access the email box but does not own it.

Note:

My code works when the user is the owner, but when the user has permissions on the inbox but is not the owner I get the 440 error.

The URL to access using a browser is a bit unique:

[https://webmail.mydomain.com/ows/InternalABC.Acct5@mydomain.com ](https://webmail.mydomain.com/ows/InternalABC.Acct5@mydomain.com)

I’m not sure what URL I should use in my code since it is normally

https://" + config.ServerUrl + “/ews/Exchange.asmx”;

Below is the code.

try

{

using (ExchangeWebServiceClient client = GetExchangeWebServiceClient(config))

{

client.GetMailboxSize();

return ExchangeServerType.EWS;

}

}

catch {

}

private static ExchangeWebServiceClient GetExchangeWebServiceClient(ExchangeClientConfig config)

{

string domain = string.Empty, userName = string.Empty;

Utils.ExtractDomain(config.UserName, ref domain, ref userName);

string serverUrl = config.ServerUrl.StartsWith("https://") ? config.ServerUrl + "/ews/Exchange.asmx" : "https://" + config.ServerUrl + "/ews/Exchange.asmx";

ExchangeWebServiceClient client = new ExchangeWebServiceClient(serverUrl, userName, Encryptor.Decrypt(config.Password), domain);

return client;

}

Hi Xu,


We are sorry for a delayed response.

Using EWS, the URI is always of the form https://exchange-server-host/ews/Exchange.asmx. I am afraid but using Aspose.Email, we haven’t faced this error before. In order to investigate this issue further, could you please creaete a test account for us on your server so taht we can look into this issue and assist you further. Your cooperation is highly appreciated in this regard.


I have one more issue:


My company just moved local Exchange Server to cloude, outlook.office365.com. I can access it using IE, but cannot access using Aspose. should I still append the “ews/Exchange.asmx” when it is at cloud? I tried appending and not appending it but neither worked. Thanks.

Hi Xu,

I don’t have a test account to validate it, but from our issue tracking system, I can verify that the Mailbox uri is of the form “https://company.outlook.com/EWS/Exchange.asmx” which shows that this has to be part of the valid url. You can take help from [https://www.testexchangeconnectivity.com/ ](https://www.testexchangeconnectivity.com/) about verifying the correctness of EWS URL, Username and Password are correct Please let us know your feedback then.

Hi

sorry that things have been distracted. Let us go back to our original question: do you support delegate email box?

We have a customer who has an EWS exchange server. they have two kind of email accounts: owner and delegate. We used Aspose to access their email boxes. It worked fine with owner email box, but gave me the “http 440 timeout” exception for delegate email account.

Let us say [webmail.abc.com](http://webmail.abc.com/) is the URL for regular owner account, the delegate mailbox URL is [webmail.abc.com/owa/xyz@abc.com](http://webmail.abc.com/owa/xyz@abc.com), then I log in using the delegate credential (not xyz). do you support such kind of mail box? if yes, how should I do it? Thanks.

Hi Xu,


EWS does support accessing mailbox information for accounts with delegate access. For this, you access the Exchange server with the same username and password, and mention the other user’s address in the GetMailboxInfo. This is mentioned as here in the article.

Sample Code:

// Create instance of ExchangeWebServiceClient class by giving MailboxURI & credentials
ExchangeWebServiceClient client = new ExchangeWebServiceClient(mailboxURI, credential);

// Get Exchange mailbox info of other email account
ExchangeMailboxInfo mailboxInfo = client.GetMailboxInfo(”otherUser@domain.com”);