aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* mk: evaluate variables with $(shell)Robin Jarry2023-08-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we use GNU make, instead of deferred evaluation when running the target commands, use $(shell) to evaluate commands when parsing the makefile and print prettier build commands. Before: go build -trimpath `contrib/goflags.sh` -ldflags \ "-X main.Version=`git describe --long --abbrev=12 --tags --dirty 2>/dev/null || echo 0.15.2` \ -X main.Flags=$(echo -- `contrib/goflags.sh` | base64 | tr -d '\r\n') \ -X git.sr.ht/~rjarry/aerc/config.shareDir=/usr/local/share/aerc \ -X git.sr.ht/~rjarry/aerc/config.libexecDir=/usr/local/libexec/aerc" \ -o aerc After: go build -trimpath -tags=notmuch -ldflags \ "-X main.Version=0.15.2-174-gf25e038dacd7-dirty \ -X main.Flags=LS0gLXRhZ3M9bm90bXVjaAo= \ -X git.sr.ht/~rjarry/aerc/config.shareDir=/usr/local/share/aerc \ -X git.sr.ht/~rjarry/aerc/config.libexecDir=/usr/local/libexec/aerc" \ -o aerc Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* postpone: change recall/postpone logic for custom foldersVitaly Ovchinnikov2023-08-305-32/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change `:recall -f` behavior so it remembers the source folder the message is taken from and the further `:postpone` call can save it back to that folder. Change the `:recall` tab closing behavior, so it no longer asks if the recalled message needs to be deleted. This is now done automatically. Add an optional `-t <folder>` parameter to `:postpone`, so the message can be saved in a different folder. Change `:postpone` behavior, so it checks if the message was force-recalled from a different folder, and then it saves the message there. The "breaking" change is made to the closing handler of the recalled message tab. There was a confirmation dialog that asked if the recalled message needs to be deleted. This is now removed and replaced with a pretty simple logic: if the recalled message is either sent or re-postponed - it is safe to delete the original. Otherwise (if the recalled message editing is discarded, any other reasons?) the message is left intact, there is no need to ask for deleting it. If the user don't need that message - they can delete it manually. Another "breaking" change to the same handler is that it always works this way regardless of the curently selected folder. There was an `if` that checked that, but as the recalled messages are now only deleted if they are re-sent or re-postponed, it seems that there is no need to check the current folder anymore. Signed-off-by: Vitaly Ovchinnikov <v@postbox.nz> Acked-by: Robin Jarry <robin@jarry.cc>
* compose: use email domain name in Message-IdAdnan Maolood2023-08-286-7/+42
| | | | | | | | | | | | | RFC 5322 recommends using a domain name on the right-hand side of the "@" in Message-Ids. Since the local host domain name cannot be obtained reliably, use the sender email domain name by default. Add a new configuration option to maintain the old behavior. Link: https://www.rfc-editor.org/rfc/rfc5322.html#section-3.6.4 Signed-off-by: Adnan Maolood <adnan@maolood.com> Acked-by: Robin Jarry <robin@jarry.cc>
* xdg: get rid of deprecated dependenciesRobin Jarry2023-08-2722-181/+66
| | | | | | | | | | | github.com/mitchellh/go-homedir has not received any update since 2019. The last release of github.com/kyoh86/xdg was in 2020 and it has been marked as deprecated by its author. Replace these with internal functions. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Moritz Poldrack <moritz@poldrack.dev>
* xdg: add functions to deal with user home pathsRobin Jarry2023-08-274-0/+403
| | | | | | | | | | | | | These are intended to replace the following deprecated libraries: github.com/kyoh86/xdg github.com/mitchellh/go-homedir The feature set should be roughly equivalent with some tweaks to make our life easier in aerc. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Moritz Poldrack <moritz@poldrack.dev>
* wizard: improve welcome screenRobin Jarry2023-08-262-3/+6
| | | | | | | | | | The wizard now supports all protocols. Adapt welcome text accordingly. Display key bindings in a more consistent manner. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* wizard: add sendmail supportRobin Jarry2023-08-261-2/+30
| | | | | | | | Allow users to configure sendmail as outgoing protocol. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* wizard: add notmuch supportRobin Jarry2023-08-261-3/+53
| | | | | | | | Allow users configuring notmuch as email source. Try to determine configuration based on notmuch config commands. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* wizard: add support for maildirRobin Jarry2023-08-261-5/+41
| | | | | | | | Allow users configuring aerc for maildir. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* wizard: add jmap supportRobin Jarry2023-08-261-9/+42
| | | | | | | | | | | | | | Use DNS SRV discovery for JMAP along with the /.well-known/jmap URL path. Add sane defaults to accounts.conf. Also support JMAP as outgoing protocol. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com> Reviewed-by: Tristan Partin <tristan@partin.io> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* wizard: add oauth & xoauth optionsRobin Jarry2023-08-261-1/+11
| | | | | | | | These may be needed for some users. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* wizard: add imap cache-headers default settingRobin Jarry2023-08-261-3/+20
| | | | | | | | | | This seems like a sane default. Set it to true in accounts.conf. Add a note in the final screen to encourage users to review accounts.conf at their convenience. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* wizard: do not require full nameRobin Jarry2023-08-261-8/+7
| | | | | | | | Allow users to omit their full name. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* wizard: factorize ui layoutRobin Jarry2023-08-261-219/+156
| | | | | | | | | | Avoid code duplication. Use a struct to store all fields along with their respective labels. Generate a ui.Grid at once with the correct padding between the fields. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* wizard: better url generationRobin Jarry2023-08-261-44/+40
| | | | | | | | | Prepare for other protocols. Do not expect that there will be an username/password. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* wizard: add protocol & transport fieldsRobin Jarry2023-08-262-89/+152
| | | | | | | | | | | | | In preparation for other protocols, add a new "Protocol" field both in the source and outgoing sections. For now, there is only one source protocol and one outgoing protocol. Rename the "mode" fields to "transport". They will be reused later to include different authentication mechanisms. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* wizard: autofill improvementsRobin Jarry2023-08-261-18/+30
| | | | | | | | | | | | | | * Do not determine the IMAP server based on the email domain. It will most of the time be incorrect. * Only mirror the email address in usernames if they are unset. * Only mirror the IMAP username & password into their SMTP counterparts if these are unset. * Try to guess the SMTP server based on the IMAP server only if the former is empty. * Only display the password warning if the user did type a password. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* wizard: rename incoming to sourceRobin Jarry2023-08-261-138/+136
| | | | | | | | | | | | | | | | | | | Rename stuff in preparation of support for other protocols. Match the terminology from accounts.conf. This patch is more or less the result of the following command (with some manual tweaks and cleanups): sed -i -r -e 's/_INCOMING/_SOURCE/g' \ -e 's/IMAP_//g' \ -e 's/SMTP_//g' \ -e 's/([\.[:space:]])imap/\1source/g' \ -e 's/([\.[:space:]])smtp/\1outgoing/g' \ widgets/account-wizard.go Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* wizard: allow setting special copy-to folderRobin Jarry2023-08-261-16/+7
| | | | | | | | | | | Instead of a boolean, allow specifying the exact folder where to copy sent messages. Depending on the IMAP provider, the folders may be different. Instead of putting a default value which may not be correct, leave it empty. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* wizard: fix typo in validationRobin Jarry2023-08-261-1/+1
| | | | | | | | Require that smtpServer is not empty. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* wizard: close open fileRobin Jarry2023-08-261-0/+1
| | | | | | | | Avoid leaking open file descriptors. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* export-mbox: better path suggestion and name completionVitaly Ovchinnikov2023-08-251-8/+11
| | | | | | | | | | | | Change the `:export-mbox` path completion algorithm, so it works the same as `:import-mbox`: the user can select folders with auto-complete, the ~ symbol works as home folder and so on. Move the automatic mbox-file naming into the export function and only use it if the user-supplied path is an existing folder. Signed-off-by: Vitaly Ovchinnikov <v@postbox.nz> Acked-by: Robin Jarry <robin@jarry.cc>
* dirlist: apply unread style on top of recent styleKeenan Gugeler2023-08-251-4/+4
| | | | | | | | | In the documentation, we specify that the `dirlist_recent` style applies on top of the `dirlist_unread` style, but the switch statement we had only applied one of the two. Signed-off-by: Keenan Gugeler <me@kgugeler.ca> Acked-by: Robin Jarry <robin@jarry.cc>
* review: don't replace space escapesKeenan Gugeler2023-08-251-1/+0
| | | | | | | | | | Currently we replace `<space>` in the output column in the review pane. This causes the default actions `:attach<space>` and `:detach<space>` to not be correctly named, and causes a mismatch between `binds.conf` and the displayed bindings. Signed-off-by: Keenan Gugeler <me@kgugeler.ca> Acked-by: Robin Jarry <robin@jarry.cc>
* review: sort unknown review commandsKeenan Gugeler2023-08-251-0/+7
| | | | | | | | | | Currently, the unknown commands in the review window appear in an undefined order, since `go-ini` gives us a `map`. Instead, we should sort them by inputs, otherwise the ordering can get confusing between restarts of aerc. Signed-off-by: Keenan Gugeler <me@kgugeler.ca> Acked-by: Robin Jarry <robin@jarry.cc>
* config: add missing configuration file annotationKarel Balej2023-08-241-6/+9
| | | | | | | | | Describe the changes introduced by 180fffa92ec7 also directly in the example configuration file. Fixes: 180fffa92ec7 ("commands: allow reading attachments from a file") Signed-off-by: Karel Balej <balejk@matfyz.cz> Acked-by: Robin Jarry <robin@jarry.cc>
* mk: fix typosRobin Jarry2023-08-241-2/+2
| | | | | | | | Nothing serious but let's cleanup our mess. Fixes: d725defa07b5 ("mk: deprecate BSD make in favor of GNU make") Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Karel Balej <balejk@matfyz.cz>
* ci: use make -C instead of changing directoriesRobin Jarry2023-08-242-20/+9
| | | | | | | This is a matter of preference. I prefer -C over changing dirs. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Karel Balej <balejk@matfyz.cz>
* ci: run all testsRobin Jarry2023-08-241-1/+1
| | | | | | | Do not restrict to go tests only. Also run filter tests. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Karel Balej <balejk@matfyz.cz>
* commands: allow reading attachments from a fileKarel Balej2023-08-243-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | Currently, aerc reads a list of files to be attached to a message from the file-picker-cmd's standard output. However, this doesn't play nice with ranger which seems to draw itself by writing there, causing it to be invisible in the embedded terminal. In fact, instead of using a pipe, aerc redirects the output of the command to a temporary file and then reads the list of files from there. Take advantage of this approach and allow user to directly reference this temporary file in the file-picker-cmd via the %f placeholder, which gets expanded to the temporary file's location. If the %f placeholder isn't present, keep the old behaviour. So for example, now it is possible to do: file-picker-cmd=ranger --choosefiles=%f in aerc.conf. Signed-off-by: Karel Balej <balejk@matfyz.cz> Acked-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
* doc: add MessageId to aerc-templates.7Tim Culverhouse2023-08-241-0/+6
| | | | | | | | | | {{.MessageId}} is available within templates but undocumented. Previously, users could have surmised a way to get the message ID using {{.Header "message-id"}}, but since this is built into the struct already, document it for ease of use. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* jmap: cache session as jsonTim Culverhouse2023-08-242-5/+5
| | | | | | | | | | | | | | | The gob encoder requires registration of types used during encoding. There are several types defined in the Session object that don't directly or indirectly get registered with gob. As a result, the session object never actually gets cached, requiring an authentication step which is often unnecessary. Use json encoding for this object to provide a simpler serialization path. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Moritz Poldrack <moritz@poldrack.dev>
* doc: add <esc> to aerc-binds.5Keenan Gugeler2023-08-241-0/+2
| | | | | | | We always accepted this binding, but it was never documented. Signed-off-by: Keenan Gugeler <me@kgugeler.ca> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* contributing: add guidelines for including changelogsRobin Jarry2023-08-242-0/+24
| | | | | | | | | | Recently there were several contributors that included their changelog in the commit message and/or didn't include a changelog at all. Add comprehensive guidelines to help people figuring the email-based review workflow. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* colorize: only emit osc8 if [general].enable-osc8=trueRobin Jarry2023-08-243-5/+21
| | | | | | | | | | | | | | | | Some old versions of less do not handle OSC 8 escape sequences. Even if aerc's embedded terminal is configured to handle them, less corrupts them making the output unreadable. 8;id=colorize-1;https://foobar.com/stuff/https://foobar.com/stuff/ When [general].enable-osc8 is set to false (its default value) do not attempt to generate OSC 8 sequences with the built-in colorize filter. These sequences would be stripped out anyway. Reported-by: Omar Polo <op@omarpolo.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Kirill Chibisov <contact@kchibisov.com>
* terminal: avoid races between close and drawRobin Jarry2023-08-111-27/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix races where a goroutine calls Terminal.Draw and another one calls Terminal.Close or Terminal.Destroy. The closing thread will eventually set term.vterm to nil just before the drawing thread calls term.vterm.Draw(), causing this crash: Error: runtime error: invalid memory address or nil pointer dereference goroutine 1 [running]: panic({0xb09140, 0x10b5860}) runtime/panic.go:890 +0x263 git.sr.ht/~rockorager/tcell-term.(*VT).Draw(0x0) git.sr.ht/~rockorager/tcell-term@v0.8.0/vt.go:424 +0x50 git.sr.ht/~rjarry/aerc/widgets.(*Terminal).draw(0xc001c658b0) git.sr.ht/~rjarry/aerc/widgets/terminal.go:116 +0x29 git.sr.ht/~rjarry/aerc/widgets.(*Terminal).Draw(0xc001c658b0, 0xc002b08150) git.sr.ht/~rjarry/aerc/widgets/terminal.go:108 +0x1b4 git.sr.ht/~rjarry/aerc/lib/ui.(*Grid).Draw(0xc001d0c360, 0xc0008ddb30) git.sr.ht/~rjarry/aerc/lib/ui/grid.go:126 +0x225 git.sr.ht/~rjarry/aerc/widgets.(*Composer).Draw(0xc001c13180, 0xc0008ddb30) git.sr.ht/~rjarry/aerc/widgets/compose.go:747 +0x8f git.sr.ht/~rjarry/aerc/lib/ui.(*TabContent).Draw(0xc0003cc5b0, 0xc0008ddb30) git.sr.ht/~rjarry/aerc/lib/ui/tab.go:468 +0x1f4 git.sr.ht/~rjarry/aerc/lib/ui.(*Grid).Draw(0xc0001b2900, 0xc000037050) git.sr.ht/~rjarry/aerc/lib/ui/grid.go:126 +0x225 git.sr.ht/~rjarry/aerc/widgets.(*Aerc).Draw(0xc000000180, 0xc000037050) git.sr.ht/~rjarry/aerc/widgets/aerc.go:193 +0x209 git.sr.ht/~rjarry/aerc/lib/ui.(*UI).Render(0xc000414040) git.sr.ht/~rjarry/aerc/lib/ui/ui.go:105 +0x62 main.main() git.sr.ht/~rjarry/aerc/main.go:279 +0xbac Use an atomic to determine if the terminal is closed or not. Never set vterm to nil (it is not necessary). Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Koni Marti <koni.marti@gmail.com> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
* style: add msglist_gutter and msglist_pill to configKonstantin Shelekhin2023-08-1110-2/+19
| | | | | | | | | | Allow a user to change the default style of the message list scrollbar. There is no easy way to set the default style for an object directly in code, so I've updated every built-in theme to preserve the existing style. Signed-off-by: Konstantin Shelekhin <k.shelekhin@ftml.net> Acked-by: Robin Jarry <robin@jarry.cc>
* doc: strip email addresses in authors sectionRobin Jarry2023-08-1115-45/+45
| | | | | | | | Let's not encourage users to send us personal emails. The referenced URL https://sr.ht/~rjarry/aerc/ should have all necessary information. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* mk: deprecate BSD make in favor of GNU makeRobin Jarry2023-08-115-224/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | Being portable between BSD and GNU make is a nightmare. It restricts features to a very minimal surface and in turn requires a lot of code duplication and manual updating of file lists. Worse, aerc's makefile relies on the shell assignment operator (!=) which has been supported by BSD make 2.2 since 1997 but GNU make 4.0 since 2013. Unfortunately, MacOS runs GNU make 3.8 which does not have that feature. Reducing the feature set even more. Stop that nonsense and remove BSD make compatibility. The majority of aerc's users either run a GNU Linux distribution or MacOS. For those who run any *BSD variant, it is easy for them to install GNU make (gmake) if they don't have it installed already. Use GNU make constructs to generate build and install rules dynamically based on source files discovery. GNU make will use "GNUmakefile" in priority over "Makefile" if possible. Leverage this to display an explicit message when other flavours of make are used. Leave a "Makefile" with a .DEFAULT: target and rename the actual file to "GNUmakefile". Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* notmuch: add option to provide path for accountKirill Chibisov2023-08-053-2/+16
| | | | | | | | | | Add the "maildir-account-path" account configuration option to select the account relative to the "maildir-store" to have traditional maildir one tab per account behavior with notmuch. Signed-off-by: Kirill Chibisov <contact@kchibisov.com> Acked-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* export-mbox: only export marked messages, if anyVitaly Ovchinnikov2023-08-053-4/+28
| | | | | | | | | | Change the `:export-mbox` behavior, so if some messages are marked with `:mark` - only those messages are exported. If nothing is marked - the whole folder is exported, as usual. Signed-off-by: Vitaly Ovchinnikov <v@postbox.nz> Acked-by: Robin Jarry <robin@jarry.cc> Tested-by: Koni Marti <koni.marti@gmail.com>
* attach: add an option to pipe the attachments inVitaly Ovchinnikov2023-08-054-24/+100
| | | | | | | | | | | | | | | Add the -r option to :attach so that the attachments can be piped in from a command. Example: :attach -r image.jpg read-jpeg-from-clipboard.sh It takes two parameters: the attachment name (to be used in the email and to get the MIME type from) and the command to execute and read the output. Signed-off-by: Vitaly Ovchinnikov <v@postbox.nz> Acked-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Koni Marti <koni.marti@gmail.com>
* go.mod: drop mergo packageKoni Marti2023-08-042-3/+0
| | | | | | | | | Drop the mergo package since it is no longer needed to merge the UI configs. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* config: fix contextual ui configKoni Marti2023-08-041-4/+5
| | | | | | | | | | | Re-parse the contextual UI config over the existing UI config in order to avoid the zero-value overwrite issue. This fixes the usage of bool config variables in the contextual sections (such as threading-enabled). Fixes: https://todo.sr.ht/~rjarry/aerc/121 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* account: fix contextual sortKoni Marti2023-08-041-4/+11
| | | | | | | | | | | | Fix contextual sort. Pass a folder-specific sort criteria to the message store when it is created. Before, the message store would receive the sort criteria from the UI config of the currently selected directory (if any was selected at all). Fixes: https://todo.sr.ht/~rjarry/aerc/121 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* contrib: update sendemail-validate hookRobin Jarry2023-08-044-36/+64
| | | | | | | | | With git 2.41, git send-email exports a patch counter to the validate hook. Copy the example hook from git and adapt it for aerc. Link: https://github.com/git/git/commit/3c8d3adeae83 Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* filters: put libexec/filters dirs before default PATHRobin Jarry2023-08-044-3/+16
| | | | | | | | | | | | | | | | | | Some distro packages install binaries in /usr/bin that clash with some of aerc's builtin filters (for example, colorize and wrap). The issue is that aerc filters dir (usually /usr/libexec/aerc/filters) is *after* /usr/bin, making the builtin filters not accessible when these distro packages are installed. Since this mostly concerns colorize and wrap, move $LIBEXEC/aerc/filters at the beginning of the exec PATH when running filter commands. If the intent is **really** to execute /usr/bin/colorize or /usr/bin/html, then their absolute paths should be used. Link: https://archlinux.org/packages/extra/x86_64/talkfilters/ Link: https://tracker.debian.org/pkg/colorize Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io>
* hooks: add account and folder to mail-received envRobin Jarry2023-08-044-2/+10
| | | | | | | | Add AERC_ACCOUNT and AERC_FOLDER to the environment of the mail-received hook command. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io>
* msglist: fetch headers even when not focusedRobin Jarry2023-08-042-7/+30
| | | | | | | | | | | | | | Do not rely on MessageList.Draw only to fetch missing headers. In Draw, report the current scroll offset and length to the message store and use them to determine if a new message UID should be candidate for fetching headers. This allows the mail-received hook to work even when the message list is not focused. Fixes: https://todo.sr.ht/~rjarry/aerc/147 Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tristan Partin <tristan@partin.io>
* wizard: allow ? in passwordsRobin Jarry2023-08-041-0/+1
| | | | | | | | | | | | There is a default ? bind in the global context to show the current key bindings. It is completely useless in the wizard context and prevents users from typing ? if this character is in their password. Disable globals in the wizard bindings (equivalent of $noinherit=true). Reported-by: Brad <super1337@posteo.net> Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Koni Marti <koni.marti@gmail.com>