| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use go-opt v2 new completion API which returns items descriptions along
with their text values.
Display the descriptions after the items separated by two spaces. Wrap
the descriptions in parentheses to better indicate that they are not
part of the completion choices. Limit the description length to 80
characters to avoid display issues.
Add a new style object completion_description in stylesets. By default,
the object will be rendered with a dimmed terminal attribute. Update all
stylesets and documentation accordingly.
Implements: https://todo.sr.ht/~rjarry/aerc/271
Link: https://git.sr.ht/~rjarry/go-opt/commit/ebeb82538395a
Changelog-added: Command completion now displays descriptions next
to completion items.
Changelog-added: New `completion_description` style object in style
sets used for rendering completion item descriptions.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bojan Gabric <bojan@bojangabric.com>
Tested-by: Jason Cox <me@jasoncarloscox.com>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ensure that search queries containing tags from exclude-tags actually
return messages by treating STATUS_IGNORED as an informational message
rather than an error.
For example, this covers the use-case where spam messages are ignored by
default (exclude-tags = spam) and having a dedicated qmap entry allowing
review of the possible spam messages: spam = tag:spam.
Changelog-fixed: Notmuch searches which explicitly contain tags from
`exclude-tags` now return messages.
Signed-off-by: Michael Adler <michael.adler.oss@mailbox.org>
Tested-by: Jason Cox <me@jasoncarloscox.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently if `aerc mbox:..` is used on the command line with an invalid
URL schema such as `aerc mbox:~/mbox`, it tries to open "nothing" and
fails, instead of letting the user know that the URL scheme (command
usage) is wrong.
This commit silently handles such wrong URL schemes.
Fixes: https://todo.sr.ht/~rjarry/aerc/281
Signed-off-by: Syed Fasiuddin <syed.fasiuddin@icloud.com>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
Tested-by: Koni Marti <koni.marti@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
This was just a simple typo.
Signed-off-by: Tristan Partin <tristan@partin.io>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add an extension flag to the search/filter command which will provide
different completion strategies for the search terms and instruct the
backend to use custom extensions (such as X-GM-EXT-1) if available.
The following examples are based on the Gmail extension (note that this
should be enabled in your accounts.conf with 'use-gmail-ext=true'):
:filter -e filename:pdf from:bob
:filter -e has:attachment newer_than:2d
:search -e is:read is:starred
:search -e list:~rjarry/aerc-devel@lists.sr.ht
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
| |
Expose the supported extensions in the capabilities.
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extend the IMAP SEARCH command with the X-GM-RAW attribute for full
Gmail search syntax. It is based on the Gmail extension (X-GM-EXT-1).
The search/filter command will be interpreted in the same manner as in
the Gmail web interface.
Link: https://support.google.com/mail/answer/7190?hl=en
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
| |
Add a new copy-to-replied setting in accounts.conf to copy sent replies
to the same folder than their replied message.
Requested-by: Tristan Partin <tristan@partin.io>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Tristan Partin <tristan@partin.io>
|
|
|
|
|
|
|
|
|
|
| |
Fetch an email's entire thread in the JMAP backend.
Changelog-added: Fetch entire threads in the JMAP backend.
Signed-off-by: Tristan Partin <tristan@partin.io>
Tested-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A Done event was sent from the worker to the UI unconditionally, so even
if the deletion operation failed, the UI showed a "N messages deleted"
confirmation.
When no messages are deleted, don't send the done event. Given that the
same function already sends an error in case of any failures, this error
is what remains visible in the status bar.
Signed-off-by: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function first queried the notmuch database for a single filename
(arbitrarily chosen), and then queried the database for all filenames of
the same message.
Drop one unnecessary query; only query all names, and then use the first
one as an arbitrarily chosen one.
Signed-off-by: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When changing the tag/label of a message we refresh all messages that
were modified since the start of the transaction.
To that end we add "lastmod before..now" to the current query without
any conjunction. That would make us re-index basically all messages.
This patch wraps the existing query in parentheses and
ANDs it with "lastmod" instead which greatly speeds up the process.
Signed-off-by: Robin Dapp <rdapp@modk.org>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When an error occurs initialising a watcher, the error shown is
completely unclear (e.g.: "no such file or directory").
Clarify the error so that its source is clear and log the path
that was used.
Signed-off-by: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a notmuch query result was shown and any message changes (e.g.: was
marked as read, deleted, flagged, etc) the entire result set was
reloaded from disk. This included querying the notmuch for paths for
each file individually and then reading headers from each file one by
one.
If the current view was a query-map with 4000 results, then marking a
single message as read resulted in 4000 files being read from disk.
When a change is detected in the database, instead of sending an
individual MessageInfo event for each message in the result set, send a
single DirectoryContents event. The UI code will remove from view any
messages that no longer exist, add new ones and request from the worker
any data that may be required (this data will be lazy-fetched).
This results in a dramatic performance improvement when reading messages
from a query-map result. Previously reading a single message would
result in about 2 minutes of CPU at 150% (on a i7-13700K). With this
patch, the same operation uses less than 5% CPU for less than 2 seconds.
Signed-off-by: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
| |
If a session is found in the cache, check that it works by issuing
a GetIdentities request. If that request fails, invalidate the cache and
go through the authentication.
Ensure that the session is valid and explicitly fail if it is not.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoid eternal spinner on the message list when the imap server
advertises some message UIDs but fails to provide their headers when
aerc asks from them.
When an error occurs, or if some UIDs are not returned, make sure to
report the errors to the message list UI.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Tristan Partin <tristan@partin.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commits:
9e93d9efdb88 ("jmap: fix go static check failure")
0465509eedad ("jmap: skip Email/get call if no emails to get")
9f97c698e3dd ("jmap: fetch entire threads")
Issues have been reported about disappearing sent messages.
Reported-by: Tristan Partin <tristan@partin.io>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tristan Partin <tristan@partin.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
If no match were found in the References and In-Reply-To headers,
allow threading by looking at subjects.
This behaviour is disabled by default. Add a setting to enable it.
Changelog-added: Allow fallback to threading by subject with
`[ui].threading-by-subject`.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Matěj Cepl <mcepl@cepl.eu>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Show all threading associations even when not all nodes are present.
Indicate if a thread is incomplete, i.e. misses a direct parent node.
Use the `msglist_thread_orphan.fg=red` styleobject in your stylesheet to
indicate whether a messsage has a missing parent.
Also use a different thread prefix ("┬─" instead of "├─") not to confuse
them with regular threads that have a visible parent.
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Matěj Cepl <mcepl@cepl.eu>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, when using :query the user is forced to create a new folder
for every query, since aerc doesn't allow overwriting an existing
folder. Actually, "overwriting" an existing folder with a query is
a non-destructive operation in the sense, that the underlying maildir is
not touched, the only thing lost is the state in aerc. The current
behaviour doesn't allow for a simple `:query -n query ` type of binding.
Allow overwriting an existing folder with the -f flag.
Changelog-added: Allow using existing directory name with `:query -f`.
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since the update to go-jmap 0.5.0, the IsAscending property is now taken
into account even if it is false.
The initial JMAP implementation wrongfully assumed the behaviour and
inverted the sort -r logic. Fix that so that messages are ordered as
expected.
Link: https://git.sr.ht/~rockorager/go-jmap/commit/1db959676c10398a8
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
| |
No need to send a JMAP request if there are no object to fetch.
Signed-off-by: Tristan Partin <tristan@partin.io>
Acked-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
| |
The missing variable was being set but unused.
Fixes: 9f97c698e3dd ("jmap: fetch entire threads")
Signed-off-by: Tristan Partin <tristan@partin.io>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
| |
A v1 got committed when a v2 existed.
Fixes: f9113810cc6c ("jmap: invalidate cache if mailbox state is not consistent")
Signed-off-by: Tristan Partin <tristan@partin.io>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
| |
JMAP was missing good thread support, especially when compared to Gmail.
This will fetch entire threads when possible.
Signed-off-by: Tristan Partin <tristan@partin.io>
|
|
|
|
|
|
|
|
|
| |
We weren't checking if the cached state was the same as the remote state
before reading it. This led to aerc not knowing about new mailboxes on
the remote.
Signed-off-by: Tristan Partin <tristan@partin.io>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix a nil pointer dereference panic in connect when trying to obtain the
folder delimiter. There is a List call to the imap server that in some
instances can return a nil *imap.MailboxInfo that is not checked before
it is dereferenced.
Link: https://lists.sr.ht/~rjarry/aerc-devel/%3CEDE672E5-3F6F-402D-B1A4-5477183FC13C@ukr.net%3E
Reported-by: Misha <ulianich_mihail@ukr.net>
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Reviewed-by: Tim Culverhouse <tim@tim.culverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When connecting through environments bypassing hostnames, like SSH
tunnels, the certificate verification of the server will fail, making it
impossible to connect, if plain IMAP has been disabled.
Add handling for the insecure modifier to the imaps connection.
Changelog-added: Add `imaps+insecure` to the available protocols, for
connections that should ignore issues with certificate verification.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
| |
The current implementation assumes that 'root[0].FirstChild' is nil, but
this is not always the case. Instead of overwriting the FirstChild,
detect and link the messages to the LastChild of root[0].
Fixes: 672b4edca7af ("notmuch: draw incomplete threads")
Signed-off-by: Julio B <julio.bacel@gmail.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
| |
These messages are not really the root of the thread, and should not be
displayed as such. Add a new special prefix to make them appear like
the first child of a rootless thread.
Signed-off-by: Julio B <julio.bacel@gmail.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
| |
Create a "pseudo thread" with the first message as root. This is a
temporary solution, until we have a more generic implementation of dummy
messages that works for all backends.
Signed-off-by: Julio B <julio.bacel@gmail.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A single notmuch message can represent multiple files. As a result,
file-based operations like move, copy, and delete can be ambiguous. Add
a new account config option, multi-file-strategy, to tell aerc how to
handle these ambiguous cases. Also add options to relevant commands to
set the multi-file strategy on a per-invocation basis.
If no multi-file strategy is set, refuse to take file-based actions on
multi-file messages. This default behavior is mostly the same as aerc's
previous behavior, but a bit stricter in some cases which previously
tried to be smart about multi-file operations (e.g., move and delete).
Applying multi-file strategies to cross-account copy and move operations
is not implemented. These operations will proceed as they have in the
past -- aerc will copy/move a single file. However, for cross-account
move operations, aerc will refuse to delete multiple files to prevent
data loss as not all of the files are added to the destination account.
See the changes to aerc-notmuch(5) for details on the currently
supported multi-file strategies.
Changelog-added: Tell aerc how to handle file-based operations
on multi-file notmuch messages with the account config option
`multi-file-strategy` and the `-m` flag to `:archive`, `:copy`,
`:delete`, and `:move`.
Signed-off-by: Jason Cox <me@jasoncarloscox.com>
Tested-by: Maarten Aertsen <maarten@nlnetlabs.nl>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
| |
Delete the existing file from the database after indexing the new one to
avoid the need to remember and re-apply tags.
Signed-off-by: Jason Cox <me@jasoncarloscox.com>
Tested-by: Maarten Aertsen <maarten@nlnetlabs.nl>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to the comments in notmuch.h, removing a file returns
NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID when the "filename was removed but
the message persists in the database with at least one other filename."
Based on the fact that the db.DeleteMessage() function is used in a
context that explicitly recognizes the possibility of multiple files and
only attempts to delete one of them, I'm fairly certain that the
existing behavior of ignoring all errors *except* the deplicate message
ID error is the result of a typo. (It also doesn't make sense to ignore
other errors, such as NOTMUCH_STATUS_XAPIAN_EXCEPTION.)
Cc: Tim Culverhouse <tim@timculverhouse.com>
Signed-off-by: Jason Cox <me@jasoncarloscox.com>
Tested-by: Maarten Aertsen <maarten@nlnetlabs.nl>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
| |
Initialize info in SearchMessage irregardless of the message parts
flags otherwise it will crash when we attempt to read it in the next
switch statement.
Fixes: 8464b3738 ("search: use a common api for all workers")
Signed-off-by: jp39 <jp39@gmx.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|