`NullReferenceException` in `MessageValidator.Validate`

Hi, I working with a customer’s email (.eml file) and use “Aspose.Email” NuGet package, version=“24.8.0”, targetFramework=“net472”.

I can successfully create the MailMessage instance via MailMessage.Load(EMailMessageFilePath); but when I call MessageValidator.Validate(EMailMessageFilePath) I get the NullReferenceException with the following call stack:

Aspose.Email.dll!#=ze4T6vCdCS55Ath2T7c55kB5l6xi4j$6nnA==.#=ze4T6vCdCS55Ath2T7c55kB5l6xi4j$6nnA==(#=z9fiRr7nfmh7mrzCQVoujjihzWtH55HE__Q== #=zaRTr64o=)	Unknown
Aspose.Email.dll!#=z9fiRr7nfmh7mrzCQVoujjihzWtH55HE__Q==.#=zqKWi7J4=(System.IO.Stream #=zVhu4sBU=)	Unknown
Aspose.Email.dll!#=z9fiRr7nfmh7mrzCQVoujjihzWtH55HE__Q==.#=z9fiRr7nfmh7mrzCQVoujjihzWtH55HE__Q==(System.IO.Stream #=zVhu4sBU=, #=z8HyVVSA0Okoe$M2t25Y1YkUkwZSW #=zR8A6XPVeNCWkZ9geWA==)	Unknown
Aspose.Email.dll!Aspose.Email.Tools.FileFormatUtil.#=zKr2lKUy7ixoF(System.IO.Stream #=zVhu4sBU=)	Unknown
Aspose.Email.dll!Aspose.Email.Tools.FileFormatUtil.DetectFileFormat(System.IO.Stream stream)	Unknown
Aspose.Email.dll!Aspose.Email.Tools.Verifications.MessageValidator.Validate(System.IO.Stream stream)	Unknown
Aspose.Email.dll!Aspose.Email.Tools.Verifications.MessageValidator.Validate(string fileName)	Unknown
TestLoadEMail.exe!TestLoadEMail.Program.Main(string[] args) Line 21	C#

Hello @ViIvanov ,

Welcome to our community!

We’ll help you gladly. Please share an eml file with us for investigation.

Thank you.

Hi,

Sorry, but I could not share the file, it is a private customer’s email:

  • without subject
  • contains 3 attachments: PDF without extension, JPG and another JPG
  • The body contains only a signature.

I’m not (yet?) a client of Aspose, just tested the library and reported an issue I found.
If the Devs could not see what causes NRE using the call stack I have provided, I’m sorry. If I can share an email with the same error in the future, I will do it.

@ViIvanov ,

Unfortunately, in most cases, a stack trace is not enough for investigation, we need to have the data that caused the problem. Please note that in future we can make the topic private for customers to share sensitive information.

Anyway, we’ll create a ticket for the issue and try to reproduce the problem. Thank you for your report.

1 Like