phax / as2-lib

A generic Java AS2 library, servlet and server
107 stars 43 forks source link

bcMail temporary files not deleted when compression is used (as2-lib 5.1.2) #149

Open krisztina-zsihovszki opened 5 months ago

krisztina-zsihovszki commented 5 months ago

I am facing a similar issue that was reported here https://github.com/phax/as2-lib/issues/103, while I am using as2-lib v5.1.2 where the error reported in #103 is already fixed.

It seems the root cause is the same, the SMIMEUtil.toMimeBodyPart call. In my case the method is invoked in AS2ReceiverHandler.decompress().

The SMIMEUtil.toMimeBodyPart method is called without the AS2ResourceHelper.createTempFile() parameter in AS2ReceiverHandler. I suppose this is the reason why the temporary bcMail*.mime files are not cleaned up by AS2ResourceHelper. When compression is not used, no mime file is generated in /tmp directory.