Clean maildirs when opened

This removes old aborted deliveries from the tmp directory.
This commit is contained in:
Ben Burwell 2019-07-30 15:12:15 -04:00 committed by Drew DeVault
parent bfefafff27
commit 04ccbd09b1
1 changed files with 4 additions and 0 deletions

View File

@ -202,6 +202,10 @@ func (w *Worker) handleOpenDirectory(msg *types.OpenDirectory) error {
return fmt.Errorf("could not add watch to directory: %v", err)
}
if err := dir.Clean(); err != nil {
return fmt.Errorf("could not clean directory: %v", err)
}
// TODO: why does this need to be sent twice??
info := &types.DirectoryInfo{
Info: &models.DirectoryInfo{