summary refs log tree commit diff stats
path: root/worker
Commit message (Collapse)AuthorAgeFilesLines
* imap: add manual {dis,}connect supportRobin Jarry2021-11-051-2/+14
| | | | Signed-off-by: Robin Jarry <robin@jarry.cc>
* go.mod: change base git urlRobin Jarry2021-11-0523-45/+45
| | | | | | | I'm not sure what are the implications but it seems required. Link: https://github.com/golang/go/issues/20883 Signed-off-by: Robin Jarry <robin@jarry.cc>
* imap: use builtin idle supportRobin Jarry2021-11-022-7/+2
| | | | | | | go-imap supports IDLE since 1.2.0. Remove dependency to go-imap-idle. Link: https://github.com/emersion/go-imap/commit/ac3f8e195ef1b6d Signed-off-by: Robin Jarry <robin@jarry.cc>
* maildir: track the recent flag correctlyReto Brunner2021-11-012-31/+55
| | | | | | | | In the maildir worker we manually need to track the Recent flag in order for the notification command etc to work. Push that responsibility to the container, we must make sure to manually add the flag though if one grabs the message info.
* notmuch/maildir: remove double emit of the dirinfoReto Brunner2021-04-282-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was some bug which could be worked around by double emitting an event. However that proofed to be brittle: We send the first message here from the worker goroutine: https://git.sr.ht/~sircmpwn/aerc/tree/a5553438/item/worker/maildir/worker.g= o#L306 Then Tick() is waked in the main goroutine and calls ProcessMessage: https://git.sr.ht/~sircmpwn/aerc/tree/a5553438/item/widgets/account.go#L100 ProcessMessage in the main goroutine reads types.Message state with msg.getId() and msg.InResponseTo(): https://git.sr.ht/~sircmpwn/aerc/tree/a5553438/item/worker/types/worker.go#= L74-76 Meanwhile in the worker goroutine we call PostMessage for a second time with a pointer that points to the *same* previous message that ProcessMessage is reading: https://git.sr.ht/~sircmpwn/aerc/tree/a5553438/item/worker/maildir/worker.g= o#L306 The second PostMessage call makes writes to message while ProcessMessage in the main goroutine is possibly reading: https://git.sr.ht/~sircmpwn/aerc/tree/a5553438/item/worker/types/worker.go#= L59 This led to a data race in the event loop Reported-By: Wagner Riffel <w@104d.net>
* lib/parse: simplify parseAddressListReto Brunner2021-02-221-13/+5
|
* maildir: don't read the full file into memoryReto Brunner2021-02-081-8/+2
|
* notmuch: don't read the full file into memoryReto Brunner2021-02-081-9/+3
|
* notmuch: trim excluded tagsKalyan Sriram2020-12-021-0/+3
| | | | | Trims whitespace in list of excluded notmuch tags. This allows a comma separated list with spaces to be correctly processed.
* notmuch: remove gc close hooksReto Brunner2020-12-021-0/+1
| | | | | | | We frequently had issues with notmuch segfaulting and my guess is that this was due to the garbage collection magic used in the module. This changes to a fork that ripped the functionality out.
* imap: strip <> from message-idsReto Brunner2020-11-141-1/+9
|
* lib/parse: use go-message msgid parsing if it succeedsReto Brunner2020-11-141-2/+6
|
* remove models.Address in favor of go-message AddressReto Brunner2020-11-143-13/+15
| | | | | | | We made a new type out of go-message/mail.Address without any real reason. This suddenly made it necessary to convert from one to the other without actually having any benefit whatsoever. This commit gets rid of the additional type
* imap: add sort supportReto Brunner2020-10-112-3/+50
|
* notmuch: rename method to SetFlagReto Brunner2020-09-272-5/+5
|
* notmuch: close tag objectReto Brunner2020-09-241-0/+1
|
* handle message unknown charset errorJeff Martin2020-08-313-2/+99
| | | | | | | | | | | | | | This change handles message parse errors by printing the error when the user tries to view the message. Specifically only handling unknown charset errors in this patch, but there are many types of invalid messages that can be handled in this way. aerc currently leaves certain messages in the msglist in the pending (spinner) state, and I'm unable to view or modify the message. aerc also only prints parse errors with message when they are initially loaded. This UX is a little better, because you can still see the header info about the message, and if you try to view it, you will see the specific error.
* base models.Address on the mail.Address typeReto Brunner2020-08-203-14/+3
| | | | | | | | | | | | This allows us to hook into the std libs implementation of parsing related stuff. For this, we need to get rid of the distinction between a mailbox and a host to just a single "address" field. However this is already the common case. All but one users immediately concatenated the mbox/domain to a single address. So this in effects makes it simpler for most cases and we simply do the transformation in the special case.
* Add support for :rmdirARaspiK2020-08-195-0/+41
| | | | | | | | | | | | | | | | | | | | | The `:rmdir` command removes the current directory (`-f` is required if the directory is not empty). This is not supported on the notmuch backend. An issue with the maildir backend is that some sync programs (e.g. offlineimap) may recover the directory after it is deleted. They need to specifically be configured to accept deletions, or special commands need to be executed (e.g. `offlineimap --delete-folder`) to properly delete folders. A danger of using this on the IMAP backend is that it is possible for a new message to be added to the directory and for aerc to not show it immediately (due to a slow connection) - using `:rmdir` at this moment (with `-f` if the directory already contains messages) would delete the directory and the new message that just arrived (and all other contents). This is documented in aerc(1) so that users are aware of possible risks.
* improve date parsing for notmuch/maildirReto Brunner2020-08-101-24/+49
| | | | | | | | | | | | | | | | | | | | If a message date would fail to parse, the worker would never receive the MessageInfo it asked for, and so it wouldn't display the message. The problem is the spec for date formats is too lax, so trying to ensure we can parse every weird date format out there is not a strategy we want to pursue. On the other hand, preventing the user from reading and working with a message due to the error format is also not a solution. The maildir and notmuch workers will now fallback to the internal date, which is based on the received header if we can't parse the format of the Date header. The UI will also fallback to the received header whenever the date header can't be parsed. This patch is based on the work done by Lyudmil Angelov <lyudmilangelov@gmail.com> But tries to handle a parsing error a bit more gracefully instead of just returning the zero date.
* notmuch: manually close notmuch objectsReto Brunner2020-08-071-0/+3
| | | | | There seems to be some race with the automatic closing that should happen in theory... close it manually where we can to avoid the issue
* maildir: Provide nicer error message on invalid urlTero Koskinen2020-07-272-4/+34
| | | | | | | | If accounts.conf contains an invalid maildir url, return a nice error instead of panicking. Log a couple of different error cases to provide extra information about the error to the user.
* Remove hard coded bodystruct path everywhereReto Brunner2020-07-272-7/+11
| | | | | | | Aerc usually used the path []int{1} if it didn't know what the proper path is. However this only works for multipart messages and breaks if it isn't one. This patch removes all the hard coding and extracts the necessary helpers to lib.
* Add flag based search optionsTobias Wölfel2020-07-252-2/+42
| | | | | | | Provide search and filter with the option to specify more flag based conditions. Use '-x <flag>' to search for messages with a flag (seen, answered, flagged) and '-X <flag>' to search for messages without a flag.
* Only send directory info once from maildirAndrew Jeffery2020-07-191-4/+5
| | | | | The directory info only needs to be sent once for all the messages, this reduces unnecessary messages being sent which could lock up the ui.
* run go fmtReto Brunner2020-07-171-2/+2
|
* Make it easier to debug date parsing errorsLyudmil Angelov2020-07-111-1/+1
| | | | | | | | | When message dates failed to parse, the error displayed would try to include the time object it failed to obtain, which would display as something like 0001-01-01 00:00:00 UTC, which isn't of much help. Instead, display the text we were trying to parse into a date, which makes the problem easier to debug.
* Add additional flagging functionalityARaspiK2020-07-087-91/+76
| | | | | | | | | | | | | | More mail flags can now be set, unset, and toggled, not just the read/seen flag. This functionality is implemented with a new `:flag` and `:unflag` command, which are extensions to the matching `:read` and `:unread` commands, adding support for different flags. In fact, the `read`/`unread` commands are now recognized aliases to `flag`/`unflag`. The new commands are also well documented in aerc(1). The change mostly extends the previous read/unread setting functionality by adding a selection for the flag to change.
* notmuch: fix docstringReto Brunner2020-07-081-1/+1
|
* notmuch: handle the answered flagReto Brunner2020-07-051-0/+2
|
* notmuch: undefined variable when setting reply flagSrivathsan Murali2020-05-261-1/+1
|
* Set AnsweredFlag on successful replySrivathsan Murali2020-05-257-0/+155
|
* imap: Remove FetchMessageBodyPart.{Encoding,Charset}Reto Brunner2020-05-162-110/+109
| | | | Fixes https://todo.sr.ht/~sircmpwn/aerc2/352 exactly as suggested by emersion.
* maildir: remove read handling from FetchMessageBodyPartReto Brunner2020-05-111-21/+0
|
* notmuch: remove read handling from FetchMessageBodyPartReto Brunner2020-05-111-13/+0
|
* Guess date from received if not presentelumbella2020-05-061-1/+41
|
* Allow maildir subdirectoriesGrégoire Delattre2020-05-051-11/+27
|
* store.FetchFull: Change callback type to expose entire messageBen Fiedler2020-05-011-0/+1
| | | | | This is a prerequisite for allowing the FetchFull message to return both the message content and the message headers.
* imap/fetch.go: report error when fetching headers failsBen Fiedler2020-04-241-3/+4
| | | | | Correct me if I'm wrong, but shouldn't this raise an error when it fails?
* Count recent messages in maildir exists total tooJeffas2020-03-091-1/+1
|
* Ignore missing message part in getDecodedPartAmir Yalon2020-03-091-1/+1
| | | | The code that calls this function handles nil without issues.
* Initial support for PGP decryption & signaturesDrew DeVault2020-03-031-3/+3
|
* worker/imap: rely on go-imap for charset handlingSimon Ser2020-03-031-31/+13
| | | | | Set imap.CharsetReader so that go-imap can automatically decode all encoded fields.
* Mark sent messages as "seen" in maildirGalen Abell2020-03-037-18/+56
| | | | | | | - Add maildir flags to complement a messages imap flags - Set the "seen" flag on sent messages when using the maildir backend - Cleanup AppendMessage interface to use models.Flag for both IMAP and maildir
* notmuch: emit dirinfo upon label changeReto Brunner2020-03-011-0/+3
|
* remove the dirInfoUpdateRequest functionalityReto Brunner2020-02-292-9/+0
| | | | | The notmuch worker followed suit in handling the dirInfo submission manually. That removes the last user so we might as well remove the functionality.
* notmuch: align dirInfo logic to the maildir workerReto Brunner2020-02-291-10/+13
|
* Cleanup sorting logicJeffas2020-02-281-155/+55
| | | | | | There was an unused error value as well as unnecessary usage of the sort interface. There should now be less copying so a bit better performance in some cases.
* Update DirectoryInfo handling for maildirJeffas2020-02-281-6/+50
| | | | | | | | | | | This ensures that the directory info is up to date on events in the maildir worker. This also sets up the initial dirinfo for other directories and updates them when using built-in commands. FS events are still only watched for the selected directory. This should be changed in a future patch to watch other directories too in order to cover UI updates for folders when an event occurs in a non-selected folder.
* Make search more lenientJeffas2020-02-261-1/+2
| | | | | When we fail to read a single message we don't need to fail the whole search, just log the error and we can still get results back.