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

Free Support Forum - aspose.com

GetMailboxSize() returns negative value

Hi,

When I use GetMailboxSize() method, I’ve got negative value: -574884297 bytes (~0.5 GB). When I check in the OWA, I see that my mailbox’s actual size is 18 GB. (I’ve tried with multiple mailboxes, but I always got negative value…)

Could you help me, what is go wrong.

Thank you in advance.
Gabor

    static void Main(string[] args)
    {
        try
        {
            License lic = new License();
            lic.SetLicense("Aspose.Total.lic");

            NetworkCredential credentials = new NetworkCredential(ConfigurationManager.AppSettings["Username"], ConfigurationManager.AppSettings["Password"], ConfigurationManager.AppSettings["Domain"]);
            using (IEWSClient client = EWSClient.GetEWSClient(ConfigurationManager.AppSettings["EwsUri"], credentials))
            {
                Console.WriteLine("Size: {0} bytes", client.GetMailboxSize(client.GetMailboxInfo().MailboxUri));
            }
        }
        catch(Exception ex)
        {
            Console.WriteLine("Error: {0}", ex.Message);
        }

        Console.ReadLine();
    }

@careall,

Thank you for posting your inquiry.

We are not able to reproduce the issue at our end with the latest version of the API. Could you please verify if you are using the latest version of the API at your end?

Hi,

Yes, I’m using the latest one from Nuget, 17.6.0.0.
The Exchange Server is verion 2013 (15.0.847.51).

The above code returns with this: “Size: -574246564 bytes”.

@careall,

We have tested the same code sample with Exchange Server 2010, 2013 and Office365, but were not able to observe any such issue at our end. If possible, please create a test account on your Exchange Server and share its credentials with us for further investigation at our end.