[ 
https://issues.apache.org/jira/browse/JDKIM-18?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Aldrich updated JDKIM-18:
-----------------------------


After doing a little more research into mime4j it looks like we are just not 
calling the dispose method. I added this code to the Message.java:

    @Override
    protected void finalize() {
        this.message.dispose();
    }

So when the gc comes around to clean up the object it deletes the temp files. 



> jdkim verify(InputStream) doesn't clean up temp files until shutdown
> --------------------------------------------------------------------
>
>                 Key: JDKIM-18
>                 URL: https://issues.apache.org/jira/browse/JDKIM-18
>             Project: JAMES jDKIM
>          Issue Type: Bug
>          Components: library
>    Affects Versions: 0.2
>         Environment: Verified this in solaris 10 and ubuntu 10.04 
> java 1.6.0_13
>            Reporter: Ben Aldrich
>            Priority: Critical
>
> When you pass jdkim an input stream like so :
> new DKIMVerifier().verify(new ByteArrayInputStream(sb.toString().getBytes()));
> the jkdim impl/Message.java creates a mime4j temp file that doesn't get 
> deleted until the application exits. This causes any system that runs as a 
> daemon to eventually run out of disk space. 
> I did a quick test and replaced Message.java with my own implementation using 
> the regular javax MimeMessage to pull out the headers and the app no longer 
> creates the temp files. This isn't really a good solution though because now 
> I can't pass simple canonicalization. I don't know mime4j very well but 
> digging through the source it only sets the deleteOnExit flag by default. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to