aboutsummaryrefslogtreecommitdiffstats
path: root/worker/jmap
Commit message (Collapse)AuthorAgeFilesLines
* jmap: fix crash when opening multiple instancesRobin Jarry2023-07-152-16/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following error when opening another aerc instance with the same jmap account: panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x9a1ffd] git.sr.ht/~rjarry/aerc/worker/jmap/cache.(*JMAPCache).get(0x99d08e?, {0xbc3c1a?, 0xc00003a160?}) git.sr.ht/~rjarry/aerc/worker/jmap/cache/cache.go:47 +0x1d git.sr.ht/~rjarry/aerc/worker/jmap/cache.(*JMAPCache).GetSession(0xc00052a030?) git.sr.ht/~rjarry/aerc/worker/jmap/cache/session.go:8 +0x29 git.sr.ht/~rjarry/aerc/worker/jmap.(*JMAPWorker).handleConnect(0xc00055e180, 0x0?) git.sr.ht/~rjarry/aerc/worker/jmap/connect.go:29 +0xd3 git.sr.ht/~rjarry/aerc/worker/jmap.(*JMAPWorker).handleMessage(0xc000311500?, {0xcc8b00?, 0xc0001fcff0?}) git.sr.ht/~rjarry/aerc/worker/jmap/worker.go:114 +0x9f git.sr.ht/~rjarry/aerc/worker/jmap.(*JMAPWorker).Run(0xc00055e180) git.sr.ht/~rjarry/aerc/worker/jmap/worker.go:177 +0x10c git.sr.ht/~rjarry/aerc/widgets.NewAccountView.func3() git.sr.ht/~rjarry/aerc/widgets/account.go:110 +0x65 created by git.sr.ht/~rjarry/aerc/widgets.NewAccountView git.sr.ht/~rjarry/aerc/widgets/account.go:103 +0x518 Do not return an error if the leveldb cannot be opened, log a message and fallback on the in-memory cache. Fixes: be0bfc1ae28b ("worker: add jmap support") Reported-by: Tim Culverhouse <tim@timculverhouse.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* jmap: avoid displaying archive folder when use-labels=trueRobin Jarry2023-06-253-6/+22
| | | | | | | | | | When archiving a message, the counts of archive folder are changed. When use-labels=true, the archive folder is hidden and should remain so. Do not send updates to the UI. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* worker: add WorkerInteractor interfaceKoni Marti2023-06-221-1/+1
| | | | | | | | | | | | Add a WorkerInteractor interface. Avoid exposing any public fields in the types.Worker. This will set the stage to implement a middleware pattern for the workers, i.e. to map folder names between the ui and the backend. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Signed-off-by: Robin Jarry <robin@jarry.cc>
* worker: add jmap supportRobin Jarry2023-06-2119-0/+2293
Add support for JMAP backends. This is on par with IMAP features with some additions specific to JMAP: * tagging * sending emails This makes use of git.sr.ht/~rockorager/go-jmap for the low level interaction with the JMAP server. The transport is JSON over HTTPS. For now, only oauthbearer with token is supported. If this proves useful, we may need to file for an official three-legged oauth support at JMAP providers. I have tested most features and this seems to be reliable. There are some quirks with the use-labels option. Especially when moving and deleting messages from the "All mail" virtual folder (see aerc-jmap(5)). Overall, the user experience is nice and there are a lot less background updates issues than with IMAP (damn IDLE mode hanging after restoring from sleep). I know that not everyone has access to a JMAP provider. For those interested, there are at least these two commercial offerings: https://www.fastmail.com/ https://www.topicbox.com/ And, if you host your own mail, you can use a JMAP capable server: https://stalw.art/jmap/ https://www.cyrusimap.org/imap/download/installation/http/jmap.html Link: https://www.rfc-editor.org/rfc/rfc8620.html Link: https://www.rfc-editor.org/rfc/rfc8621.html Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>