summaryrefslogtreecommitdiff
path: root/worker/types/messages.go
AgeCommit message (Collapse)Author
2022-07-10threading: enable filtering of server-side threadsTim Culverhouse
This patch enables the filtering of a threaded view which uses server-built threads. Filtering is done server-side, in order to preserve the use of server-built threads. In adding this feature, the filtering of notmuch folders was brought up to feature parity with the other workers. The filters function the same (ie: they can be stacked). The notmuch filters, however, still use notmuch syntax for the filtering. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
2022-06-22imap: add option to cache headersTim Culverhouse
Add option to cache headers for imap accounts. Cache db is located at $XDG_CACHE_DIR/aerc/{account name}. The cache is cleaned of stale entries when aerc is first opened. Two new account level configuration options are introduced: * cache-headers (Default: false) * cache-max-age (Default: 30 days (720 hours)) The change in worker/imap/open.go is to set the selected directory. This is required to access the UIDVALIDITY field, which is used in combination with the message ID to form the key for use in the cache db. The key structure is: "header.{UIDVALIDITY}.{UID}" Where reasonable, cache does not stop aerc from running. In general, if there is an error in the cache, aerc should continue working as usual. Errors are either displayed to the user or logged. All messages are stored without flags, and when retrieved have the flags set to SEEN. This is to prevent UI flashes. A new method to FetchMessageFlags is introduced to update flags of cached headers. This is done asynchronously, and the user will see their messages appear and then any flags updated. The message will initially show as SEEN, but will update to unread. I considered updating the cache with the last-known flag state, however it seems prudent to spare the R/W cycle and assume that - eventually - all messages will end up read, and if it isn't the update will occur rather quickly. Note that leveldb puts a lock on the database, preventing multiple instances of aerc from accessing the cache at the same time. Much of this work is based on previous efforts by Vladimír Magyar. Implements: https://todo.sr.ht/~rjarry/aerc/2 Thanks: Vladimír Magyar <vladimir@mgyar.me> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: inwit <inwit@sindominio.net> Reviewed-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
2022-06-07dirlist: update RUE counts for imap/maildir on move|copy|delete|archiveTim Culverhouse
When moving/copying/deleting/archiving a message in imap, the RUE counts displayed in the dirlist would not update properly. Maildir has (had) an implementation that recounts the entire directory and updates the DirectoryInfo after one of these actions. This patch implements a more efficient method of updating, and also enables it to apply to IMAP without any additional requests. Upon completion of the action, the counts are manually updated with the count of messages in the action and recent and/or unseen states of those messages. This is more efficient for maildir, because we aren't counting everything in the store. For IMAP, we get the updates for free because we are only performing the update after confirmation from the server that the action has happened. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
2022-05-31feat: add background mail polling option for all workersTim Culverhouse
Check for new mail (recent, unseen, exists counts) with an external command, or for imap with the STATUS command, at start or on reconnection and every X time duration IMAP: The selected folder is skipped, per specification. Additional config options are included for including/excluding folders explicitly. Maildir/Notmuch: An external command will be run in the background to check for new mail. An optional timeout can be used with maildir/notmuch. Default is 10s New account options: check-mail check-mail-cmd (maildir/notmuch only) check-mail-timeout (maildir/notmuch only), default 10s check-mail-include (IMAP only) check-mail-exclude (IMAP only) If unset, or set less than or equal to 0, check-mail will be ignored Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
2022-01-19imap: auto-reconnects on connection errorKoni Marti
if the worker emits a connection error, the ui will automatically send back a reconnect command. The worker then establishes a new connection. Auto-reconnect is disabled when the user sends the disconnect command. Fixes: https://todo.sr.ht/~rjarry/aerc/1 Signed-off-by: Koni Marti <koni.marti@gmail.com>
2022-01-19imap: emits connection error on logoutKoni Marti
implements a new connection error message. This allows the worker to emit a connection-related error message to the ui when the imap client closes the loggedOut channel. Signed-off-by: Koni Marti <koni.marti@gmail.com>
2021-11-13messages: allow displaying email threadsy0ast
Display threads in the message list. For now, only supported by the notmuch backend and on IMAP when the server supports the THREAD extension. Setting threading-enable=true is global and will cause the message list to be empty with maildir:// accounts. Co-authored-by: Kevin Kuehler <keur@xcf.berkeley.edu> Co-authored-by: Reto Brunner <reto@labrat.space> Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-11-05go.mod: change base git urlRobin Jarry
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>
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-07-17run go fmtReto Brunner
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-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-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-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-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-16Request DirInfo whenever the unread count may have changedReto Brunner
Actions such as read / unread or the addition of new messages do change the read/unread/recent count. Hence we request an update from the workers. Workers going over the network should probably cache the information and invalidate it only if necessary
2020-01-05FetchBodyParts: decode source in the workersReto Brunner
Previously the workers returned a mixture of decoded / encoded parts. This lead to a whole bunch of issues. This commit changes the msgviewer and the commands to assume parts to already be decoded
2019-12-21add LabelList eventReto Brunner
2019-09-20Add sorting functionalityJeffas
There is a command and config option. The criteria are a list of the sort criterion and each can be individually reversed. This only includes support for sorting in the maildir backend currently. The other backends are not supported in this patch.
2019-09-12Add modify-labels commandReto Brunner
This adds the event type as well as the command implementation, but no backend supports it yet.
2019-08-29extract search criteria parsing into the backendsReto Brunner
2019-07-11#190 Handle gmail duplicate folderDaniel Bridges
2019-07-08Use []uint32 instead of imap.SeqSetBen Burwell
A sequence-set is an IMAP-specific implementation detail. Throughout the UI, aerc simply operates using lists of opaque identifiers. In order to loosen the coupling between the UI and IMAP in particular, replace most usages of imap.SeqSet with []uint32, leaving the translation to a SeqSet to the IMAP backend as needed.
2019-07-08Factor UI models out of the worker message packageBen Burwell
Before, the information needed to display different parts of the UI was tightly coupled to the specific messages being sent back and forth to the backend worker. Separating out a models package allows us to be more specific about exactly what a backend is able to and required to provide for the UI.
2019-06-24worker/imap: implement searchDrew DeVault
2019-06-09Add :read and :unread commandsDrew DeVault
2019-06-09Add archive commandRobert Günzler
Adds an archive command that moves the current message into the folder specified in the account config entry. Supports three layouts at this point: - flat: puts all messages next to each other - year: creates a folder per year - month: same as above, plus folders per month This also adds a "-p" argument to "cp" and "mv" that works like "--parents" on mkdir(1). We use this to auto-create the directories for the archive layout.
2019-06-07implements ability to view headers in message viewYash Srivastav
2019-06-02Remove worker callbacks when Done is receivedDrew DeVault
2019-05-20Flesh out multipart switcherDrew DeVault
2019-05-20Verify TLS certificatesDrew DeVault
I was partway done implementing a UI for users to approve untrusted certs with, but let's just make them configure their servers right instead.
2019-05-19worker/types/worker: make ID allocation atomicSimon Ser
Message IDs are allocated for both messages from UI to workers and the other way around. Hence, the global nextId variable is accessed from multiple goroutines. Instead, use atomic to access the global counter.
2019-05-17s/aerc2/aerc/gDrew DeVault
2019-05-15Copy sent emails to the Sent folderDrew DeVault
Or rather, to a user-specified folder
2019-05-14Implement move, mv commandsDrew DeVault
2019-05-14Implement :copy (aka :cp)Drew DeVault
2019-03-31Rename FetchMessageBodies to FetchFullMessagesDrew DeVault
2019-03-31Don't parse mail in worker; send a reader insteadDrew DeVault
2019-03-31Pull BodyStructure up from IMAP workerDrew DeVault
2019-03-29Add body fetching support codeDrew DeVault
2019-03-20Implement :delete-messageDrew DeVault
2019-03-14Implement message store side of message fetchingDrew DeVault
2019-03-10Fetch valid UIDs from server after opening dirDrew DeVault
2019-01-13Add name to DirectoryInfo messagesDrew DeVault
2019-01-13Issue IMAP SELECT commandDrew DeVault
2018-02-01Refactoring; consume listing responseDrew DeVault
2018-02-01Implement (most of) mailbox listingDrew DeVault
2018-01-31Add certificate approval flowDrew DeVault
2018-01-14Connect to IMAP server, login and idleemersion