summaryrefslogtreecommitdiff
path: root/worker
AgeCommit message (Collapse)Author
2021-11-02imap: use builtin idle supportRobin Jarry
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>
2021-11-01maildir: track the recent flag correctlyReto Brunner
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.
2021-04-28notmuch/maildir: remove double emit of the dirinfoReto Brunner
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>
2021-02-22lib/parse: simplify parseAddressListReto Brunner
2021-02-08maildir: don't read the full file into memoryReto Brunner
2021-02-08notmuch: don't read the full file into memoryReto Brunner
2020-12-02notmuch: trim excluded tagsKalyan Sriram
Trims whitespace in list of excluded notmuch tags. This allows a comma separated list with spaces to be correctly processed.
2020-12-02notmuch: remove gc close hooksReto Brunner
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.
2020-11-14imap: strip <> from message-idsReto Brunner
2020-11-14lib/parse: use go-message msgid parsing if it succeedsReto Brunner
2020-11-14remove models.Address in favor of go-message AddressReto Brunner
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
2020-10-11imap: add sort supportReto Brunner
2020-09-27notmuch: rename method to SetFlagReto Brunner
2020-09-24notmuch: close tag objectReto Brunner
2020-08-31handle message unknown charset errorJeff Martin
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.
2020-08-20base models.Address on the mail.Address typeReto Brunner
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.
2020-08-19Add support for :rmdirARaspiK
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.
2020-08-10improve date parsing for notmuch/maildirReto Brunner
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.
2020-08-07notmuch: manually close notmuch objectsReto Brunner
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
2020-07-27maildir: Provide nicer error message on invalid urlTero Koskinen
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.
2020-07-27Remove hard coded bodystruct path everywhereReto Brunner
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.
2020-07-25Add flag based search optionsTobias Wölfel
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.
2020-07-19Only send directory info once from maildirAndrew Jeffery
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.
2020-07-17run go fmtReto Brunner
2020-07-11Make it easier to debug date parsing errorsLyudmil Angelov
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.
2020-07-08Add additional flagging functionalityARaspiK
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.
2020-07-08notmuch: fix docstringReto Brunner
2020-07-05notmuch: handle the answered flagReto Brunner
2020-05-26notmuch: undefined variable when setting reply flagSrivathsan Murali
2020-05-25Set AnsweredFlag on successful replySrivathsan Murali
2020-05-16imap: Remove FetchMessageBodyPart.{Encoding,Charset}Reto Brunner
Fixes https://todo.sr.ht/~sircmpwn/aerc2/352 exactly as suggested by emersion.
2020-05-11maildir: remove read handling from FetchMessageBodyPartReto Brunner
2020-05-11notmuch: remove read handling from FetchMessageBodyPartReto Brunner
2020-05-06Guess date from received if not presentelumbella
2020-05-05Allow maildir subdirectoriesGrégoire Delattre
2020-05-01store.FetchFull: Change callback type to expose entire messageBen Fiedler
This is a prerequisite for allowing the FetchFull message to return both the message content and the message headers.
2020-04-24imap/fetch.go: report error when fetching headers failsBen Fiedler
Correct me if I'm wrong, but shouldn't this raise an error when it fails?
2020-03-09Count recent messages in maildir exists total tooJeffas
2020-03-09Ignore missing message part in getDecodedPartAmir Yalon
The code that calls this function handles nil without issues.
2020-03-03Initial support for PGP decryption & signaturesDrew DeVault
2020-03-03worker/imap: rely on go-imap for charset handlingSimon Ser
Set imap.CharsetReader so that go-imap can automatically decode all encoded fields.
2020-03-03Mark sent messages as "seen" in maildirGalen Abell
- 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
2020-03-01notmuch: emit dirinfo upon label changeReto Brunner
2020-02-29remove the dirInfoUpdateRequest functionalityReto Brunner
The notmuch worker followed suit in handling the dirInfo submission manually. That removes the last user so we might as well remove the functionality.
2020-02-29notmuch: align dirInfo logic to the maildir workerReto Brunner
2020-02-28Cleanup sorting logicJeffas
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.
2020-02-28Update DirectoryInfo handling for maildirJeffas
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.
2020-02-26Make search more lenientJeffas
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.
2020-02-26Add missing notmuch build tagsJeffas
2020-02-25Ensure new directory exists before unwatching oldGalen Abell