summary refs log tree commit diff stats
path: root/worker/imap/movecopy.go
diff options
context:
space:
mode:
Diffstat (limited to 'worker/imap/movecopy.go')
-rw-r--r--worker/imap/movecopy.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/worker/imap/movecopy.go b/worker/imap/movecopy.go
index 8c42a2e..1234e60 100644
--- a/worker/imap/movecopy.go
+++ b/worker/imap/movecopy.go
@@ -1,6 +1,8 @@
 package imap
 
 import (
+	"io"
+
 	"git.sr.ht/~sircmpwn/aerc2/worker/types"
 )
 
@@ -14,3 +16,28 @@ func (imapw *IMAPWorker) handleCopyMessages(msg *types.CopyMessages) {
 		imapw.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil)
 	}
 }
+
+type appendLiteral struct {
+	io.Reader
+	Length int
+}
+
+func (m appendLiteral) Len() int {
+	return m.Length
+}
+
+func (imapw *IMAPWorker) handleAppendMessage(msg *types.AppendMessage) {
+	if err := imapw.client.Append(msg.Destination, msg.Flags, msg.Date,
+		&appendLiteral{
+			Reader: msg.Reader,
+			Length: msg.Length,
+		}); err != nil {
+
+		imapw.worker.PostMessage(&types.Error{
+			Message: types.RespondTo(msg),
+			Error:   err,
+		}, nil)
+	} else {
+		imapw.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil)
+	}
+}
es/original_bright?id=30b5f112fd81890411d6fe52c1f442f4433e0d01'>30b5f112 ^
fa3c6779 ^





30b5f112 ^
fa3c6779 ^
30b5f112 ^
fa3c6779 ^
fa3c6779 ^



fa3c6779 ^
cd2458c0 ^

fa3c6779 ^
b21edfaa ^
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52