Aspose.Email 21.8.1 throws AsposeException: Der Speicherdatenstrom kann nicht erweitert werden

Hi,

I have an e-mail (15 MB) whose download fails on some computers but is successful on others. What could be the cause of this expception that is thrown?

02.03.2022 18:21:08: [xxx@xxx.com] Error while loading current message: AsposeException: Der Speicherdatenstrom kann nicht erweitert werden.
—> AsposeException: Der Speicherdatenstrom kann nicht erweitert werden.
—> System.NotSupportedException: Der Speicherdatenstrom kann nicht erweitert werden.
bei System.IO.__Error.MemoryStreamNotExpandable()
bei System.IO.MemoryStream.set_Capacity(Int32 value)
bei System.IO.MemoryStream.EnsureCapacity(Int32 value)
bei System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
bei #=zZ9WS5C$sKbkDA9SOMDfU4baCjZQQWcaBtQ==.#=znt5izKh0RJlk(Stream #=z38dto3s=, Stream #=z0RIcShs=, Int32 #=zIIItc8U=)
bei #=zeUMxT5b86eBtUCKjmfThWi6EgKfBovZBPCZHHQg=.#=zfkT7W4UZfiyx()
bei #=zBAsTP9YuXv3Os7WmxHgpvPyOrjMQEnp8XEXN7Ps=.#=zBNjMDj0=(Object #=z5Dlyjc0=)
— End of inner exception stack trace —
bei #=zfCU2qSy0a2_ihcIx82G4kEJztypC.#=zQwgvq3I=(IAsyncResult #=zyHxEsz0=)
bei #=zfCU2qSy0a2_ihcIx82G4kEJztypC.#=zB7nANhM=()
bei #=zF3vCKGpIJbs8sqONhxhS8Ql0$UO3shyVygSHrr8=.#=zcgQIJgM=()
bei #=zQPzHQqG7ARjSHN8VvToHvB05EwZTzzKEmA==.#=zX5bSumVhf7LP()
— End of inner exception stack trace —
bei #=zfCU2qSy0a2_ihcIx82G4kEJztypC.#=zQwgvq3I=(IAsyncResult #=zyHxEsz0=)
bei #=zfCU2qSy0a2_ihcIx82G4kEJztypC.#=zQwgvq3I=()
bei Aspose.Email.Clients.Imap.ImapClient.EndFetchMessage(IAsyncResult asyncResult)
bei Aspose.Email.Clients.Imap.ImapClient.FetchMessage(String uniqueId)
bei Com.Kendox.MailArchiver.Library.MailProviders.Imap.ImapItem.LoadCurrentMessage()
02.03.2022 18:21:08: [xxx@xxx.com] Could not download item from e-mail provider - skipping item subject [xxx- Rechnung ()]

My environment:
Aspose.Email v21.8.1
c#
IMAP

@pfa

Please try the latest version of Aspose.Email for .NET 22.2 and let us know how it goes on your side. Hope this helps you.

Hi,

we tried it with version 22.2.0.0, and this version does not log an exception, but does not extract the attachment, either:

24.03.2022 21:03:06: [xxx@xxx.com] MailType [None] for writing item to temporary file
24.03.2022 21:03:06: [xxx@xxx.com] No. of attachments = 0

The email in question has an attachment (PDF) that is visible in Thunderbird and can be opened in a PDF reader.

Please advise. Thanks in advance!

@pfa

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input email.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

@tahir.manzoor

Hi,

here you can download our standalone test application, its output, and the email used for the test:

https://kendox-my.sharepoint.com/:u:/p/christopher_wienand/EW1zflxacWFEjslI0SaSFHcBdpEgI9hZGoiikSofMZAIqA?e=z7q3Zt

As you can see from the screenshots, it appears that the downloaded email is an empty file, but the email can be opened in e.g. Thunderbird, and and its attachment in e.g. Adobe Reader.

I don’t think it is relevant, but just in case: In our production environment we have to use the following options:
client.SecurityOptions = SecurityOptions.None;
client.Port = 143;

Thanks!

@pfa

Please grant us the access to the shared ZIP file. We will then investigate the issue and provide you more information on it.