[Dovecot] unlink_directory(....Trash.NewFolder) failed: Directory not empty

Adam McDougall mcdouga9 at egr.msu.edu
Sun Nov 18 17:07:43 EET 2007


On Sun, Nov 18, 2007 at 11:12:46AM +0200, Timo Sirainen wrote:

  On Fri, 2007-11-16 at 19:50 -0500, Adam McDougall wrote:
  > 3.  Right click on Trash folder in Thunderbird, choose "Empty Trash":
  > 
  > Nov 16 19:47:25 boomhauer dovecot: IMAP(mcdouga9): 
  > unlink_directory(/home/mcdouga9/Maildir/dovecot/boomhauer/private/indexes/.Trash.NewFolder) failed: Directory not 
  > empty
  ..
  > (sometimes has a .nfs.blahblah file, I think I failed to catch it quick enough this time)
  
  I think that's the problem. If Thunderbird opens the mailbox in one
  connection and then tries to delete it in another connection, Dovecot
  still has some files open in that directory and when they're deleted
  kernel goes and renames them to those .nfs* files.
  
  I'm not sure if there's anything I can do about that, except maybe try
  to give a nicer error message ("Internal error" -> "Can't delete an open
  mailbox").
  
Please don't make dovecot treat it as a bigger problem (disconnect or even give an 
error) if there is nothing that can be done to improve the situation, I don't want my 
users to complain to me because their email client gives them a loud error because my 
server is unable to delete non-empty directories.  I would bet my users don't delete 
folders very often, in fact my old server would fail folder deletion with an error 
for thunderbird clients because you cannot move a folder into a mbox Trash 
(workaround was to delete immediately).  If we delete a folder and empty trash right 
away, it will reappear later either after a reconnect or maybe if the Trash folder 
gets refreshed.  Definitely after a reconnect, the second attempt to empty Trash 
works.  If I am lucky, human nature might make them wonder if they forgot to empty 
trash :) If there is no way to make all dovecot processes close all files in a folder 
to be purged from trash, on at least the same server, I guess I could settle for the 
current behavior.  If a workaround is needed to empty trash and its not too much 
trouble for the user, we'll just have to document it in our knowledge base.  Thanks 
for your consideration.  



More information about the dovecot mailing list