You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Immediately resolve InputStreams when building emails, don't reuse #268
Hi, we run into a problem where we have an email signed with a PKCS12 key store. Sending the mail goes as expected, and the mail is signed and sent.
Next, we want to store that email for archiving, but EmailConverter.emailToEML(email) seems to re-use the stream in which the key store is provided, resulting in an IOException.
I'm not too happy how input streams are handled, because it provides the problem you describe. However reading the contents in the Email means moving some logic to the builder which also shouldn't be there. Perhaps I should remove support for manual input streams altogether...
No, we are using the EmailBuilder and indeed add the inputstream to signWithSmime (for the key). There is an option to add a file, but the first thing that happens in the EmailPopulatingBuilderImpl is creating an inputstream of that file, so that also isn't a solution/workarround for us.
changed the title [-]Converting signed mail to .eml re-uses PKCS12 key store stream[/-][+]Immediately resolve InputStreams when building emails, don't reuse[/+]on Jul 19, 2020
The api remains largely the same (expanded with byte[] versions), but any input stream passed into the api is resolved immediately now so it won't cause issues lateron.
It would be of great help if you could confirm whether 6.4.0 works for your use case.
Activity
bbottema commentedon Jun 13, 2020
Are you providing the input stream yourself?
I'm not too happy how input streams are handled, because it provides the problem you describe. However reading the contents in the Email means moving some logic to the builder which also shouldn't be there. Perhaps I should remove support for manual input streams altogether...
DJAxion commentedon Jun 15, 2020
No, we are using the EmailBuilder and indeed add the inputstream to signWithSmime (for the key). There is an option to add a file, but the first thing that happens in the EmailPopulatingBuilderImpl is creating an inputstream of that file, so that also isn't a solution/workarround for us.
[-]Converting signed mail to .eml re-uses PKCS12 key store stream[/-][+]Immediately resolve InputStreams when building emails, don't reuse[/+]#268: Resolve all input streams immediately, don't keep references or…
bbottema commentedon Jul 19, 2020
Fix released in 6.4.0.
The api remains largely the same (expanded with byte[] versions), but any input stream passed into the api is resolved immediately now so it won't cause issues lateron.
It would be of great help if you could confirm whether 6.4.0 works for your use case.
DJAxion commentedon Sep 17, 2020
Sorry for the late response, but I can confirm it's working now! Thanks for your support.