| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the parts switcher so it displays the file names first (if any)
and then the mime types. The mime types are aligned to the right to help
the file names to be more visible. If there is no file name - the mime
type is displayed on the left, as usual.
The idea is that the file name (if present) is more important than the
mime type. Especially when both file names and mime types are long -
this quickly becomes a mess.
If there is no space for both file name and mime, the mime type is
truncated with ellipsis. If there is no space for mime at all - it is
dropped completely. If then there is no space for the file name, it is
also truncated with ellipsis.
Signed-off-by: Vitaly Ovchinnikov <v@postbox.nz>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Inwit <inwit@sindominio.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When [compose].edit-headers=true and emptying a header in the text
editor (not deleting it, only deleting its contents), the operation is
ignored and the header is preserved as-is.
Delete the header after exiting the text editor if the header is empty
or not present. Make sure not to add empty headers.
Fixes: 11e5390fa0ac ("compose: implement embedded headers in editor")
Reported-by: Inwit <inwit@sindominio.net>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Inwit <inwit@sindominio.net>
|
|
|
|
|
|
|
|
|
|
| |
While notmuch mainly deals with messages and queries, adding either of
*maildir-store* or *maidlir-account-path* will give the impression that aerc
actually deals with files and folders under the notmuch interface. Clarify this
point to avoid confusions.
Signed-Off-By: inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoid failure when the styleset [viewer] section contains spaces:
~$ cat foo
[viewer]
url.fg = #ffffaf
url.underline = true
header.fg = #af87ff
signature.fg = #af87ff
diff_meta.fg = #ffffff
diff_meta.bold = true
diff_chunk.fg = #00cdcd
diff_add.fg = #00cd00
diff_del.fg = #cd0000
quote_1.fg = #5fafff
quote_2.fg = #ff8700
quote_3.fg = #af87ff
quote_4.fg = #ff5fd7
quote_x.fg = #808080
~$ ./colorize -s foo < bar.eml
error: invalid style attribute 'fg '
Be more restrictive with what characters are part of a style attribute.
Add test styleset with as much weirdness as possible. Update vectors
accordingly. Update sendemail-validate hook to export pedantic CFLAGS.
Reported-by: Tristan Partin <tristan@partin.io>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Tristan Partin <tristan@partin.io>
Tested-by: Tristan Partin <tristan@partin.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When using notmuch and changing labels, there is no reselection logic as
there is when using a :mv command for other backends. This results in
any label change that removes the message from the current query in
having no selection. Add some simple reselection logic in the Sort
callback so any call to Sort (which will refresh the message list)
ensures the previously selected message is still selected, and if it
isn't in the store anymore we select the same index of message as was
previously selected.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
| |
For proper thread ordering, notmuch needs to use a SORT_NEWEST_FIRST
sort order in it's query, and then we reverse the thread order. Also
give a maximum guess for size of slice we'll be returning.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
| |
Refactor SetFlag to be more readable by handling the special case of
SeenFlag in a cleaner way. If we invert the operation ('enable') instead
of invert the oldState, we can use the same logic for any tag.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
| |
Track the notmuch database state. When a state change is detected, query
if any changes affect the current query then send updates accordingly.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
| |
When using the notmuch backend, any modifications of labels changes the
UI to an unthreaded state. Don't send a fresh DirectoryContents, and
instead instruct the UI to fetch a new message list based on current
threading/sorting/filtering criteria.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
| |
Check for a canceled context when opening a directory with notmuch. The
OpenDirectory message carries a context tied to the directory lister -
checking for the context error can prevent us from opening a directory
that has already been deselected (even after the dirlist-delay period)
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The mbox worker uses the only reference to the datacounter object (see
previous commit where it was removed from 'postpone'). The counter
object in mbox is counting the size of the mbox message. Use io.Discard
and the result from the io.Copy call to set this size. This saves us
from writing to memory, since io.Discard will not store any of the
written bytes. It also removes the dependency on datacounter.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
| |
Remove the use of package datacounter and it's passthrough write
counter. We can directly get the quantity of bytes written to our buffer
with buf.Len()
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The directory selecting logic allows for a delay in issuing the command
to the backend. This delay is part of a goroutine which is supposed to
capture variables intended to be used in a callback to set the selected
directory. The callback does not capture the variable properly,
specifically the context and the "dirlist.selecting" value. This results
in contexts not being cancelled properly and incorrect selection logic.
The flow of the issue only occurs when the delay is sufficiently low:
1. The user scrolls rapidly through the directory list. Each time
passing over a directory, dirlist.selecting is set to that directory
and a context is created for this selection.
2. If the delay is low enough that the context was not cancelled before
the Action was posted, the worker could actually open this directory.
The captured context is actually referencing to the _current_ context
of the dirlist, and so even if this OpenDirectory Action makes it to
the worker, which might properly check to see if the context is
cancelled, it will be referring always to the current context and not
be cancelled.
3. When posting back the Done result, the callback is processed.
dirlist.selecting and the context are no longer referring to the
values used when this Action was made. The backend thinks it has
opened Directory A, but the callback sets the dirlist.selected to
Directory B
4. The account widget grabs the selected msgstore (Directory B, even
though the backend thinks its A). Sort messages are called, and all
sorts of things are sent to the backend which now is out of sync.
5. Eventually this all comes back into sync once the correct directory
has churned it's way through the worker and back to the account.
Move the callback into the dirlist.Update method to ensure proper
capture of all variables involved. Only reference the values set in the
message instead of those referring to the dirlist. This ensures that the
worker and UI are always in agreement for which directory is selected.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Koni Marti <koni.marti@gmail.com>
|
|
|
|
|
|
|
| |
The thread.go file hasn't been used for a long time. Remove it.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
| |
Replace the notmuch library used with our internal bindings.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
| |
aerc is using an unmaintained fork of a not-well-functioning notmuch
binding library. Add custom bindings directly into the aerc repo to make
them more maintainable and more customizable to our needs.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
{{.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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|