| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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 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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
It wasn't previously apparent why the command failed.
Signed-off-by: Tristan Partin <tristan@partin.io>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
This was just a simple typo.
Signed-off-by: Tristan Partin <tristan@partin.io>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
Currently the only feedback we have from hooks is the error code. Log
STDOUT on loglevel TRACE and log STDERR on loglevel ERROR if the command
exists with an error.
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Include the ATTENDEE and DETAILED LIST section in the calendar filter's
output only if there are actually attendees to list. I was especially
confused by the empty DETAILED LIST, as it wasn't clear which kind of
detail it was supposed to list (and it also looked a bit like a heading
for the description following immediately below), see e.g. the test
output in filters/vectors/calendar-invite.expected.
Fixes: 777bbb77e806 ("contrib: improve readability of meeting requests")
Changelog-fixed: Builtin `calendar` filter shows empty attendee list.
Signed-off-by: Timon Reinold <tirei+aerc@agon.one>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The builtin "calendar" filter is written in the Awk language, for which
multiple interpreters exist. The most common is probably GNU Awk (aka
"gawk"), which also implements some features that other interpreters do
not support. That means that the calendar filter could run fine in
gawk, but fail in another interpreter (compare e.g. commit a604acceac0f
"calendar: fix error with non-gnu awk").
Using the "-W posix" option, gawk can be put into a POSIX-compatibility
mode, which attempts to stay as close as possible to the POSIX-specified
version of Awk, which should then hopefully also be supported by other
Awk interpreters. Running the filter's tests using "gawk -W posix"
should help identify potential incompatibilities with other
interpreters.
Other interpreters also support "-W posix" (e.g. mawk, or ignore it like
busybox awk). Using "awk -W posix" allows these to be used as well. If
"-W posix" causes the interpreter to fail, skip this test.
This new test in POSIX-compatibility mode runs in addition the existing
test, which directly executes the filter, using the Awk interpreter's
default mode ("-W posix" cannot just be added to the filter's shebang
line, as only a single argument may be supported, and "-f" is also
needed). The later is the mode most users will actually be using, so I
don't want to remove that test.
I'm not doing this for the other Awk-filters (hldiff and plaintext), as
they have ben obsoleted by the colorize filter. Besides, they don't
have any test vectors.
Signed-off-by: Timon Reinold <tirei+aerc@agon.one>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a test vector for the builtin "calendar" filter. Use the filter's
current output as expected output.
My aim is mostly just to run the calendar filter during "make tests",
this vector doesn't necessarily cover the most interesting sections of
its code. But at least running the filter once on what could be a
common input (a meeting PUBLISH) and checking that its output matches
what was expected should still be better than testing nothing.
Previously, only compiled filters were tested. Testing the calendar
filter (which is interpreted, not compiled) necessitated two changes:
* Compilation output goes into the project root (filters/test.sh:
"$here/../"), but the source code to interpret is in the filters/
subdirectory (filters/test.sh: "$here"/). The executable to invoke is
thus in a different location.
* .builds/alpine-edge.yml uses $FILTERS_TEST_PREFIX to wrap filters in
valgrind, to check that filters written in e.g C don't leak memory.
But for the calendar filter, that would check that the Awk interpreter
doesn't leak memory, failing the test for at least gawk, mawk and
busybox awk. Thus, a $FILTERS_TEST_BIN_PREFIX variable is introduced,
which only applies to binary filters.
Signed-off-by: Timon Reinold <tirei+aerc@agon.one>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
| |
Print "error" instead of "ok" also if the filter (or the
$FILTERS_TEST_PREFIX, i.e. valgrind) failed, not just if its output is
unexpected. Also include that exist status in the error message.
Signed-off-by: Timon Reinold <tirei+aerc@agon.one>
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Indicate the connection state in the tab title.
Example [ui].tab-title-account option in aerc.conf:
tab-title-account= {{if .Connected}}{{.Account}}✓{{else}}{{.Account}}✗{{end}}
Suggested-by: inwit <inwit@sindominio.net>
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Gregory Anders <greg@gpanders.com>
Tested-by: Inwit <inwit@sindominio.net>
Reviewed-by: Tristan Partin <tristan@partin.io>
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>
|