aboutsummaryrefslogtreecommitdiffstats
path: root/worker/jmap/send.go
Commit message (Collapse)AuthorAgeFilesLines
* jmap: lazily fetch identitiesTim Culverhouse2024-08-201-0/+5
| | | | | | | | | | | | | Fetch Identities only when required: when we are sending an email. Refactor connect.go to check the state string of the Session on every request, and update the session as needed. Move the Session validity check to happen on any request, eg when our client returns an error we first update the Session object (via re-authenticating) and then retry the request. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* reply: allow copying to current folderRobin Jarry2024-08-031-5/+9
| | | | | | | | | Add a new copy-to-replied setting in accounts.conf to copy sent replies to the same folder than their replied message. Requested-by: Tristan Partin <tristan@partin.io> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tristan Partin <tristan@partin.io>
* jmap: do not keep invalid sessions in cacheRobin Jarry2024-07-021-2/+2
| | | | | | | | | | | If a session is found in the cache, check that it works by issuing a GetIdentities request. If that request fails, invalidate the cache and go through the authentication. Ensure that the session is valid and explicitly fail if it is not. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
* log: move package to libRobin Jarry2024-02-141-1/+1
| | | | | | | This has nothing to do at the root of the source tree. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Bence Ferdinandy <bence@ferdinandy.com>
* jmap: set explicit sender and recipientsKarel Balej2024-02-121-10/+12
| | | | | | | | | | | | | | | JMAP is able to automatically determine sender and recipients based on the message headers after it is submitted for sending. However this means that it is not possible to send a message with the From header not matching the account with this approach (or to send the message to recipients not listed in the headers). Luckily, JMAP allows setting the envelope containing the envelope sender and recipients manually. Modify the code to do so. Also bump go-jmap to include a fix needed for this to work. Signed-off-by: Karel Balej <balejk@matfyz.cz> Acked-by: Robin Jarry <robin@jarry.cc>
* worker: add jmap supportRobin Jarry2023-06-211-0/+144
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>