getmail can't save to an external drive
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.
Affects me too. Why can't getfile just use os.rename?