When we made the upgrade of aspose version from 20.9 to 20.12, the intended issue was solved, but we observed another issue.
The code is not populating properly the value for the header id: 924057603 in MapiMessage for inline attachment.
For the previous version (Aspose 20.9) the value for this header was obtained as 4(in case of Inline attachments). But with the upgrade version the value for the same header is coming out to be 0(inline or not).
On gathering more knowledge about this header we found out for inline attachment the value for this header should be 4.
I am providing an end-to-end working code for your verification.
To run it:
Download the zip,
decompress it
navigate inside the directory and run.
mvn install
The code will run at first build. Go to the pom and upgrade the version of aspose to 20.12 from 20.9
Run the above maven command. The code should fail.
@curtisyamada
Thank you for the project example. I have reproduced the problem and got the same results with Aspose.Email 21.1 as well. I have logged the issue in our tracking system with ID EMAILJAVA-34792. Our development team will investigate it. You will be notified when it is fixed.
Hello,
I did try the solution you proposed.
The PR_ATTACH_FLAG seem to be getting populated properly…
Is there a way I can set the fileName or display name of the linkedResource attachment…??(Like the normal attachment)
LinkedResource class does not have a file name field. ContentType object contains the file name. You can use it through getName and setName methods (API Reference: ContentType class).
You should also set content type data entirely instead of using “application/octet-stream” value.
@curtisyamada,
I verified the setName method and found no problems. To my regret, I cannot verify your code snippet that contains unknown symbols. Could you please share a simple standalone project that can be used to investigate the issue? Please also specify or describe what is wrong.
Please find my new project(aspose-test_2.zip)
To execute the test class, follow the same process as mentioned in the first message of this thread.
You will find the test case is failing because the expected fileName is b.png but the filename generated by MapiMessage.fromMailMessage is image001.png
The expected output is that MapiMessage.fromMailMessage should also generate the fileName to be b.png.
Let me know if we are missing something.
@curtisyamada,
I investigated the issue and got the same results. The additional information has been sent to our developers. I will let you know about any progress. Thank you for your patience.
@curtisyamada,
Thank you for your remarks. I verified it and received the same results. I have sent your information to our development team. Thank you for your patience.
@curtisyamada,
A LinkedResource.getContentDisposition method has been added to modify Content-Disposition header. It will be released with Aspose.Email 21.3, but you can use this method with Aspose.Email 21.2.1 now.
Code sample for your purposes:
LinkedResource attachment = new LinkedResource(is);
attachment.setContentType(new ContentType(part.getContentType()));
attachment.setContentId(values[0]);
attachment.getContentDisposition().setFileName(fileName.toString());