getmail icon indicating copy to clipboard operation
getmail copied to clipboard

getmail can't save to an external drive

Open filkry opened this issue 12 years ago • 1 comments

I experienced this issue trying to have getmail run in a VM and write to a shared folder. I found another example of the problem online.

The error I experienced is: "Delivery error (maildir delivery #### error (127, maildir delivery process failed (failure renaming "/path/to/tmp/file" to "/path/to/new/file")))

When getmail tries to copy mail from tmp to new, it uses the following call:

# Move message file from Maildir/tmp to Maildir/new
try:
    os.link(fname_tmp, fname_new)
    os.unlink(fname_tmp)

os.link tries to create a new hard link, which won't work on a drive that isn't mounted as a standard device.

My gut reaction is that this could be fixed using shutil.copyfile(src, dst), but I don't know if getmail relies on important file metadata. In addition, it introduces another dependency.

filkry avatar May 27 '13 17:05 filkry

Affects me too. Why can't getfile just use os.rename?

geloescht avatar Mar 15 '16 16:03 geloescht