about summary refs log tree commit diff stats
path: root/worker
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2019-07-30 15:12:15 -0400
committerDrew DeVault <sir@cmpwn.com>2019-08-02 09:26:07 -0400
commit04ccbd09b1f9369949b89b4815752d08a0ca9786 (patch)
tree0cdf4ab0f5545c8ab02b2955c53479a7d134a5b8 /worker
parentbfefafff27b126c485054c4d357e095ea2bd1147 (diff)
downloadaerc-04ccbd09b1f9369949b89b4815752d08a0ca9786.tar.gz
Clean maildirs when opened
This removes old aborted deliveries from the tmp directory.
Diffstat (limited to 'worker')
-rw-r--r--worker/maildir/worker.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/worker/maildir/worker.go b/worker/maildir/worker.go
index aa54af5..533bb7c 100644
--- a/worker/maildir/worker.go
+++ b/worker/maildir/worker.go
@@ -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{
'>9dca5395 ^
4f9f75dd ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32