aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* msgviewer: implement inline image viewingTim Culverhouse2024-02-123-3/+101
| | | | | | | | | | | | | | | | | Implement inline image viewing for jpeg, png, bmp, tiff, and webp formats. When a user has no configured image filter and the image is supported and the terminal has either sixel or kitty image protocol support, the image will be displayed in the message viewer. Always clear the screen before each draw. This call is necessary in vaxis to allow for images to be cleared properly between renders. There is no performance impact: the call only resets each cell to a blank cell, and aerc will redraw each one already. Changelog-added: Inline image previews when no filter is defined for `image/*` and the terminal supports it. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* ui: create and expose vaxis Window with ContextTim Culverhouse2024-02-121-2/+11
| | | | | | | | | Create and expose a vaxis.Window object with each Context. vaxis.Windows are used for creating local coordinates (similar to the views.View API that tcell provides). Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* ui: so long tcellTim Culverhouse2024-02-123-17/+52
| | | | | | | | | | | | | Replace tcell with vaxis. Vaxis provides several new features (none of which are included in this commit). All behavior should be exactly the same as previous, with one exception: Vaxis does not have an internal terminfo library. Some terminals will now have RGB that didn't before, as well as any other feature that was falling back to some unknown state. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* parse/ansi: remove tcell/terminfo dependencyTim Culverhouse2024-02-122-69/+69
| | | | | | | | | | | | The parse library builds an ansi-escaped string based on a buffer of styled cells. Use constants which aerc will still parse properly (and are the same as the terminfo package was pulling in) to remove dependency on tcell/terminfo. Additionally, we can use the internal go "fmt" package to write strings instead of the terminfo.TParm method (which is much slower at formatting strings). Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* view: only set seen flag if not presentRobin Jarry2024-02-111-1/+2
| | | | | | | | No need to do anything if the message was already seen once. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
* templates: Add documentation for .SignatureJohannes Thyssen Tishman2024-02-111-0/+8
| | | | | | | | Document the recently added {{.Signature}} template. Signed-off-by: Johannes Thyssen Tishman <johannes@thyssentishman.com> Acked-by: Robin Jarry <robin@jarry.cc>
* security: update dependencies with known vulnerabilitiesMoritz Poldrack2024-02-112-9/+7
| | | | | | | | | | | | This patch bumps the version of github.com/cloudflare/circl which is required by github.com/ProtonMail/go-crypto to 1.3.7 to include mitigations for GO-2023-1765 and GO-2024-2453. Link: https://pkg.go.dev/vuln/GO-2023-1765 Link: https://pkg.go.dev/vuln/GO-2024-2453 Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* filter: allow workers to combine filter termsKoni Marti2024-02-116-12/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow the backend workers to combine the filter terms. Currently, the consecutive filters are joined in the message store with a space (" "). This works well for most backends, but makes the filter combination for notmuch confusing. Example: Issuing two consecutive filter commands in notmuch :filter not tag:list :filter tag:list would create the following filter query 'not tag:list tag:list' This is not what users would expect; they expect: '(not tag:list) and (tag:list)' Note that the notmuch backend works correctly for the given query, but produced a query that does not match the user's expectation. This patch fixes this. The combination of filter terms in other backends remains the same. Reported-by: Ángel Castañeda <angel@acsq.me> Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* commands: add alignKoni Marti2024-02-115-0/+112
| | | | | | | | | | | | | | | | | | | | | Add a new :align command that aligns the selected message vertically at the top, center, or bottom of the message list. The command requires a position argument that can either be: "top", "center", or "bottom". Create the following default keybinds: zz = :align center<Enter> zt = :align top<Enter> zb = :align bottom<Enter> Changelog-added: Add new `:align` command to align the selected message at the top, center, or bottom of the message list. Suggested-by: Ángel Castañeda <angel@acsq.me> Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* config: add msglist-scroll-offsetKoni Marti2024-02-114-0/+15
| | | | | | | | | | | | Add the [ui].msglist-scroll-offset option in aerc.conf to set the scroll offset in number of lines from the top and bottom of the message list. Changelog-added: Add `[ui].msglist-scroll-offset` option to set a scroll offset for the message list. Suggested-by: Ángel Castañeda <angel@acsq.me> Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* scrollable: rewrite with scroll offsetKoni Marti2024-02-111-15/+25
| | | | | | | | | | | Rewrite the scrolling logic to consider a scroll offset. Ensure correct lower and upper bounds of the scroll variable. Cap offset at half of the screen height. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* calendar: make invitation matching case-insensitiveMoritz Poldrack2024-02-111-1/+2
| | | | | | | | | | | | | | Since some organisations are using capitalised email-adresses, there is no guarantee that invitations are received by an address of the same case. Fixes: 62982a9a ("invites: reply with accept, accept-tentative or decline") Changelog-fixed: Calendar responses now ignore case. Reported-by: "Bart Libert" <bart@libert.email> Signed-off-by: Moritz Poldrack <git@moritz.sh> Tested-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* app: add keybinds annotation when printing bindingsKoni Marti2024-02-111-3/+11
| | | | | | | | | | | Add annotations in square brackets in app.HumanReadableBindings() which translates the keyinds to strings for the ':help keys' command. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* compose: show annotations on the review screenKoni Marti2024-02-112-27/+44
| | | | | | | | | | | | | | | Customize annotations on the review screen. Annotations will overwrite the default descriptions. Replace the [][]string construct with a named struct for better readability. Fixes: https://todo.sr.ht/~rjarry/aerc/118 Changelog-deprecated: Built-in descriptions for the default keybinds shown on the review screen will be deprecated in a future release. Descriptions can be added to those keybinds with inline comments in binds.conf. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* binds: parse annotations from keybind configKoni Marti2024-02-113-6/+24
| | | | | | | | | | | | | | | | | | | | | Parse inline comments in binds.conf as annotations to the corresponding keybinds. Note that a space is required before the comment symbol, so the comment delimiter is " # ". Example: p = :postpone<Enter> # I'll work on it later where "I'll work on it later" is the annotation. When a comment symbol ("#") is needed in the value part of the keybind, it should be escaped ("\#"). Comment symbols can be used without restriction in the annotation itself. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* templates: use email address as fallbackMichael Walle2024-02-112-2/+2
| | | | | | | | | | | | | | If replying to mail or forwarding a mail that doesn't have a recipient name, the automatically generated header line will just have an empty value. Use the names template to extract either the name if available otherwise the mbox name. While at it, instead of just taking the first item of the list, join all items to avoid an index error if the list is empty. Signed-off-by: Michael Walle <michael@walle.cc> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: fix connection when host only has ipv6 addressRobin Jarry2024-02-041-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Some IMAP servers report both IPv4 and IPv6 addresses from their DNS name: $ host imap.gmail.com imap.gmail.com has address 108.177.15.109 imap.gmail.com has address 108.177.15.108 imap.gmail.com has IPv6 address 2a00:1450:400c:c0a::6c imap.gmail.com has IPv6 address 2a00:1450:400c:c0a::6d ResolveTCPAddr actually returns the first *IPv4* address by default, unless the address string is an explicit IPv6 address. Directly use net.Dial which has a fast fallback mechanism. It first tries to connect with an IPv6 address (if any) and if that fails, it will retry with an IPv4 address (if any) before failing completely. Link: https://cs.opensource.google/go/go/+/refs/tags/go1.21.6:src/net/ipsock.go;l=81 Link: https://lists.sr.ht/~rjarry/aerc-discuss/%3CCYVLU3AOA00I.26I5IMAF3T4CK%40dow.land%3E Link: https://pkg.go.dev/net#Dial Reported-by: Jonathan Dowland <jon@dow.land> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Koni Marti <koni.marti@gmail.com>
* Release version 0.17.00.17.0Robin Jarry2024-02-012-1/+56
| | | | Signed-off-by: Robin Jarry <robin@jarry.cc>
* main: improve version stringRobin Jarry2024-02-015-9/+38
| | | | | | | | | | | | | | | | | | | | | | | Initialize a build variable to the date on which the binary was generated. Include the date in the build info string which is output when running aerc -v and in the crash logs. Do not rely on parsing the build flags via some obscure base64 voodoo to determine if notmuch support is available or not. Instead, use the symbols from the linked library directly if available. Before: $ aerc -v 0.16.0-183-g4cc2e6be3a01 +notmuch (go1.21.6 amd64 linux) After: $ aerc -v aerc 0.16.0-183-g4cc2e6be3a01 +notmuch-5.6.0 (go1.21.6 amd64 linux 2024-01-31) Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Ciarán Ainsworth <cda@sporiff.dev>
* commands: rename patch delete to patch unlinkKoni Marti2024-01-313-16/+15
| | | | | | | | | | | Rename the command :patch delete to :patch unlink. This expresses the "link" between the project data within aerc and the underlying repository better. :patch unlink does not delete anything in the repository, it only removes the metadata about currently applied patch revisions/tags. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* templates: fix typo in the docsKarel Balej2024-01-311-1/+1
| | | | | | | | | | Replace the typo with a correct word for the description of the OriginalDate template variable to make sense. Signed-off-by: Karel Balej <balejk@matfyz.cz> Acked-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* commands: rename patch remove to patch dropKoni Marti2024-01-318-37/+37
| | | | | | | | Rename the :patch remove command to :patch drop to better express the this operation is the counter-part to :patch apply. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* compose: fix deadlock when editor errors after :reply -cRobin Jarry2024-01-311-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the message viewer is open and running :reply -c, if the editor exits with an error (e.g. vim :cq), the compose tab is not closed and aerc does not register input anymore. This happens because the composer is closed twice. Once explicitly, and a second time by RemoveTab. This causes to open two viewers on the same message at the same time. Here is the deadlock stack trace: goroutine 149 [sync.Mutex.Lock]: runtime.gopark() runtime/proc.go:398 ... sync.(*Mutex).Lock(...) sync/mutex.go:90 git.sr.ht/~rjarry/aerc/app.(*Composer).Show() git.sr.ht/~rjarry/aerc/app/compose.go:793 git.sr.ht/~rjarry/aerc/lib/ui.(*Tabs).selectPriv() git.sr.ht/~rjarry/aerc/lib/ui/tab.go:171 git.sr.ht/~rjarry/aerc/lib/ui.(*Tabs).Add() git.sr.ht/~rjarry/aerc/lib/ui/tab.go:75 git.sr.ht/~rjarry/aerc/app.(*Aerc).NewTab() git.sr.ht/~rjarry/aerc/app/aerc.go:481 git.sr.ht/~rjarry/aerc/app.NewTab(...) git.sr.ht/~rjarry/aerc/app/app.go:60 git.sr.ht/~rjarry/aerc/commands/account.ViewMessage.Execute.func1() git.sr.ht/~rjarry/aerc/commands/account/view.go:71 git.sr.ht/~rjarry/aerc/lib.NewMessageStoreView.func1() git.sr.ht/~rjarry/aerc/lib/messageview.go:79 git.sr.ht/~rjarry/aerc/lib.NewMessageStoreView() git.sr.ht/~rjarry/aerc/lib/messageview.go:123 git.sr.ht/~rjarry/aerc/commands/account.ViewMessage.Execute() git.sr.ht/~rjarry/aerc/commands/account/view.go:52 git.sr.ht/~rjarry/aerc/commands/msg.reply.Execute.func1.1() git.sr.ht/~rjarry/aerc/commands/msg/reply.go:191 git.sr.ht/~rjarry/aerc/app.(*Composer).Close() git.sr.ht/~rjarry/aerc/app/compose.go:714 git.sr.ht/~rjarry/aerc/app.(*Composer).termClosed() git.sr.ht/~rjarry/aerc/app/compose.go:1189 git.sr.ht/~rjarry/aerc/app.(*Terminal).closeErr() git.sr.ht/~rjarry/aerc/app/terminal.go:69 git.sr.ht/~rjarry/aerc/app.(*Terminal).Close(...) git.sr.ht/~rjarry/aerc/app/terminal.go:46 git.sr.ht/~rjarry/aerc/app.(*Terminal).HandleEvent() git.sr.ht/~rjarry/aerc/app/terminal.go:174 git.sr.ht/~rockorager/tcell-term.(*VT).Start.func1() git.sr.ht/~rockorager/tcell-term@v0.10.0/vt.go:175 created by git.sr.ht/~rockorager/tcell-term.(*VT).Start in goroutine 1 git.sr.ht/~rockorager/tcell-term@v0.10.0/vt.go:165 +0x38d Fixes: https://todo.sr.ht/~rjarry/aerc/216 Reported-by: Karel Balej <balejk@matfyz.cz> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Karel Balej <balejk@matfyz.cz>
* ipc: wait for app to be ready before accepting commandsRobin Jarry2024-01-312-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | Pass a cancellable context to the IPC server and defer accepting connections until the first worker message has been received by the main thread. This is not a real fix for the :split command not working at startup. :split requires a mail store to be present on the currently selected account tab+folder. I could have waited for a types.DirectoryContents message but it seems silly and bug prone since such a message may never arrive and we don't want to pool IPC messages forever. Also, a types.DirectoryContents message may arrive for one account but :split is only effective *per account* and the default selected account tab is the first one. In any case, this band aid prevents aerc from crashing or breaking down the terminal when running IPC commands in the aerc-startup hook. Fixes: https://lists.sr.ht/~rjarry/aerc-devel/%3CCYPN7AVYQ69S.WV0T67VM6WX3%40wegtam.com%3E Fixes: https://todo.sr.ht/~rjarry/aerc/173 Reported-by: Jens Grassel <jens@wegtam.com> Reported-by: Justine Smithies <justine@smithies.me.uk> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Thomas Böhler <witcher@wiredspace.de> Reviewed-by: Thomas Böhler <witcher@wiredspace.de>
* listbox: send some key events to textinputKoni Marti2024-01-291-20/+13
| | | | | | | | | | | | Send some key events directly to the textinput widget when the filter line is shown. There's no need to have duplicated code in listbox and textinput for the same keys, e.g. CtrlW. This also fixes a panic when CtrlW is used on the filter line. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* menu: use listbox as fallback commandKoni Marti2024-01-292-27/+80
| | | | | | | | | | | | Implement the listbox widget as fallback picker when no command to :menu was specified or the command cannot be found in PATH. The listbox will also be used with "-" as the shell command: :menu -c "-" -d :cf Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* app: define two dialog constructorsKoni Marti2024-01-296-39/+33
| | | | | | | | | | | | | Define two new constructor functions for the popup dialog. DefaultDialog() creates a dialog that spans half of the screen, whereas the LargeDialog() covers three-quarter of the screen. If a dialog widget has more specific size requirements, custom window position and window height functions can be used with NewDialog(). Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* listbox: add external text filter functionKoni Marti2024-01-291-11/+26
| | | | | | | | | | | Set an external filter function to use in the filtering operation of the listbox widget. This allows us to use commands.FilterList without an import cycle conflict. commands.FilterList comes with fuzzy completion, too. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* listbox: use tab key to cycle through listKoni Marti2024-01-291-2/+2
| | | | | | | | | Use tab key to cycle forward and backtab to cycle backward through the selection in the listbox widget. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* ui: allow thread arrow customizationinwit2024-01-295-20/+311
| | | | | | | | | | | | | | | | | | The thread prefix appearance is inspired by mutt and has been regarded by some as too wide and not very aesthetically pleasing. Nevertheless, it has some technical limitations, like not being able to show if a thread is folded. Allow for full customisation of the thread prefix by introducing 14 new config options. Dirlist is not affected. Changelog-added: Thread arrow prefixes are now fully configurable. Co-authored-by: Robin Jarry <robin@jarry.cc> Signed-off-by: inwit <inwit@sindominio.net> Tested-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: correctly run queries in `*` folderJason Cox2024-01-272-17/+22
| | | | | | | | | | | | | | | A folder may be defined based on the notmuch query `*`, which matches all messages. This query is a special case (see notmuch-search-terms(7)) and cannot be combined with other queries. When adding to a `*` query, such as when searching, simply replace `*` with the more specific query rather than combining the two. Changelog-fixed: Notmuch folders defined by the query `*` handle search, filter, and unread counts correctly. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* doc: make sure aliases have the same signatureBence Ferdinandy2024-01-271-2/+2
| | | | | | | | | Two aliases did not have the same signature as the main command. Add the missing signatures. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* help: add :man as aliasBence Ferdinandy2024-01-272-3/+5
| | | | | | | | Since except for :help keys, we literally open man with the appropriate aerc manpages, it makes sense to have that as an alias. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* mv: fix regression in selection of next messageJohannes Thyssen Tishman2024-01-271-6/+15
| | | | | | | | | | | | | | | Commit 41c25caafd58 ("mv: allow to move messages across accounts") introduced a regression where moving a message causes the last message in the list to be selected instead of the next available one. Record the next message to jump to *before* actually jumping. Fixes: 41c25caafd58 ("mv: allow to move messages across accounts") Fixes: https://todo.sr.ht/~rjarry/aerc/219 Signed-off-by: Johannes Thyssen Tishman <johannes@thyssentishman.com> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Tested-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* bindings: do not systematically trigger completionRobin Jarry2024-01-272-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When simulating keystrokes of a binding, the command completion is disabled momentarily for performance reasons and re-enabled once the sequence is finished. See commit 055c6dc6604f ("exline: don't draw completions for keybinds") for more details. Since commit 0b0095eeadaf ("complete: allow disabling automatic completion"), it is possible to only rely on explicit keystrokes to display the completion menu. With the default settings, if a key sequence contains more than [ui].completion-min-chars, it should trigger completion after [ui].completion-delay. But since the completion was disabled when the keystrokes are input, it does not trigger the completion. To work around this, an artificial <Tab> keystroke was added at the end of the sequence to force trigger the completion menu. For more details, see commit 04869bd2a39a ("aerc: fix popover menu regression"). The workaround that was added, along with commit b3dc63d69c14 ("complete: only display popover for more than one choice"), forces the completion when there is a single choice. Completely ignoring [ui].completion-min-chars = manual. Only explicitly trigger the completion if the completion key was seen in the keystroke sequence or if completion-min-chars is not set to manual. Use the correct completion key and not hard code Tab. Fixes: 0b0095eeadaf ("complete: allow disabling automatic completion") Fixes: https://todo.sr.ht/~rjarry/aerc/210 References: https://todo.sr.ht/~rjarry/aerc/104 Cc: Skejg <grolleman@zoho.com> Reported-by: Karel Balej <balejk@matfyz.cz> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Karel Balej <balejk@matfyz.cz> Tested-by: Koni Marti <koni.marti@gmail.com>
* binds: add some vim-inspired bindsBence Ferdinandy2024-01-261-0/+5
| | | | | | | | | | The fold binding already had zo and zc, but were missing a few vim fold analogues. Also add ]t and [t for navigating tabs, which also serves as an example how to do that, as it needs escaping in ini. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* maildir: show valid messages even if there are errorsBence Ferdinandy2024-01-262-4/+14
| | | | | | | | | | | | When go-maildir parses a folder and finds an error, it will still return the valid keys it has found along with the error. Instead of returning an empty list of UIDs log an error and proceed with the valid uids found by go-maildir. When opening a folder with invalid files, show an error message to the user. References: https://todo.sr.ht/~rjarry/aerc/215 Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
* release.sh: add --dry-run flagRobin Jarry2024-01-261-15/+23
| | | | | | | This allows checking what the changelog will look like when actually releasing. Signed-off-by: Robin Jarry <robin@jarry.cc>
* flags: add support for draft flagJason Cox2024-01-2619-13/+82
| | | | | | | | | | | | | | Support the draft flag wherever flags are used. Automatically set it when postponing a message, and allow recalling a message without the -f flag if it has the draft flag set, regardless of what folder it's in. Notmuch doesn't seem to pick up on the draft flag when indexing even though the flag is set on the maildir file. Explicitly set all tags corresponding to set flags when appending a message in notmuch. Changelog-added: Support the `draft` flag. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: centralize flag/tag mappingsJason Cox2024-01-263-33/+36
| | | | | | | | Mimic other backends that have centralized mappings. Doing so makes adding support for the draft flag simpler in a subsequent commit. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* tabs: optimize switching by offsetsdelitako2024-01-265-18/+30
| | | | | | | | | | | | | | | | | I imagine no sane user requires aerc to correctly handle commands like `:next-tab 1000000000`, but I tried anyway and it froze aerc while also eating up many GBs of system memory. This behavior is not ideal, so I improved it. This commit adds functions for selecting a tab at an offset from the currently-selected tab and changes the next-tab, prev-tab, and change-tab commands to use these functions instead of looping. Signed-off-by: delitako <delitako@delitako.xyz> Tested-by: Thomas Böhler <witcher@wiredspace.de> Reviewed-by: Thomas Böhler <witcher@wiredspace.de> Acked-by: Robin Jarry <robin@jarry.cc>
* compose: don't attach key when removing signatureThomas Böhler2024-01-261-2/+0
| | | | | | | | | | | | | | If pgp-attach-key is set in accounts.conf, the key is detached with :detach and the signature removed with :sign, the key will be attached again. When :sign is called again two keys will be attached instead of one. Fix this by not attaching a key if it cannot be detached. Fixes: 9d90b70b4edf ("compose: refactor attachment handling") Signed-off-by: Thomas Böhler <witcher@wiredspace.de> Acked-by: Robin Jarry <robin@jarry.cc>
* mod: upgrade go-maildir to v0.4.1Michal Siedlaczek2024-01-262-1/+3
| | | | | | | | | This latest version includes a bug-fix for incorrect path discovery for some messages. Signed-off-by: Michal Siedlaczek <michal@siedlaczek.me> Reviewed-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* mv: allow to move messages across accountsJohannes Thyssen Tishman2024-01-253-31/+155
| | | | | | | | | | | | Add a new -a flag to :mv. When specified, an account name is required before the folder name. If the destination folder doesn't exist, it will be created whether or not the -p flag is specified. Changelog-added: Move messages across accounts with `:mv -a <account> <folder>`. Signed-off-by: Johannes Thyssen Tishman <johannes@thyssentishman.com> Acked-by: Robin Jarry <robin@jarry.cc>
* cp: allow to copy messages across accountsJohannes Thyssen Tishman2024-01-252-23/+112
| | | | | | | | | | | | Add a new -a flag to :cp. When specified, an account name is required before the folder name. If the destination folder doesn't exist, it will be created whether or not the -p flag is specified. Changelog-added: Copy messages across accounts with `:cp -a <account> <folder>`. Signed-off-by: Johannes Thyssen Tishman <johannes@thyssentishman.com> Acked-by: Robin Jarry <robin@jarry.cc>
* msgstore: create destination folder on store.AppendJohannes Thyssen Tishman2024-01-251-0/+7
| | | | | | | | | When appending a message to a folder, always create the destination folder if it doesn't exist. Signed-off-by: Johannes Thyssen Tishman <johannes@thyssentishman.com> Acked-by: Robin Jarry <robin@jarry.cc>
* config: print file path in error messageMichal Siedlaczek2024-01-253-42/+63
| | | | | | | | | In case of a config parsing error, print the file path of the file in which the error occurred. Fixes: https://todo.sr.ht/~rjarry/aerc/218 Signed-off-by: Michal Siedlaczek <michal@siedlaczek.me> Acked-by: Robin Jarry <robin@jarry.cc>
* templates: avoid blank lines with empty signatureJason Cox2024-01-253-3/+9
| | | | | | | | | | An empty line is desirable before the signature but shouldn't be added if there isn't actually a signature. Fixes: b76bf1b ("templates: move signature from compose to templates") Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* hook: add mail-sent hookMoritz Poldrack2024-01-254-0/+59
| | | | | | | | | Add a hook to trigger when a message is sent. References: https://todo.sr.ht/~rjarry/aerc/136 Signed-off-by: Moritz Poldrack <git@moritz.sh> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* idler: improve the imap idlerKoni Marti2024-01-256-156/+182
| | | | | | | | | | Rewrite the imap idler to make it more fault tolerant and prevent hangs (and possibly short writes). Fixes: https://todo.sr.ht/~rjarry/aerc/208 Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Karel Balej <balejk@matfyz.cz> Acked-by: Robin Jarry <robin@jarry.cc>