Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to rename file on different mount point #10

Open
sekkuar opened this issue Aug 17, 2017 · 2 comments
Open

Unable to rename file on different mount point #10

sekkuar opened this issue Aug 17, 2017 · 2 comments

Comments

@sekkuar
Copy link

sekkuar commented Aug 17, 2017

When mailbox file cannot be moved to the /tmp/ directory, saving the mailbox file fails

>mv /var/spool/mail/sardev /tmp/sardevmail
mv: 0653-404 /tmp/sardevmail: Unable to duplicate owner and mode after move.
mv: 0653-406 Cannot remove source file /var/spool/mail/sardev
javax.mail.MessagingException: Error purging mbox file;
  nested exception is:
    java.io.IOException: Unable to rename existing file
    at net.fortuna.mstor.connector.mbox.MboxFolder.expunge(MboxFolder.java:373)

As discussed on the forums
https://sourceforge.net/p/mstor/discussion/390660/thread/662967b0/

@benfortuna
Copy link
Member

After looking at the code I realised you can probably fix this by overriding the java.io.tmpdir system property:

    File newFile = new File(System.getProperty("java.io.tmpdir"),
    file.getName() + TEMP_FILE_EXTENSION);

Try setting this property to a directory on the same mount point as the original mbox file. If you can't override this system property we can probably support a specific temp directory just for mstor.

@sekkuar
Copy link
Author

sekkuar commented Oct 13, 2017

Well, I'm not longer part of that project, and the official solution was to make our own build removing the exception throwing.

However, I do believe it is a good thing to have the API work regardless of system properties, as other parts of the application may rely on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants