aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* aerc: support terminal-based pinentry programsKoni Marti7 days5-0/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support terminal-based pinentry programs. Suspend vaxis before running the command that can trigger a pinentry call. Provide the proper tty in the GPG_TTY environment variable (and set a TERM variable if not provided; this is necessary for pinentry-curses). Finally, resume vaxis. To enable terminal-based pinentry support, you have to set [general] use-terminal-pinentry = true in your aerc.conf. Any GUI-based pinentry programs will work the same as before if this option is not set to true. To test pinentry-tty, add the following to your ~/.gnupg/gpg-agent.conf: pinentry-program /usr/bin/pinentry-tty and kill all running gpg-agents: $ killall gpg-agent Fixes: https://todo.sr.ht/~rjarry/aerc/202 Changelog-fixed: Terminal-based pinentry programs (e.g. `pinentry-curses`) now work properly. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* aerc: add quake-mode terminalKoni Marti10 days7-15/+288
| | | | | | | | | | | | | | | | | | Add a drop-down (quake-mode) terminal which is a persistent terminal session that overlays aerc at the top and can be toggled on or off. Enable quake mode by setting [General].enable-quake-mode=true. The height of the drop-down terminal can be set with [ui].quake-terminal-height (default: 20). Toggling is hardcoded to the F1 key. Note that this key should not be used in your key bindings when you enable Quake mode. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* models: pad message uids with zeroesRobin Jarry2024-10-031-1/+1
| | | | | | | | | | | | | | IMAP message UIDs are 32 bits unsigned integers. All other backends use opaque strings without any specific ordering. The UIDs are used for ordering only for IMAP. Pad the integer uids with zeroes when converting them to strings to ensure ASCII sorting will work as previously. Fixes: 73dc39c6ee08 ("treewide: replace uint32 uids with opaque strings") Reported-by: Fedor Pchelkin <boddah8794@gmail.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Jens Grassel <jens@wegtam.com>
* calendar: skip editor when replying to invitationsinwit2024-10-032-3/+14
| | | | | | | | | | | Most of the time, accepting an invitation does not require editing the automatically generated email before sending it. Allow the user to optionally skip the editor entirely and go directly to the review screen when dealing with invitations. References: https://todo.sr.ht/~rjarry/aerc/247 Signed-off-by: inwit <inwit@sindominio.net> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* dirtree: fix dirlist-collapse=0 regressionRobin Jarry2024-09-201-1/+2
| | | | | | | | | Ensure not to collapse any folder when dirlist-collapse=0. Fixes: 73dc39c6ee08 ("treewide: replace uint32 uids with opaque strings") Reported-by: Tim Culverhouse <tim@timculverhouse.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* templates/quote: only prefix quoted lines with '>'Tim Culverhouse2024-09-201-1/+5
| | | | | | | | | | | | | | | | Prefix all quoted lines with depth > 1 with '>'. Quoted lines of depth 1 are quoted with "> ". This follows conventions of mailing lists which collapse quote depths without spaces. For example: >>> Quote depth 3 > Quote depth 1 >> Quote depth 2 Changelog-changed: Template function `quote` only prefixes with a space if at quote depth 1. Requested-by: Isaac Freund <mail@isaacfreund.com> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: update golangci-lint to 1.61.0Tristan Partin2024-09-209-20/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | golangci-lint 1.56 does not work with go 1.23. It causes obscure errors: [linters_context/goanalysis] buildir: panic during analysis: Cannot range over: func(yield func(K, V) bool), goroutine 4743 [running]: runtime/debug.Stack() /usr/lib/go/src/runtime/debug/stack.go:26 +0x5e github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1() /home/build/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.1/pkg/golinters/goanalysis/runner_action.go:104 +0x5a panic({0x164b260?, 0xc00669b4a0?}) /usr/lib/go/src/runtime/panic.go:785 +0x132 honnef.co/go/tools/go/ir.(*builder).rangeStmt(0xc000051910, 0xc00a29cf00, 0xc009bf55c0, 0x0, {0x1af1960, 0xc009bf55c0}) /home/build/go/pkg/mod/honnef.co/go/tools@v0.4.6/go/ir/builder.go:2214 +0x894 honnef.co/go/tools/go/ir.(*builder).stmt(0xc000051910, 0xc00a29cf00, {0x1af6970?, 0xc009bf55c0?}) /home/build/go/pkg/mod/honnef.co/go/tools@v0.4.6/go/ir/builder.go:2427 +0x20a honnef.co/go/tools/go/ir.(*builder).stmtList(...) /home/build/go/pkg/mod/honnef.co/go/tools@v0.4.6/go/ir/builder.go:847 honnef.co/go/tools/go/ir.(*builder).stmt(0xc000051910, 0xc00a29cf00, {0x1af6880?, 0xc004f52ed0?}) /home/build/go/pkg/mod/honnef.co/go/tools@v0.4.6/go/ir/builder.go:2385 +0x1415 honnef.co/go/tools/go/ir.(*builder).buildFunction(0xc000051910, 0xc00a29cf00) /home/build/go/pkg/mod/honnef.co/go/tools@v0.4.6/go/ir/builder.go:2497 +0x417 honnef.co/go/tools/go/ir.(*builder).buildFuncDecl(0xc000051910, 0xc00622eea0, 0xc004f52f00) /home/build/go/pkg/mod/honnef.co/go/tools@v0.4.6/go/ir/builder.go:2534 +0x189 honnef.co/go/tools/go/ir.(*Package).build(0xc00622eea0) /home/build/go/pkg/mod/honnef.co/go/tools@v0.4.6/go/ir/builder.go:2638 +0xb46 sync.(*Once).doSlow(0xc009b81260?, 0xc009bf5bc0?) /usr/lib/go/src/sync/once.go:76 +0xb4 sync.(*Once).Do(...) /usr/lib/go/src/sync/once.go:67 honnef.co/go/tools/go/ir.(*Package).Build(...) /home/build/go/pkg/mod/honnef.co/go/tools@v0.4.6/go/ir/builder.go:2556 honnef.co/go/tools/internal/passes/buildir.run(0xc000cf61a0) /home/build/go/pkg/mod/honnef.co/go/tools@v0.4.6/internal/passes/buildir/buildir.go:86 +0x18b github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0xc002d77d70) /home/build/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.1/pkg/golinters/goanalysis/runner_action.go:190 +0x9cd github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2() /home/build/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.1/pkg/golinters/goanalysis/runner_action.go:112 +0x17 github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc0007a5c70, {0x1859190, 0x7}, 0xc001c28f48) /home/build/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.1/pkg/timeutils/stopwatch.go:111 +0x44 github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0xc00212f680?) /home/build/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.1/pkg/golinters/goanalysis/runner_action.go:111 +0x6e github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0xc002d77d70) /home/build/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.1/pkg/golinters/goanalysis/runner_loadingpackage.go:80 +0xa5 created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze in goroutine 3468 /home/build/go/pkg/mod/github.com/golangci/golangci-lint@v1.56.1/pkg/golinters/goanalysis/runner_loadingpackage.go:75 +0x1e9 Update golangci-lint to 1.61.0 that works with go 1.23. It has new checkers that report errors that we need to fix: lib/crypto/gpg/gpgbin/gpgbin.go:226:22: printf: non-constant format string in call to fmt.Errorf (govet) return fmt.Errorf(strings.TrimPrefix(line, "[GNUPG:] ")) ^ worker/imap/observer.go:142:21: printf: non-constant format string in call to fmt.Errorf (govet) Error: fmt.Errorf(errMsg), ^ app/dirlist.go:409:5: S1009: should omit nil check; len() for []string is defined as zero (gosimple) if dirlist.dirs == nil || len(dirlist.dirs) == 0 { ^ app/dirtree.go:181:5: S1009: should omit nil check; len() for []*git.sr.ht/~rjarry/aerc/worker/types.Thread is defined as zero (gosimple) if dt.list == nil || len(dt.list) == 0 || dt.countVisible(dt.list) < y+dt.Scroll() { ^ app/authinfo.go:30:34: printf: non-constant format string in call to (*git.sr.ht/~rjarry/aerc/lib/ui.Context).Printf (govet) ctx.Printf(0, 0, defaultStyle, text) ^ app/authinfo.go:34:27: printf: non-constant format string in call to (*git.sr.ht/~rjarry/aerc/lib/ui.Context).Printf (govet) ctx.Printf(0, 0, style, text) ^ app/authinfo.go:62:34: printf: non-constant format string in call to (*git.sr.ht/~rjarry/aerc/lib/ui.Context).Printf (govet) x += ctx.Printf(x, 0, style, text) ^ Pretty much all of these errors are us passing non-const format strings to various methods. In C land, this is a large security issue. I would assume the same stands in Go. Thank you golangci-lint! Link: https://builds.sr.ht/~rjarry/job/1332376#task-validate-500 Signed-off-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
* commands: add an echo commandBence Ferdinandy2024-09-202-0/+29
| | | | | | | | | | | | | Currently if you want to explore what templates resolve to, it's a bit of pain. Add an echo command that doesn't do anything, other than prints the string that is its argument with the templates resolved. Implements: https://todo.sr.ht/~rjarry/aerc/277 Changelog-added: New `:echo` command that prints its arguments with templates resolved. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Reviewed-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
* mailmap: fix email typo for timRobin Jarry2024-09-041-0/+1
| | | | | | | This breaks my git-people script. Link: https://git.sr.ht/~rjarry/dotfiles/tree/main/item/bin/git-people Signed-off-by: Robin Jarry <robin@jarry.cc>
* treewide: replace uint32 uids with opaque stringsRobin Jarry2024-08-2864-649/+541
| | | | | | | | | | | | | | | | | Add a new models.UID type (an alias to string). Replace all occurrences of uint32 being used as message UID or thread UID with models.UID. Update all workers to only expose models.UID values and deal with the conversion internally. Only IMAP needs to convert these to uint32. All other backends already use plain strings as message identifiers, in which case no conversion is even needed. The directory tree implementation needed to be heavily refactored in order to accommodate thread UID not being usable as a list index. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* reload: reload everything if no flags are providedJason Cox2024-08-242-0/+9
| | | | | | | | | | | Currently, the :reload command silently does nothing if no flags are provided. Eliminate this confusion by reloading all reloadable configs in the absence of flags. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Reviewed-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: fix SeqMap.Pop runtime errorKoni Marti2024-08-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a runtime error in the SeqMap.Pop function causing a index-out-of-range panic: Version: 0.18.2.r22.gfff69046 (go1.22.6 amd64 linux 2024-08-10) Error: runtime error: index out of range [487] with length 487 goroutine 24430 [running]: runtime/debug.Stack() runtime/debug/stack.go:24 +0x5e git.sr.ht/~rjarry/aerc/lib/log.PanicHandler() git.sr.ht/~rjarry/aerc/lib/log/panic-logger.go:49 +0x66a panic({0x5dbf5a688020?, 0xc002ab0d80?}) runtime/panic.go:770 +0x132 git.sr.ht/~rjarry/aerc/worker/imap.(*SeqMap).Pop(0xc0003d4940, 0x1e8) git.sr.ht/~rjarry/aerc/worker/imap/seqmap.go:64 +0x17c git.sr.ht/~rjarry/aerc/worker/imap.(*IMAPWorker).handleImapUpdate(0xc0003d4820, {0x5dbf5a6dbd00, 0xc002068708}) git.sr.ht/~rjarry/aerc/worker/imap/worker.go:296 +0x26c git.sr.ht/~rjarry/aerc/worker/imap.(*IMAPWorker).drainUpdates.func1() git.sr.ht/~rjarry/aerc/worker/imap/flags.go:29 +0x10c created by git.sr.ht/~rjarry/aerc/worker/imap.(*IMAPWorker).drainUpdates in goroutine 52 git.sr.ht/~rjarry/aerc/worker/imap/flags.go:21 +0x78 SeqMap.Pop uses two locks in the same function: first lock grabs the size of the slice, second lock removes the given index in the slice. Combine the two locks to prevent a change of the slice size before the index can be removed. Reported-by: Moritz Poldrack <moritz@poldrack.dev> Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch: add auto-switch optionKoni Marti2024-08-244-1/+133
| | | | | | | | | | | | | | | | | | | Add an auto-switch option that changes the project of the patch manager based on the subject line of a message if it contains a '[PATCH <project>]' segment. A subject line with '[PATCH aerc v2]' would switch to the 'aerc' project if that project is available in the patch manager. The auto switching can be activated per account by adding 'pama-auto-switch = true' to your account config. Implements: https://todo.sr.ht/~rjarry/aerc/226 Changelog-added: Auto-switch projects based on the message subject for the :patch command. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* gpg: fix signed message encodingKoni Marti2024-08-241-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the content encoding for GPG-signed messages. To remove the Mime-Version header field for the signed message part, the raw message is parsed with go-message. go-message.Read(), however, decodes the message body as well (i.e. from quoted-printable to UTF8 depending on the Content-Transfer-Encoding header). This means that the msg.Body field now contains the decoded message (it is no longer encoded as quoted-printable). We never encode the message back to the proper Content-Transfer-Encoding. To fix this, use net/mail.ReadMessage() to parse the headers and to not decode the message body. To verify the issue, send a signed message with the following text: "19+1=20!" The message will be properly signed, but the text is wrong; it shows "19+1 !"; instead it should read "19+1=3D20!". Fixes: 5e443bce ("gpg: fix mime-version header position") References: https://todo.sr.ht/~rjarry/aerc/79 Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Jens Grassel <jens@wegtam.com> Acked-by: Robin Jarry <robin@jarry.cc>
* forward: better preserve attached file namesVitaly Ovchinnikov2024-08-241-2/+2
| | | | | | | | | | | Use a dedicated filename function for getting a name of the attached file instad of analyzing its mime type. Some attachments have file name in `Content-Disposition` rather than `Content-Type`, the new method handles both cases. Signed-off-by: Vitaly Ovchinnikov <v@ovch.ru> Acked-by: Robin Jarry <robin@jarry.cc>
* jmap: fetch created messages and set recent flagTim Culverhouse2024-08-241-21/+49
| | | | | | | | | | When a push notification arrives, automatically fetch any newly created messages. Set the Recent flag on these messages to trigger a notification in the UI. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: fix watcher pathThorben Günther2024-08-241-3/+14
| | | | | | | | | | | | | | The watcher path does not necessarily contain ".notmuch". From notmuch-config(1): Notmuch will store its database here, (in sub-directory named .notmuch if database.mail_root is unset). So we can simply check if the ".notmuch" folder exists and fallback to the default path if it does not. Signed-off-by: Thorben Günther <admin@xenrox.net> Acked-by: Robin Jarry <robin@jarry.cc>
* ircbot: sanitize email subjectsRobin Jarry2024-08-201-3/+5
| | | | | | | | | Email subjects may contain line breaks if they are too long to fit in 72 columns. The supybot library does not support sending messages with line breaks. It raises an error. Replace all consecutive "white space" characters (including \r and \n) with regular space characters. Signed-off-by: Robin Jarry <robin@jarry.cc>
* commands: add reloadKoni Marti2024-08-205-4/+199
| | | | | | | | | | | | | | Add the reload command that performs a reload of config files. The reload command supports reloading the binds.conf and aerc.conf config files. Reloading will reload account views (including the directory list), message viewers, and composers. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* store: extract configure logicKoni Marti2024-08-202-62/+60
| | | | | | | | | | Extract a function to configure the message store from its constructor to reconfigure the store when the data changes. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* account: update split viewsKoni Marti2024-08-201-2/+23
| | | | | | | | | | | Update split views on reload. Use the safe acct.SelectedMessage() instead of acct.msglist.Selected() which can panic if msglist.store is nil. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* account: extract configure logicKoni Marti2024-08-201-17/+22
| | | | | | | | | | Extract a function to configure the account view from the constructor; rebuild the grid whenever the config data changed on a hot-reload. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* account: remove ui config struct fieldKoni Marti2024-08-203-21/+18
| | | | | | | | | | Remove the UI config field in the AccountView struct to ensure we use the most current UI config. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* tabs: update ui config in any tabKoni Marti2024-08-202-26/+27
| | | | | | | | | Update UI config in tabs. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* log: handle config reloadKoni Marti2024-08-202-3/+48
| | | | | | | | | | | | Prepare the logging system for a config file reload. Make sure that we never close os.Stdout but only log file descriptors. Note that if you started aerc by redirecting its output into a specific file, this cannot be changed by a config reload. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* config: extract load styleset functionKoni Marti2024-08-201-19/+33
| | | | | | | | | | Extract the function to load stylesets. Add a function to clear the contextual UI cache. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* config: add reload helper functionsKoni Marti2024-08-204-4/+77
| | | | | | | | | | Add reload helper function to reload config files. Store the initially used config files for the reloading. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* jmap: refactor thread fetchingTim Culverhouse2024-08-202-40/+23
| | | | | | | | | | | | | | | | | | Refactor JMAP thread fetching to occur in a single request. We use a result reference method call on Email/get to fetch the message info for each message in a thread. Previously, we checked the cache and only fetched information for messages we didn't already have. This results in two requests and is typically slower for most contexts. Also, in most cases if we are fetching an email we don't already have it's because we also need to fetch the entire thread. The only case this wouldn't happen is if we get a new email in a thread. We can optimize this by fetching message info for created messages in the push method at a later time. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* jmap: lazily fetch identitiesTim Culverhouse2024-08-202-19/+33
| | | | | | | | | | | | | Fetch Identities only when required: when we are sending an email. Refactor connect.go to check the state string of the Session on every request, and update the session as needed. Move the Session validity check to happen on any request, eg when our client returns an error we first update the Session object (via re-authenticating) and then retry the request. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* maildir: set the forwarded flag when forwarding msgsinwit2024-08-203-7/+36
| | | | | | | | | | | The maildir backend was ignoring the passed/forwarded flag. Allow for this flag to be set and synced to the server (if the server admits it). Changelog-added: The maildir backend now honors the forwarded/passed flag. Signed-off-by: inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: set the "passed" tag when forwarding msgsinwit2024-08-203-8/+36
| | | | | | | | | | | | | | In notmuch, forwarded messages should be marked with the "passed" tag, which is subsequently synchronized with the corresponding maildir "P" flag. Ensure both flag and tag are applied to forwarded messages in the notmuch interface. Link: https://notmuchmail.org/special-tags/ Changelog-added: The notmuch backend now honors the forwarded flag, setting the "passed" tag. Signed-off-by: inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* flag: manually toggle the forwarded taginwit2024-08-201-5/+13
| | | | | | | | | | Allow the user to manually set, unset and toggle the forwarded tag. Changelog-added: The :flag command now sets/unsets/toggle the forwarded tag. Signed-off-by: inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* templates: add a template for forwaded messagesinwit2024-08-204-2/+14
| | | | | | | | | | | Add a {{.IsForwarded}} template to tell if a message has been forwarded or not. Changelog-added: Forwarded messages can be identified with the {{.IsForwarded}} template. Signed-off-by: inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* styles: add a style for forwarded messagesinwit2024-08-203-10/+18
| | | | | | | | | | | Allow for messages marked with the forwarded flag to be styled differently. Changelog-added: Forwarded messages can be styled differently in the message list. Signed-off-by: inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* search: allow searching for forwarded messagesinwit2024-08-202-4/+7
| | | | | | | | | | | | Commands :search and :filter allow the use of certain flags (read, replied...) as search criteria. Allow for the use of the forwarded flag too. Changelog-added: Forwarded messages can now be searched for and filtered in notmuch and maildir. Signed-off-by: inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* forward: allow forwarded flag to be setinwit2024-08-208-2/+39
| | | | | | | | | | | | Usually, a MUA sets a flag for messages that have been forwarded, but this is currently not the case for aerc. Consider the forwarded flag and prepare aerc to set it everytime the :forward command is called and ends successfully. Changelog-added: The :forward command now sets the forwarded flag. Signed-off-by: inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* copy: add -d flag to decrypt before copyingKoni Marti2024-08-202-2/+36
| | | | | | | | | | | Add -d flag to the copy command to decrypt a message before copying it. Implements: https://todo.sr.ht/~rjarry/aerc/238 Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Jens Grassel <jens@wegtam.com> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* pipe: add -d flag to decrypt messageKoni Marti2024-08-202-2/+29
| | | | | | | | | | | Add -d flag to the pipe command to decrypt a message before it is piped. Implements: https://todo.sr.ht/~rjarry/aerc/238 Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Jens Grassel <jens@wegtam.com> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* cryptoutil: implement cleartext functionKoni Marti2024-08-201-0/+69
| | | | | | | | | | | | | | | Implement a cleartext function in the cryptoutil package to decrypt an encrypted message to cleartext and construct a valid rfc2822 message. The headers from the decrypt message body will be merged with the original headers to create a fully decrypted message. Implements: https://todo.sr.ht/~rjarry/aerc/238 Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Jens Grassel <jens@wegtam.com> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* mod: update go-maildir to v0.5.0Bence Ferdinandy2024-08-202-3/+3
| | | | | | | | | This release solves an issue with malformed files in a folder stopping go-maildir from listing all other valid files. Fixes: https://todo.sr.ht/~rjarry/aerc/215 Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* go: bump minimal version to 1.21 and handle deprecationsBence Ferdinandy2024-08-206-12/+8
| | | | | | | | | | | | | Go 1.18 is already EOL. go-maildir v0.5.0 requires go 1.20 at least. Since go 1.20 is also EOL, bump the minimum required go version to the first still supported version which is 1.21. Go 1.20 deprecated Seed and Read in math/rand. Update the code accordingly. Changelog-deprecated: Support for go 1.20 and older. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* maildir: only abort directory listing if there are 0 uidsBence Ferdinandy2024-08-201-1/+1
| | | | | | | | | | | | If there is an error in container.UIDs, we will abort handling the message list, resulting in showing the number of messages by the directory name, but having an empty message list showing. Only return with err, if UIDs actually returned 0 messages. References: https://todo.sr.ht/~rjarry/aerc/215 Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* filters: send real COLUMNS and LINES valuesTristan Partin2024-08-201-0/+4
| | | | | | | | | | | | Previously filters received default COLUMNS LINES values no matter the width of the terminal. Fixes: https://todo.sr.ht/~rjarry/aerc/232 Changelog-added: Filters will receive the actual COLUMNS and LINES values. Signed-off-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
* templates: fix AccountFrom default breaking startupBence Ferdinandy2024-08-201-1/+1
| | | | | | | | | | | | The default of {{.AccountFrom}} is currently nil. During startup, if index-columns has something like {{.AccountFrom.Address}} then startup will fail due to nil pointer evaluation. Add an example address to return. Fixes: 1d4eafb011f4 ("templates: add {{.AccountFrom}} template") Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Tested-by: skejg <grolleman@zoho.com> Acked-by: Robin Jarry <robin@jarry.cc>
* log: explain why the signature command failedTristan Partin2024-08-201-0/+5
| | | | | | | It wasn't previously apparent why the command failed. Signed-off-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
* template: pass account and folder names to signature commandTristan Partin2024-08-201-0/+4
| | | | | | | | | This can help to dynamically determine what signature you want. Changelog-added: `AERC_ACCOUNT` and `AERC_FOLDER` are now available in the signature command environment. Signed-off-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
* jmap: fix emailKey function nameTristan Partin2024-08-201-4/+4
| | | | | | | This was just a simple typo. Signed-off-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
* send: redact password in outgoing URI for loggingKoni Marti2024-08-201-1/+1
| | | | | | | | | | Redact the password in the outgoing URI for logging. This will replace the password by "xxxxx" and prevent a plaintext password leak in the logs. Signed-off-by: Koni Marti <koni.marti@gmail.com> Reviewed-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: reload all changed messages on DB changeJason Cox2024-08-202-23/+41
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit c56649fe5291b725f14b45550a68cc7d0dc16ff7. As discussed in the aerc-devel thread for the reverted patch, the performance improvement comes with an issue: changes to message tags are no longer immediately reflected in the UI. This issue occurs whether the tags are modified from within aerc or externally with the notmuch CLI. The message list also flickers any time tag changes are made. Further, commit c36ed72e4a59 ("notmuch: speed up lastmod query") dramatically reduces the number of messages which are re-indexed when the database changes, likely eliminating the need for the reverted performance improvement anyway. Fixes: c56649fe5291 ("notmuch: don't reload all message on change") Link: https://lists.sr.ht/~rjarry/aerc-devel/patches/53729 Link: https://lists.sr.ht/~rjarry/aerc-devel/patches/54028 Reported-by: Robin Dapp <rdapp@modk.org> Reported-by: Ryan Winograd <ryan@thewinograds.com> Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* view-message: add option to view message in background tabAron Lebani2024-08-045-31/+52
| | | | | | | | | | | | | | | Add a -b flag to the :view command to open messages in a background tab instead of automatically switching to the new tab after opening. This is similar to opening browser tabs in the background. More generally, adds a new function app.NewBackgroundTab so that it is possible to enable other tabs to be opened in the background in the future. Implements: https://todo.sr.ht/~rjarry/aerc/266 Changelog-added: Add `-b` flag to the `:view` command to open messages in a background tab. Signed-off-by: Aron Lebani <aron@lebani.dev> Acked-by: Robin Jarry <robin@jarry.cc>