aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* mod: update vaxisTim Culverhouse2024-03-102-3/+3
| | | | | | | | | | | | | Update Vaxis to v0.8.4. This version has a few bug fixes relevant to aerc: - Charset handling in the terminal (John) - Various key encoding issues (Robin) - Fix resize race conditions with underlying terminal (inwit, Bence) - Explicit cursor positioning on new rows to fix wrapped selections (Tristan) Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* detach: add glob supportTristan Partin2024-03-102-4/+43
| | | | | | | | | This matches the behavior of :attach. Changelog-added: The `:detach` command now understands globs similar to `:attach`. Signed-off-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
* quit: add :q aliasTristan Partin2024-03-102-2/+3
| | | | | | | | | | | | This used to work, but after f3a61a34 (where :query) was added, we had two commands which then started with q. So, the automatic alias stopped working. Changelog-added: Specify a ":q" alias for quit. Signed-off-by: Tristan Partin <tristan@partin.io> Acked-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* mk: allow overriding install binaryRobin Jarry2024-03-101-3/+4
| | | | | | | | | | | This can be used by downstream packaging to force specific options. E.g.: make install INSTALL="/usr/bin/install -p" Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Gavin-John Noonan <mail@gjnoonan.co.uk> Reviewed-by: Gavin-John Noonan <mail@gjnoonan.co.uk>
* gpg: use export-minimal when attaching public keyRobin Jarry2024-03-101-1/+2
| | | | | | | | | | | Depending on how many signatures the public key has, it may be very large. The key signatures are not required to verify the authenticity of an email. Link: https://lists.sr.ht/~rjarry/aerc-devel/%3CCZKDO3ETIOAI.1DDOYI8Z8LY5O%40cepl.eu%3E Reported-by: Matěj Cepl <mcepl@cepl.eu> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Matěj Cepl <mcepl@cepl.eu>
* gpg: fix mime-version header positionRobin Jarry2024-03-102-11/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some MTAs try to normalize the case of all headers (including signed text parts headers). Unfortunately, Mime-Version can be normalized to different casing depending on the implementation (MIME- vs Mime-). Since the signature is computed on the whole part, including its header, changing the case can cause the signature to become invalid. Due to how multipart/signed messages are constructed, we need to hack around go-message writers to intercept the writing of a text part, compute its signature and write the actual message with the proper headers. Unfortunately, go-message does not allow creating a message writer that does not insert a Mime-Version header. This causes the Mime-Version header to be inserted in the wrong place: it is put inside the signed text part header instead on the top level header. Thus, included in the signed content. Make sure to remove any Mime-Version header from the signed part header. Finally, ensure that Mime-Version is set on the top-level header so that messages are compliant with RFC 2045. Fixes: https://todo.sr.ht/~rjarry/aerc/143 Link: https://github.com/emersion/go-message/issues/165 Link: https://github.com/emersion/go-pgpmail/pull/15 Link: https://lists.sr.ht/~rjarry/aerc-devel/%3CCQRPF5EA0TF8.PEJ4AKCEGMFM%40fembook%3E Changelog-fixed: `Mime-Version` is no longer inserted in signed text parts headers. MTAs normalizing header case will not corrupt signatures anymore. Reported-by: Coco Liliace <chloe@liliace.dev> Reported-by: Kirill Chibisov <contact@kchibisov.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* templates: add visual mode indicator to TrayInfoJason Cox2024-03-045-2/+29
| | | | | | | | | | | It's useful to have some indicator of whether or not aerc is in visual mark mode. Add such an indicator to the TrayInfo available in the status line. Changelog-changed: The `TrayInfo` template variable now includes a visual mark mode indicator. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* commands: rename confusing constantsRobin Jarry2024-03-0441-47/+45
| | | | | | | | There is an overlap between ACCOUNT and MESSAGE. Rename ACCOUNT to MESSAGE_LIST and use MESSAGE_LIST|MESSAGE_VIEWER instead of MESSAGE. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
* mk: add validate targetRobin Jarry2024-03-043-12/+7
| | | | | | | | | | Instead of hiding the actual checks deep into the CI framework and into the sendemail-validate hook, add a validate make target that uses proper variables and runs the required checks. Use it in the sendemail-validate hook and the CI builds. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
* contrib: use sed -E for shell scriptsMaarten Aertsen2024-02-294-11/+11
| | | | | | | | | The + character is not part of the 'basic regular expressions' in BSD grep. Use -E to enable extended (modern) regular expressions. Also remove escaping. This makes the commit msg hook work on macOS 14.2. Signed-off-by: Maarten Aertsen <maarten@nlnetlabs.nl> Signed-off-by: Robin Jarry <robin@jarry.cc>
* aerc-stylesets: document msglist_thread_contextMaarten Aertsen2024-02-281-0/+3
| | | | | | | | | | Document the msglist_thread_context styleset object that allows styling the additional messages displayed when using the show-thread-context option. Fixes: 4ec1e1a5e4c7 ("ui: enable showing of thread-context") Signed-off-by: Maarten Aertsen <maarten@nlnetlabs.nl> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: drain updates channel when moving messagesKoni Marti2024-02-261-0/+3
| | | | | | | | | | | | | Drain the updates channel when moving messages to prevent a backend freeze. This also fixes a possible freeze for large-scale archive operations since the archive command uses the move operation. Reported-by: Moritz Poldrack <moritz@poldrack.dev> Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Jeremy Baxter <jtbx@disroot.org> Tested-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* release: improve generated emailRobin Jarry2024-02-261-34/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Do not hard wrap changelog entries. * Add changes to go.mod to help downstream packagers * Improve dry run to show the generated email instead of just printing the changelog. Example output for 0.17.0: From: Robin Jarry <robin@jarry.cc> To: aerc-annouce <~rjarry/aerc-announce@lists.sr.ht> Cc: aerc-devel <~rjarry/aerc-devel@lists.sr.ht> Bcc: aerc <~sircmpwn/aerc@lists.sr.ht>, Robin Jarry <robin@jarry.cc> Reply-To: aerc-devel <~rjarry/aerc-devel@lists.sr.ht> Subject: aerc 0.17.0 User-Agent: aerc/0.17.0 Message-ID: <20240201091423.4YZK4ZQ3XVKJ@ringo> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 MIME-Version: 1.0 Hi all, I am glad to announce the release of aerc 0.17.0. https://git.sr.ht/~rjarry/aerc/refs/0.17.0 Release highlights: # Added - New `flagged` criteria for `:sort`. - New `:send-keys` command to control embedded terminals. - Account aliases now support fnmatch-style wildcards. - New `:suspend` command bound to `<C-z>` by default. - Disable parent context bindings by declaring them empty. - Toggle folding with `:fold -t`. - `mail-deleted` hook that triggers when a message is removed/moved from a folder. - `mail-added` hook that triggers when a message is added to a folder. - Customize key to trigger completion with `$complete` in `binds.conf`. - Setting `complete-min-chars=manual` in `aerc.conf` now disables automatic completion, leaving only manually triggered completion. - `.ThreadUnread` is now available in templates. - Allow binding commands to `Alt+<number>` keys. - `AERC_ACCOUNT` and `AERC_ADDRESS_BOOK_CMD` are now defined in the editor's environment when composing a message. - Reply with a different account than the current one with `:reply -A <account>`. - New `[ui].tab-title-viewer` setting to configure the message viewer tab title. - The `{{.Subject}}` template is evaluated to the new option `[ui].empty-subject` if the subject is empty. - Change to a folder of another account with `:cf -a <account> <folder>`. - Patch management with `:patch`. - Add filepath to messages in templates as .Filename(s) - New `:menu` command to invoke other aerc commands based on a shell command output. - CLI flags to override paths to config files. - Automatically attach signing key with `pgp-attach-key` in `accounts.conf`. - Copy messages across accounts with `:cp -a <account> <folder>`. - Move messages across accounts with `:mv -a <account> <folder>`. - Support the `draft` flag. - Thread arrow prefixes are now fully configurable. # Fixed - `colorize` support for wildcards `?` and `*`. - Selection of headers in composer after `:compose -e` followed by `:edit -E`. - Don't lose child messages of non-queried parents in notmuch threads - Notmuch folders defined by the query `*` handle search, filter, and unread counts correctly. # Changed - `:open` commands are now executed with `sh -c`. - `:pipe` commands are now executed with `sh -c`. - Improved command completion. - Message viewer tab titles will now show `(no subject)` if there is no subject in the viewed email. - Signature placement is now controlled via the `{{.Signature}}` template variable and not hardcoded. # Changed dependencies for downstream packagers diff --git a/go.mod b/go.mod index 9b712a340a41..a94a7afa11e0 100644 --- a/go.mod +++ b/go.mod @@ -5,0 +6 @@ require ( + git.sr.ht/~rjarry/go-opt v1.3.0 @@ -7,2 +8 @@ require ( - git.sr.ht/~rockorager/tcell-term v0.8.0 - git.sr.ht/~sircmpwn/getopt v1.0.0 + git.sr.ht/~rockorager/tcell-term v0.10.0 @@ -14 +14 @@ require ( - github.com/emersion/go-maildir v0.3.0 + github.com/emersion/go-maildir v0.4.1 @@ -26 +25,0 @@ require ( - github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 @@ -33 +32 @@ require ( - github.com/stretchr/testify v1.8.2 + github.com/stretchr/testify v1.8.4 @@ -54,0 +54 @@ require ( + golang.org/x/mod v0.8.0 // indirect Thanks to all contributors! ~$ contrib/git-stats.sh 0.16.0..0.17.0 Author Commits Changed Files Insertions Deletions Robin Jarry 61 650 +4908 -5576 Koni Marti 45 120 +4250 -729 Bence Ferdinandy 15 44 +452 -139 Jason Cox 14 59 +490 -232 Moritz Poldrack 11 19 +170 -568 Vitaly Ovchinnikov 11 27 +379 -38 Inwit 9 32 +497 -103 Johannes Thyssen Tishman 5 8 +292 -63 Sebastien Binet 3 5 +36 -25 Michal Siedlaczek 2 5 +66 -43 Erik Terpstra 1 2 +30 +0 George Honeywood 1 2 +3 -3 Jens Grassel 1 1 +8 +0 Karel Balej 1 1 +1 -1 Max Schillinger 1 1 +0 -1 Nojus Gudinavičius 1 5 +64 +0 Thomas Böhler 1 1 +0 -2 delitako 1 5 +30 -18 Reviewer/Tester Commits Robin Jarry 121 Inwit 31 Moritz Poldrack 28 Koni Marti 22 Bence Ferdinandy 13 Johannes Thyssen Tishman 8 Jason Cox 4 Karel Balej 3 Thomas Böhler 3 Tim Culverhouse 3 Vitaly Ovchinnikov 2 Callum Andrew 1 Ciarán Ainsworth 1 Maarten van Gompel 1 Tristan Partin 1 Signed-off-by: Robin Jarry <robin@jarry.cc>
* commands: add :query to create named notmuch dirsJason Cox2024-02-2610-45/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current :cf command can be used to create folders for arbitrary notmuch queries. These folders use the query as their namee. In some cases, though, it's useful to give a more human-readable name. Create a new :query command to allow doing so. The :query command accepts an optional -n flag to specify a name. The remaining arguments are interpreted verbatim as a notmuch query. If no name is specified, the query itself is used as the name. For example, to create a new folder with the full thread of the current message, named by its subject, run the following command: :query -n "{{.SubjectBase}}" thread:"{mid:{{.MessageId}}}" :query could have been implemented as an additional flag to :cf. Giving a name to the created folder would make the smantics of :cf strange, though. For example, to create a named query folder, one would use :cf -n <name> <query>. This syntax feels odd; the name of the folder seems like it ought to be the positional argument of the change folder command. Alternatively, the usage could be :cf -q <query> <name>, but this feels wrong as well: the query, which is provided as a positional parameter when no name is specified, becomes a flag parameter when a name is specified. What's more, both of these potential usages add a notmuch-specific flag to an otherwise general command. Creating a new command feels cleaner. Perhaps the current query functionality of the :cf command could eventually be deprecated to remove the duplicate functionality and keep :cf limited to changing to existing folders. Changelog-added: Create notmuch named queries with the `:query` command. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: drain updates channel when deleting messagesKoni Marti2024-02-261-0/+40
| | | | | | | | | | | | | Drain the buffered updates channel when deleting messages to prevent a backend freeze. Unilateral update messages from the IMAP server can fill up the buffered channel if not handled during a large operation (more than ~50 messages). Link: https://lists.sr.ht/~rjarry/aerc-discuss/%3CCZCPBTWI3PIW.T8MWNCBG7FGL%40disroot.org%3E Changelog-fixed: Prevent a freeze for large-scale deletions with IMAP. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Jeremy Baxter <jtbx@disroot.org> Acked-by: Robin Jarry <robin@jarry.cc>
* ui: update vaxis and only use disambiguate csi-u flagTim Culverhouse2024-02-263-3/+4
| | | | | | | | | | | | | | | | | | Update vaxis to 0.8.2, which adds the ability to specify any CSI-u flag combination. Explicitly only use the disambiguate flag. This enables aerc to have additional keybinds not previously possible (C-i, C-m) while preventing some internal logic bugs relating to single-modifier key presses. While these events can be useful, they are not needed in aerc and aerc currently would need several workarounds to properly handle them so let's just not request them in the first place. Fixes a bug with encoding shift+space in the presence of CSI-u in the terminal widget Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Inwit <inwit@sindominio.net> Tested-by: Jason Cox <dev@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* ipc: fix deadlock when aerc is not runningRobin Jarry2024-02-221-4/+7
| | | | | | | | | | | | | Defer the execution of failed IPC commands *after* the IPC socket has been unblocked. Fixes: fd4dd4240885 ("ipc: wait for app to be ready before accepting commands") Fixes: https://todo.sr.ht/~rjarry/aerc/229 Changelog-fixed: Deadlock when running `aerc mailto:foo@bar.com` without another instance of aerc already running. Reported-by: Skejg <grolleman@zoho.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
* commands: remove compose commands from message viewerRobin Jarry2024-02-221-1/+1
| | | | | | | | | | | | | | | | All compose commands were made available in the message viewer context by mistake. Remove them. This fixes a crash when the :send command is invoked while viewing a message: Fixes: 159fb38daf53 ("commands: refactor registration") Fixes: https://lists.sr.ht/~rjarry/aerc-devel/%3CCZ01NTGWNUBV.14A9POG9ITJ6F%40posteo.net%3E Changelog-fixed: Fixed crash when running `:send` with a `:preview` tab focused. Reported-by: Sertonix <sertonix@posteo.net> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Maarten Aertsen <maarten@nlnetlabs.nl>
* msglist: allow configuring default splitRobin Jarry2024-02-225-17/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new setting to configure the default split layout for message list tabs. The syntax is a bit different from the :split and :vsplit commands since it needs to convey the direction in the value as well. I didn't reuse split/vsplit since they are a bit confusing when used in a configuration file. The syntax is as follows: message-list-split = [<direction>] <size> The direction is optional and defaults to horizontal. The size is the number of terminal cells that will be used to display the message list. All these examples are equivalent: message-list-split = horiz 12 message-list-split = h 12 message-list-split = 12 Same idea for vertical splits: message-list-split = vertical 120 message-list-split = vert 120 message-list-split = v 120 Both :split and :vsplit commands remain usable as before. The configuration options only affect the initial layout at startup. Add config.SPLIT_* constants and sanitize AccountView.{Split,Vsplit} methods. Changelog-added: Configure default message list `:split` or `:vsplit` on startup with `message-list-split` in `aerc.conf`. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* ui: enable CSIu key encodingTim Culverhouse2024-02-221-2/+8
| | | | | | | | | | | | | | Enable CSIu key encoding protocol when support is detected. This will enable keybinds which traditionally have been unavailable due to conflicting with other keys (C-i, C-m, C-[, etc). Remove numlock and capslock from all keypresses to prevent interfering with key matching. Changelog-added: Virtually any key binding can now be configured in `binds.conf`, including Shift+Alt+Control modifier combinations. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* binds: refactor parser to be more tolerantTim Culverhouse2024-02-223-272/+64
| | | | | | | | Refactor the bind parser to construct arbitrary modified keys instead of only relying on built in maps. Add additional tests to cover edge cases. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* revert: "ui: enable kitty keyboard protocol"Robin Jarry2024-02-191-1/+2
| | | | | | | | | | | | | | This reverts commit d73cf33c2c6c3e564ce8aff04acc329a06eafc54. This breaks virtually all key bindings on foot. Almost zero ctrl- bindings work, and even in some cases, single key binds, like n don't register anymore. It looked harmless, but I should probably have tested before applying this. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* readme: rename default log exampleRobin Jarry2024-02-191-1/+1
| | | | | | | Now that this feaking log folder has moved away, we can finally redirect to a file named log. Signed-off-by: Robin Jarry <robin@jarry.cc>
* ui: enable kitty keyboard protocolTim Culverhouse2024-02-191-2/+1
| | | | | | | | | | | | Enable kitty keyboard protocol when support is detected. This will enable keybinds which traditionally have been unavailable due to conflicting with other keys (C-i, C-m, C-[, etc). Reported-by: Jonathan Dowland <jon+aerc-discuss@dow.land> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Jonathan Dowland <jon@dow.land> Acked-by: Robin Jarry <robin@jarry.cc>
* ui: update vaxisTim Culverhouse2024-02-192-4/+4
| | | | | | | | | | | | | | | Update vaxis to v0.7.4. Release notes: - Fix encoding of Ctrl+z in legacy key encodings - Add new grapheme width calc mode: nozwj where we handle VS16 and skintone selectors but _not_ zwjs - Enable forcing of grapheme width calc mode - Add styled underlines to terminal widget Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Julio B <julio.bacel@gmail.com> Acked-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* ipc: accept verbatim commandsJason Cox2024-02-192-2/+14
| | | | | | | | | | | | | | | | | | | | | | | When aerc receives a command over IPC, it quotes the arguments before passing them on to the internal command parser. In many cases, the parser interprets the quotes, and the command runs with the arguments exactly as they were specified in the shell. In some cases, though, the quotes are not interpreted and the additional quotes can cause the command to fail. Simply eliminating the addition of quotes is not possible because some commands need them. Allow a command and its arguments to be specified as a single argument in the shell. In that case, pass that argument verbatim to the internal command parser so that it is interpreted exactly as if it had been typed directly in aerc's command line. Link: https://lists.sr.ht/~rjarry/aerc-devel/%3C20240203085541.27416-2-contact%40willowbarraco.fr%3E Changelog-added: Execute IPC commands verbatim by providing the command and its args as a single argument in the shell. Cc: Willow Barraco <contact@willowbarraco.fr> Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* status: make message counts available in templatesJason Cox2024-02-191-0/+1
| | | | | | | | | Make .Recent, .Unread, .Exists, and .RUE work in statusline templates. Changelog-added: Message counts are available in statusline templates. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* format: remove unused codeTim Culverhouse2024-02-191-27/+0
| | | | | | | | Remove unused TruncateHead function. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* stylesets/nord: change border styleJonathan Dowland2024-02-191-1/+1
| | | | | | | | | | Replace a reverse-video black-on-white border, inherited from default, which does not match the rest of the "nord" style, with a thinner line border, using a fg value that ties into the theme better. Signed-off-by: Jonathan Dowland <jon@dow.land> Acked-by: Robin Jarry <robin@jarry.cc>
* store: fix split view blinkingNicolas Dichtel2024-02-151-10/+14
| | | | | | | | | | | | | | | | | | | | | When split view and threading mode are enabled, the message is blinking. First, since commit ddfa5cac1fe9 ("msgstore: fix deadlock in thread builder"), the threadCallback is never set to nil: the thread builder calls it continuously. After setting it to nil, the message is still blinking once. To avoid this, don't call the onSelect method (which points to AccountView.updateSplitView()) from the thread builder: the message is already displayed. Let's rewrite Select and selectPriv: - Select(): it takes the lock and calls the onSelect callback; - selectPriv: the assumption is that the lock is held. It doesn't call the onSelect callback. This function is only used by the thread builder. Fixes: 588be1a28422 ("store: improve cursor position") Fixes: ddfa5cac1fe9 ("msgstore: fix deadlock in thread builder") Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Robin Jarry <robin@jarry.cc>
* commands: allow to forward from emlKoni Marti2024-02-141-7/+25
| | | | | | | | | | | Forward messages from the message viewer when they are opened with :eml (e.g. rfc822 attachments). Those messages have no associated message store and currently :forward would complain about that. References: https://todo.sr.ht/~rjarry/aerc/227 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* commands: allow to reply to emlKoni Marti2024-02-141-6/+11
| | | | | | | | | | | | | | | | Reply to messages in the message viewer that were opened with :eml (e.g. rfc822 attachments). Those messages have no associated message store and currently :reply would complain about that. However, we can still use the message data to create a reply, but we would have to disable setting the replied flag and/or archiving messages (obviously, these operations don't make sense for such messages in the first place). Implements: https://todo.sr.ht/~rjarry/aerc/227 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* binds: allow account and folder binds to coexistJason Cox2024-02-141-0/+6
| | | | | | | | | | | | | | | | | | | | | When loading binds, account-specific binds are first applied, and then folder-specific binds are applied. However, in the process of merging the account-specific binds with the general binds, the folder-specific binds are lost. As a result, if both account- and folder-specific binds exist, the folder-specific binds will do nothing when in the specified account. The following minimal binds.conf reproduces this behavior: [messages] [messages:account=<ACCOUNT>] [messages:folder=<FOLDER>] q = :quit<Enter> Fix this issue by ensuring contextual binds are preserved when merging. Changelog-fixed: Allow account- and folder-specific binds to coexist. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: update dependencies to work with go v1.22Jason Cox2024-02-143-16/+18
| | | | | | | | | | Linting with golangci-lint and contrib/linters.go both started crashing for me after upgrading go to v1.22.0 from v1.21.7. Bump golangci-lint and golang.org/x/tools to their latest versions to fix this problem. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* hooks: add Message-ID to variables for mail-receivedMoritz Poldrack2024-02-142-0/+2
| | | | | | | | | | | | When scripting for the mail-received hook, it can be useful to identify a mail in a maildir. In that case the Message-ID might be one of the most useful parameters to go for identifying the file of a message. Changelog-changed: Add Message-ID to the variables of `[hooks].mail-received`. Suggested-by: Kirill Chibisov <contact@kchibisov.com> Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* colorize: preserve defaults unless overriddenRobin Jarry2024-02-1410-6/+53
| | | | | | | | | | | | | | | To be consistent with stylesets for the rest of aerc's UI, settings in the [viewer] section now only override the default colorize theme. Implements: https://todo.sr.ht/~rjarry/aerc/222 Changelog-changed: The `[viewer]` section of stylesets now preserve default values as documented in `aerc-stylesets(7)` unless explicitly overridden. Requested-by: Karel Balej <balejk@matfyz.cz> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Karel Balej <balejk@matfyz.cz> Tested-by: Matěj Cepl <mcepl@cepl.eu> Tested-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
* colorize: adapt default style for light backgroundsRobin Jarry2024-02-145-53/+68
| | | | | | | | | | | | | | | | | | | | | The current default theme is unusable on light backgrounds. Some colors are too light and are almost invisible. Use only palette colors to ensure that everything is customizable by the user. I tested this with white on black, grey on dark purple, black on yellow, black on white. Text remains readable everywhere. Update stylesets that don't use these new defaults to explicitly override them. Changelog-changed: The default `colorize` theme has been changed to use the base terminal colors. Cc: Jason Cox <me@jasoncarloscox.com> Reported-by: Matěj Cepl <mcepl@cepl.eu> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
* config: improve styleset error reportingRobin Jarry2024-02-143-6/+8
| | | | | | | | | Include the styleset filepath and exact statement that caused the error. Remove the "failed to load config: " prefix in the error message. The line is often very long already. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
* config: change default appearanceRobin Jarry2024-02-148-202/+230
| | | | | | | | | | | | | | | | | | | The default styleset and ui settings are quite dull and don't make use of the "newer" features that have been added to aerc in the past two years. Change the default styleset to something more colorful that renders correctly on both dark and light backgrounds. Change the default ui settings to get something more appealing to new users. Save the previous default color theme to a new `monochrome` styleset. Changelog-changed: The default `[ui]` settings and the `default` styleset have changed extensively. A no-color theme can be restored with the `monochrome` styleset. Cc: Marc Coquand <marc@mccd.space> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
* config: add missing settings in aerc.confRobin Jarry2024-02-141-0/+35
| | | | | | | | Some settings are supported and documented but their description and default values are not present in the default aerc.conf file. Add them. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
* log: move package to libRobin Jarry2024-02-14112-110/+110
| | | | | | | 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>
* commands: add bounceKarel Balej2024-02-123-0/+228
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a command to allow for reintroduction of messages into the transport system. This means taking a message and forwarding it to new recipients as is including original headers. The fact that the message has been bounced is indicated by the prepend of *Resent-* headers in accordance with RFC 2822. The bounced message is not stored in the sent mailbox. Also add an `-A` switch to allow for bouncing using different account than the one currently selected. Also add default keybind and documentation entry for this command. The mentioned RFC also recognizes *Resent-Cc* and *Resent-Bcc* headers which might be an interesting continuation of this -- currently all recipients are specified in *Resent-To*. Also more control over the *Resent-From* header value could be implemented. This command is strongly inspired by (neo)mutt's `bounce`. Implements: https://todo.sr.ht/~rjarry/aerc/115 Changelog-added: `:bounce` command to reintroduce messages into the transport system. Signed-off-by: Karel Balej <balejk@matfyz.cz> Acked-by: Robin Jarry <robin@jarry.cc>
* lib: add function to obtain Message-ID hostnameKarel Balej2024-02-122-21/+30
| | | | | | | | | Make the function already present in app/compose.go reusable while also changing its signature for it not to require involvement of a Composer instance. Signed-off-by: Karel Balej <balejk@matfyz.cz> Acked-by: Robin Jarry <robin@jarry.cc>
* send: move code to lib for reuseKarel Balej2024-02-127-315/+382
| | | | | | | | | | | | | Move the code which handles the preparation of a sender into which the message can be written into lib to allow for reuse. Also hide the sending backend a bit more from the `:send` command code by introducing a NewSender function which determines which backend should be used and invokes the appropriate sender factory function. Rename send() to sendHelper() to avoid collision. Signed-off-by: Karel Balej <balejk@matfyz.cz> Acked-by: Robin Jarry <robin@jarry.cc>
* jmap: set explicit sender and recipientsKarel Balej2024-02-125-18/+21
| | | | | | | | | | | | | | | 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>
* send: remove the sendCtx structKarel Balej2024-02-121-77/+54
| | | | | | | | | | | Remove all use of the sendCtx struct and instead only pass the minimum required data to sender factory functions. Also introduce shouldCopy variable instead of evaluating all copying prerequisities every time. Fix preposition in SMTP error message. Signed-off-by: Karel Balej <balejk@matfyz.cz> Acked-by: Robin Jarry <robin@jarry.cc>
* send: refactor parseSchemeKarel Balej2024-02-121-8/+8
| | | | | | | Rename several variables to better distinguish their meaning. Signed-off-by: Karel Balej <balejk@matfyz.cz> Acked-by: Robin Jarry <robin@jarry.cc>
* terminal: use start with appropriate sizeTim Culverhouse2024-02-121-1/+2
| | | | | | | | | Use the StartWithSize method to start the terminal with the appropriate size. This prevents multiple WINCH signals from being sent to the pty at startup Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* vaxis: update to v0.7.2 and update ansi parserTim Culverhouse2024-02-129-739/+190
| | | | | | | | | | | | Update Vaxis to v0.7.2 to gain performance improvements and StyledString parsing. The Vaxis parser fully accounts for the terminal's capability to display wide characters. Use the Vaxis StyledString parser to parse and style ansi-encoded strings. Remove unneeded code and tests. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* docs: update docs to remove tcell referenceTim Culverhouse2024-02-121-2/+1
| | | | | | | Update color value reference in documentation Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>