summary refs log tree commit diff stats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/aerc.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/widgets/aerc.go b/widgets/aerc.go
index 23dac3e..5a7914a 100644
--- a/widgets/aerc.go
+++ b/widgets/aerc.go
@@ -2,6 +2,7 @@ package widgets
 
 import (
 	"errors"
+	"io"
 	"log"
 	"net/url"
 	"strings"
@@ -405,3 +406,21 @@ func (aerc *Aerc) Mailto(addr *url.URL) error {
 	})
 	return nil
 }
+
+func (aerc *Aerc) CloseBackends() error {
+	var returnErr error
+	for _, acct := range aerc.accounts {
+		var raw interface{} = acct.worker.Backend
+		c, ok := raw.(io.Closer)
+		if !ok {
+			continue
+		}
+		err := c.Close()
+		if err != nil {
+			returnErr = err
+			aerc.logger.Printf("Closing backend failed for %v: %v\n",
+				acct.Name(), err)
+		}
+	}
+	return returnErr
+}
oc/aerc-smtp.5.scd?h=0.4.0&id=b8208509f47301bcb03bc222f5e5765833478250'>^
b820850 ^
fc719e4 ^

4875813 ^
fc719e4 ^





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
53
54
55
56
57
58
59
60