aboutsummaryrefslogtreecommitdiffstats
path: root/worker/jmap/cache/blob.go
Commit message (Collapse)AuthorAgeFilesLines
* jmap: avoid crash when server returns garbageRobin Jarry2024-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For some reason, a JMAP server may send message details with empty blobId values. This is invalid but it should not cause a crash. Error: runtime error: slice bounds out of range [-2:] goroutine 16 [running]: git.sr.ht/~rjarry/aerc/worker/jmap/cache.(*JMAPCache).blobPath() git.sr.ht/~rjarry/aerc/worker/jmap/cache/blob.go:43 +0x95 git.sr.ht/~rjarry/aerc/worker/jmap/cache.(*JMAPCache).GetBlob() git.sr.ht/~rjarry/aerc/worker/jmap/cache/blob.go:11 +0x18 git.sr.ht/~rjarry/aerc/worker/jmap.(*JMAPWorker).handleFetchMessageBodyPart() git.sr.ht/~rjarry/aerc/worker/jmap/fetch.go:116 +0x26f git.sr.ht/~rjarry/aerc/worker/jmap.(*JMAPWorker).handleMessage() git.sr.ht/~rjarry/aerc/worker/jmap/worker.go:142 +0x25f git.sr.ht/~rjarry/aerc/worker/jmap.(*JMAPWorker).Run() git.sr.ht/~rjarry/aerc/worker/jmap/worker.go:177 +0x105 git.sr.ht/~rjarry/aerc/app.NewAccountView.func3() git.sr.ht/~rjarry/aerc/app/account.go:105 +0x57 created by git.sr.ht/~rjarry/aerc/app.NewAccountView in goroutine 1 git.sr.ht/~rjarry/aerc/app/account.go:98 +0x468 Ignore a blobId when it is an empty string. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io>
* worker: add jmap supportRobin Jarry2023-06-211-0/+45
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>