When receiving the SIGHUP signal, reload all configuration.
Changelog-added: `:reload` is now invoked when `SIGHUP` is received
by the `aerc` process.
Suggested-by: Anachron <gith@cron.world>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Since pill is ambiguous and an uncommon name for it, mention that the
pill is what is commonly referred to as a scrollbar in the
documentation.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
Historically UNIX programs read VISUAL before EDITOR. The former
is to be set to a screen editor like 'vi' and the latter to a line
editor like 'ed'.
Aerc should correctly read VISUAL first if both are defined.
Signed-off-by: Erin John <unrealapex@disroot.org>
Acked-by: Robin Jarry <robin@jarry.cc>
As part of my effort to properly support labels in IMAP for providers
that have this notion, this patch takes care of the case of GMail and
Proton, and gracefully errors for all others.
To do so, it detects the actual provider we're connected to by analyzing
the target URL, and implements label addition / removal (toggling is not
supported right now [1]) according to the documentation:
- For GMail, it leverages the IMAP STORE command.
- For Proton, it leverages moving the message across (virtual) folders.
[1] There's nothing fundamental preventing supporting toggling, but
getting the current "label state" from there in the code is not trivial.
It could be done in a second step if there's demand).
Changelog-added: Support :modify-labels command for GMail and Proton.
Signed-off-by: Simon Martin <simon@nasilyan.com>
Tested-by: Jan Černohorský <jan@grsc.cz>
Reviewed-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
While it negotiates the X-GM-EXT-1 capability with GMail, aerc defaults
to not using it because the use-gmail-ext configuration knob defaults to
false.
This patch simply dismantles that knob, so that GMail users always
benefit from all its capabilities.
Changelog-added: Always use `X-GM-EXT-1` extension if negotiated
with GMail.
Signed-off-by: Simon Martin <simon@nasilyan.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Contrary to popular belief, not all recipients of a mail are listed in
it's To: header. They may also be included in the Cc: or Bcc: headers.
Include them in the list when filtering.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
Allow piping composed messages that are about to be sent in the compose
review mode. This enables users to process or inspect messages before
sending them.
Update documentation to reflect this new capability.
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
Acked-by: Robin Jarry <robin@jarry.cc>
When forwarding an email using edit-headers=true, using :switch-account
alone is not enough to properly switch the account since you have to
change the From header manually. Add the -x [account] option to :forward
in order to switch the account before opening the composer, to remove
this friction when we already know we want to forward with a different
account.
Changelog-added: Forward with a different account than the current
one with `:forward -x <account>`.
Signed-off-by: inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
It's currently possible to delete mails (*not* move to Trash) from any
folder. What a delete action does depends on the mail client, and it is
often synonymous to "Move to trash", and aerc's behaviour can surprise
users (who will find out too late, when their mail is gone forever...).
This patch adds a configuration setting to control whether deletes are
allowed from any folder, or are restricted to the Trash and Junk
folders.
Signed-off-by: Simon Martin <simon@nasilyan.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Users can specify that messages should be marked as read when they're
viewed, but not when they're previewed in a message list split.
This patch makes it possible via two configuration knobs: one stating
whether the split message viewer should mark messages as read (off by
default), and one specifying the delay after which to do it.
Fixes: https://todo.sr.ht/~rjarry/aerc/126
Signed-off-by: Simon Martin <simon@nasilyan.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Following up on the great discussion on IRC and in patch #59448, improve
the usability of the ":menu" command, namely:
- Add the possibility to override the dialog title, that defaults to the
actual command, for instance "-cf -a ...".
- Select the first matching row, so that the user can simply type enter
if it actually matches what they're looking for. In passing, also fix
a bug whereby if the user had selected a matching row and then updates
the filter so that that row does *not* match anymore (e.g. the filter
was box, matching INBOX, and is updated to boxnono), the box would
still remember that row's value (and give it if the user typed Enter,
even though nothing was matching the filter).
Make "<C-g> = :menu -d -t "Open folder" :cf<Enter>" behave exactly like
Sublime or VS Code, and improve aerc usability a lot for mailboxes with
many folders.
Signed-off-by: Simon Martin <simon@nasilyan.com>
Acked-by: Robin Jarry <robin@jarry.cc>
The -T flag has been omitted from the documentation of :unmark. This
commit adds the documentation for this flag to the :unmark command.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Tested-by: inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
Expand the :mark command with the ability to combine it with filters to
automatically mark all messages matching a filter. The filters can be
combined with -t and -T to narrow down the selected messages:
:mark Delivered # mark all messages with "Delivered" in the Subject
:mark -s amazon # mark all messages from "amazon"
:unmark invoice # unmark all messages with "invoice" in the subject
Changelog-added: Support for marking multiple messages based on
filters.
Changelog-deprecated: Support for go 1.22.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Tested-by: inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
To delete N messages, aerc issues a single EXPUNGE command to the IMAP
server. The server sends back one ExpungeUpdate for each of those N
messages, and aerc reacts to each to update the folder contents.
Unfortunately, the RFC does not specify the order in which a conforming
server should send those "individual replies". aerc currently implicitly
assumes that it deletes messages in increasing sequence number order
(what GMail or FastMail do), and deleting N>1 messages will generally
not work for servers that use a different policy (e.g. Office 365 or
WorkMail, among others).
This patch implements an automatic detection of the policy used by the
server and adapts to it. Since some servers use a policy that can
confuse the automatic detection (e.g. WorkMail that deletes in random
order), it's also possible to statically configure that policy in
accounts.conf if needed.
Fixes: 80408384 ("handle outdated sequence numbers from server [...]")
Signed-off-by: Simon Martin <simon@nasilyan.com>
Tested-by: Karel Balej <balejk@matfyz.cz>
Acked-by: Robin Jarry <robin@jarry.cc>
Add the "-u" option to the :next-folder and :prev-folder commands, used
to jump to the next or the previous folder that contains at least one
unseen email.
For directory trees, we have to factor in that the number of currently
visible folders may be lower than the total number of folders, so count
that in visibleDirsCount().
I find the following bindings useful:
<A-j> = :next-folder -u<Enter>
<A-k> = :prev-folder -u<Enter>
It allows jumping between folders efficiently while keeping the ability
to jump to the next or previous folder normally.
References: https://todo.sr.ht/~rjarry/aerc/168
Changelog-added: Add the -u option to :next-folder and :prev-folder
commands to cycle between folders that contain unseen messages.
Signed-off-by: Antonin Godard <antonin@godard.cc>
Acked-by: Robin Jarry <robin@jarry.cc>
In some cases no RFC822 header will contain the correct alias address.
One such example is a mailing list where the recipient address is only
an alias to the configured "from" address.
For instance Postfix offers the "X-Original-To" header [1].
[1]: https://www.postfix.org/postconf.5.html
Signed-off-by: Thorben Günther <admin@xenrox.net>
Acked-by: Robin Jarry <robin@jarry.cc>
Add a template for the terminal tab title and define two
terminal-specific properties: Title which expands to whatever the
underlying application requests via OSC and defaults to the command name
and Bell which is a boolean indicating whether the application has
emitted bell, the flag is cleared when the corresponding tab gains focus
and is not set at all if it currently has it.
This can among other things be used to highlight the terminal tab when
the underlying process prints the bell, such as by setting the template
as such:
tab-title-terminal={{if .Bell}}[BELL] {{end}}{{.Title}}
Implements: https://todo.sr.ht/~rjarry/aerc/138
Changelog-added: A tab-title-terminal setting for customizing the
title of tabs in which the terminal widget is run.
Requested-by: Drew DeVault <drew@ddevault.org>
Signed-off-by: Karel Balej <balejk@matfyz.cz>
Acked-by: Robin Jarry <robin@jarry.cc>
Add a flag to indicate whether the account has received new messages
since it last had focus and allow its use in the templates.
Changelog-added: A `.HasNew` flag indicating whether the account has
received new messages to be used in the templates.
Signed-off-by: Karel Balej <balejk@matfyz.cz>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
When sort-thread-siblings = false and threading-by-subject = true, do
not order siblings by ascending UID. Instead, use the message Subject
headers to order siblings.
Changelog-changed: Thread siblings will now be ordered by subject if
`[ui].sort-thread-siblings = false` and `[ui].threading-by-subject
= true`.
Reported-by: Brendan Jackman <jackmanb@google.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Brendan Jackman <jackmanb@google.com>
When doing `:flag -x` the various flags are shown in all lower case,
but when doing `:search -x` the various flags had their first letter
in upper case.
Make the flags values consistent by making them all lowercase.
Changelog-changed: `:search -x <flag>` now requires lower-case flag
values consistently with `:flag -x <flag>`.
Signed-off-by: Diederik de Haas <didi.debian@cknow.org>
Acked-by: Robin Jarry <robin@jarry.cc>
The patch allows to highlight messages in specific accounts without
affecting the others.
Without the patch you need to copy the whole styleset, add the
highlighting commands, then use that styleset with that specific
account.
With the patch you can make a small styleset with just the highlighting
stuff and chain it up to the main styleset this way:
styleset-name: main
[ui:account=special]
styleset-name: main,highlight
Changelog-added: Stylesets can be chained-up in `styleset-name`
config parameter using comma-separated format.
Signed-off-by: Vitaly Ovchinnikov <v@ovch.ru>
Acked-by: Robin Jarry <robin@jarry.cc>
So far, the :tag command in the notmuch and jmap workers allows adding a
tag (by prefixing it with '+') and removing it (by prefixing it with
'-'). Add a new functionality to this command, allowing it to toggle a
tag by prefixing it with '!'.
Fixes: https://todo.sr.ht/~rjarry/aerc/292
Changelog-added: It is now possible to toggle notmuch and JMAP tags.
Signed-off-by: inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
Add an example in aerc-binds(5) for moving messages to a Trash folder
instead of deleting them.
And another example for actually deleting messages when they are in
the Trash or Spam folders.
Suggested-by: Robin Jarry <robin@jarry.cc>
Signed-off-by: Relma <relma2@fastmail.com>
Reviewed-by: Moritz Poldrack <moritz@poldrack.dev>
In case when the server does not support IDLE command, then default
value of the polling interval set in go-imap to 60 seconds is larger
then the default value of connection-timeout set to 30 seconds.
Therefore aerc disconnects while polling every 30 seconds, because there
is no activity.
This was tested on seznam.cz as well as a self hosted dovecot, where the
IDLE command was removed from announced capabilities.
Changelog-fixed: IMAP servers without IDLE support do not timeout
while polling.
Changelog-changed: The default IMAP connection timeout has been
increased to 90 seconds.
Signed-off-by: Jakub Růžička <jakub.ruzicka@matfyz.cz>
Tested-by: Karel Balej <balejk@matfyz.cz>
Acked-by: Robin Jarry <robin@jarry.cc>
Sometimes it might be useful to know the version of the running
instance. This is currently possible with templates (`:echo {{version}}`
does the trick), but it seems clearer to have a dedicated command.
Implement such command.
Changelog-added: New `:version` command shows the version of the
running instance of aerc in the statusbar.
Signed-off-by: inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
Add a command to copy links to the system clipboard. This can be useful
for instance when the URL should be handled in some other way than
opened (e. g. resent via some other communication channel or saved to a
file). It also improves security for situations where it's not desirable
for the URL to be visible on the process command line, such as when it
contains sensitive information such as an access token.
Adapted from open-link.
Changelog-added: If supported by the terminal, links from a message
can now be copied to the system clipboard with the :copy-link command
of the message viewer.
Signed-off-by: Karel Balej <balejk@matfyz.cz>
Acked-by: Robin Jarry <robin@jarry.cc>
My boolean fu was too weak. Even if default bindings annotations are
removed, they will be forcibly restored.
I was made aware that this behaviour was preferable compared to simply
make them disappear without warning.
Add a special "-" annotation to explicitly exclude bindings from the
review screen.
If a binding has no annotation at all, still display it without
annotation, just with its command.
Fixes: 928e5ae026 ("compose: only show default annotations if absent from config")
Changelog-changed: It is now possible to explicitly hide key bindings
from the compose review screen by using a special ` # -` annotation.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Skejg <grolleman@zoho.com>
Currently, it is impossible to "hide" bindings presented on the review
screen even if removing the annotations from binds.conf.
If the configuration contains any annotated bindings, completely ignore
all of the default annotations.
Only display bindings from the config that are both present and
annotated.
Fixes: 64502d9e8b ("compose: show annotations on the review screen")
Changelog-changed: Key bindings available on the compose review screen
are now only displayed if they are annotated with a comment. If
no binding is annotated in `[compose::review]`, then the default
annotations will be used as a fallback to avoid displaying a blank
screen.
Reported-by: Skejg <grolleman@zoho.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Inwit <inwit@sindominio.net>
Parse binds.conf and fill in the bindings list preserving the order as
it is in the file.
Disable sorting of the review commands as they should now be displayed
in their original order.
Changelog-changed: Key bindings in the compose review screen
are now displayed in the order in which they are defined in the
`[compose::review]` section of `binds.conf`.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Inwit <inwit@sindominio.net>
Add a new -s flag to skip opening the text editor and go directly to the
review screen for all commands that open a new composer widget.
Implements: https://todo.sr.ht/~rjarry/aerc/296
Changelog-added: All commands that involve composing messages
(`:compose`, `:reply`, `:recall`, `:unsubscribe` and `:forward`) now
have a new `-s` flag to skip opening the text editor and go directly
to the review screen. Previously, this flag was restricted to calendar
invitations response commands (`:accept`, `:accept-tentative` and
`:decline`).
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Inwit <inwit@sindominio.net>
Error, success and warning messages are dimmed as well making them
unreadable on that light gray background.
Remove the gray background for the status line. Make error, success and
warning messages more visible by using bright colors, disabling dimmed
and enabling bold attributes.
Changelog-changed: The `default` styleset status line background has
been reset to the default color (light or dark, depending on your
terminal color scheme) in order to make error, warning or success
messages more readable.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Karel Balej <balejk@matfyz.cz>
In some setups it is useful to copy an email to multiple destinations,
e.g. to automatically put sent emails in a folder with "interesting"
emails. This allows doing so.
Changelog-added: `copy-to` now supports multiple destination folders.
Signed-off-by: Jelte Fennema-Nio <aerc@jeltef.nl>
Acked-by: Robin Jarry <robin@jarry.cc>
Since commit 65dc87db62 ("style: allow specifying multiple headers on
dynamic styles") the regex for picking up dynamic header patterns would
split on occurences of '.', thus preventing regexes like shown in the
test case to be used for matching messages.
Introduce `~/<pattern>/` as a way to wrap such expressions.
Fixes: 65dc87db62 ("style: allow specifying multiple headers on dynamic styles")
Signed-off-by: Robert Günzler <r@gnzler.io>
Acked-by: Robin Jarry <robin@jarry.cc>
Add the filters folders to the exec search path when calling the "exec"
template function. This is to allow executing filters by name.
Changelog-changed: The templates `exec` commands is now executed with
the `filters` exec `$PATH` similar to filter commands.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Bence Ferdinandy <bence@ferdinandy.com>
Append all arguments passed to the html builtin filter to the generated
w3m command.
Terminal emulators all have different image display capabilities. We
cannot know in advance which image protocol to use (if any).
Changelog-changed: The builtin `html` and `html-unsafe` filters can
now take additional arguments that will be passed to `w3m`. This can
be used to enable inline images when viewing `text/html` parts (e.g.:
`text/html = ! html-unsafe -sixel`).
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
Split the compose commands into two categories: edit and review. Some
commands can belong to both categories and be available whether the text
editor or the review screen is visible.
Update man page to reflect that. Remove duplicate (and misplaced) :save
command from the COMPOSE section.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
It is currently possible to focus the various header editors while on
the compose::review screen but it is impossible to actually change their
value.
Prevent the focus from even occurring and return an explicit error
message to make it explicit that :next-field and :prev-field only work
when the text editor is visible and [compose].edit-headers = false.
Also, to avoid any ambiguity, prevent any text input from being focused
unless the text editor is visible. This effectively prevents the cursor
from being displayed.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
A badly implemented mailing list sets itself as Reply-To, which means
that the original sender currently gets dropped.
Add -f flag that sends reply to both From and Reply-to sets of
addresses. Sending to both is allowed in the mail RFCs, so this flag
can be safely used for all mail.
Changelog-added: Reply to addresses in `From` and `Reply-To` headers
with `:reply -f`.
Signed-off-by: Radim Krčmář <radim@krcmar.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
Use the more common unshare from util-linux if available. Otherwise try
to fallback on socksify if installed. If both failed, force use an
invalid http proxy so that the rendering cannot access the network.
Make the html-unsafe filter a symlink to html only disabling network
isolation.
Use cp -af to install filters in order to preserve symlinks. install
cannot do that.
Changelog-changed: The `html` filter is now enabled by default, making
`w3m` a weak runtime dependency. If it is not installed, viewing HTML
emails will fail with an explicit error.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Johannes Thyssen Tishman <johannes@thyssentishman.com>
In addition of expanding collapsing the currently selected folder with
no argument, allow specifying a folder name.
Changelog-added: `:expand-folder` and `:collapse-folder` can now act
on a non selected folder.
Suggested-by: Drew Devault <sir@cmpwn.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Inwit <inwit@sindominio.net>
This fixes a few issues in the search docs to sound more natural to
english speakers.
Signed-off-by: Matt Smith <matt@xtaz.co.uk>
Acked-by: Robin Jarry <robin@jarry.cc>
Change the `Style` struct to hold a map of header -> pattern mappings
instead of a single pair. Must all match for a style to be applied,
effectively implementing an AND condition.
Technically, this actually changes the matching from O(n) to O(n*m), `n`
being the number of styleset entries and `m` the number of
(user-specified) header patterns.
Realistically, in most cases m == 1 will hold true anyway and more than
2-3 header patterns will not be used in practice much either -- so this
is fine.
Update man pages accordingly. Mention the ordering-sensitive property of
the matching.
Add unit tests to ensure it works as expected.
Changelog-added: Dynamic message list style can now match on multiple
email headers.
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
Acked-by: Robin Jarry <robin@jarry.cc>
Fix a subtle typo in aerc-stylesets(5) -- should read "[..] in its
subject", not "[..] it its subject".
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
Acked-by: Robin Jarry <robin@jarry.cc>
Depending on the provider/backend which is sending the email, the Bcc
headers may or may not be stripped. Make sure to remove them from aerc
before sending (and optionally copying) the message.
Add an accounts.conf option to preserve them if needed.
Fixes: https://todo.sr.ht/~rjarry/aerc/283
Changelog-fixed: Some SMTP servers do not strip `Bcc` headers. aerc
now removes them before sending emails to avoid leaking private
information. A new `strip-bcc = false` option can be used in
`accounts.conf` to revert to previous behaviour (preserve _Bcc_
headers in outgoing messages).
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Diederik de Haas <didi.debian@cknow.org>
It seems like this was erroneously copied and pasted from the following
hook's documentation.
Fixes: f10b184eb3 ("hooks: add aerc-startup hook")
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Allow filter commands to declare that they will provide their own paging
functionality. To do so, a filter command must start with an exclamation
mark "!". For example:
text/html = ! w3m -I UTF-8 -T text/html
This will effectively run w3m as the main process running in the
embedded terminal of the part viewer. It will provide interactive access
to w3m and will effectively allow navigating using w3m paging and
coloring.
Implements: https://todo.sr.ht/~rjarry/aerc/250
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Inwit <inwit@sindominio.net>
When the composer window opens, an user might want to start writing
the email body before adding a subject and recipients. Setting the
focus-body option to true achieves that by setting the focus to the
editor.
Signed-off-by: Markus Unkel <markus@unkel.io>
Acked-by: Robin Jarry <robin@jarry.cc>
Enable the :import-mbox command to also import data from an URL.
Changelog-added: `:import-mbox` can now import data from an URL.
Suggested-by: Matěj Cepl <mcepl@cepl.eu>
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>