575 Commits

Author SHA1 Message Date
Robin Jarry
47ed279078 reload: trigger upon SIGHUP signal reception
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>
2025-09-08 12:25:42 +02:00
Moritz Poldrack
d9cd1f6338 doc: document msglist pill as scrollbar
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>
2025-08-28 09:55:36 +02:00
Erin John
f0769d3309 compose: read VISUAL before EDITOR
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>
2025-08-04 12:47:07 +02:00
Simon Martin
96ed6a9505 imap: add support for :modify-labels / :tag for gmail and proton
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>
2025-08-04 12:27:27 +02:00
Simon Martin
9a967f1795 imap: always use negotiated x-gm-ext-1 value
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>
2025-06-25 16:46:15 +02:00
Moritz Poldrack
4c294387d2 mark: make recipient switch target all recipients
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>
2025-06-20 09:36:52 +02:00
Jörg Thalheim
d9a1acf27a pipe: add support for piping messages in compose review mode
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>
2025-06-20 09:02:01 +02:00
inwit
7b841edb90 forward: allow cross-account forwarding
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>
2025-06-20 09:02:01 +02:00
Simon Martin
de2006bbd3 config: allow controlling whether :delete is allowed from any folder
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>
2025-06-11 10:12:16 +02:00
Simon Martin
2b6aeb5446 ui: allow message split viewer to automatically mark messages as read
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>
2025-06-11 10:12:16 +02:00
Simon Martin
6c33d979e7 menu: small usability improvements
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>
2025-05-21 18:29:00 +02:00
Moritz Poldrack
d442dcd42a docs: add missing -T to :unmark
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>
2025-05-12 13:24:00 +02:00
Moritz Poldrack
6baffcdae5 mark: add filter-based marking
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>
2025-05-12 13:22:03 +02:00
Simon Martin
8fc6ddd292 imap: support various provider policies for expunge calls
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>
2025-05-12 13:18:38 +02:00
Antonin Godard
caf717fc30 commands: add -u option to {next,prev}-folder
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>
2025-05-05 14:26:52 +02:00
Thorben Günther
f6d93737b0 reply: Check custom header for From address
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>
2025-05-05 13:49:07 +02:00
Karel Balej
5919e9dfda term: allow setting custom title for the terminal tab
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>
2025-05-05 13:49:04 +02:00
Karel Balej
f0ec95d7dd account: allow indicating new messages in the tab title
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>
2025-04-07 10:51:14 +02:00
Robin Jarry
d35e77d256 msglist: honor threading-by-subject when sort-thread-siblings is false
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>
2025-04-07 10:48:17 +02:00
Diederik de Haas
de15b7c794 ui: make flag values consistent lower case
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>
2025-03-30 23:12:39 +02:00
Vitaly Ovchinnikov
cce8245466 ui: allow multiple stylesets to be specified in styleset-name
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>
2025-03-30 23:09:46 +02:00
inwit
a6220d025a tag: allow to toggle tags
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>
2025-03-30 22:10:58 +02:00
Relma
f7340f765b man: add delete example
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>
2025-03-18 23:25:11 +01:00
Jakub Růžička
40381389b2 imap: increase connection-timeout to 90 seconds
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>
2025-03-05 17:33:58 +01:00
inwit
7712a212bf commands: add version command
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>
2025-02-20 23:09:47 +01:00
Karel Balej
dbe350a585 msgview: add copy-link command
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>
2025-02-06 13:59:24 +01:00
Robin Jarry
1203f92440 compose: only hide bindings explicitly identified
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>
2025-01-24 09:27:53 +01:00
Robin Jarry
928e5ae026 compose: only show default annotations if absent from config
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>
2025-01-23 22:32:42 +01:00
Robin Jarry
297795cce6 binds: preserve order from the config file
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>
2025-01-23 22:32:42 +01:00
Robin Jarry
4c7a22c179 composer: add flag to go directly to review screen
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>
2025-01-23 22:11:39 +01:00
Robin Jarry
7b5ec665fc stylesets: make default status line more readable
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>
2025-01-21 13:39:01 +01:00
Robin Jarry
4e545d45fa treewide: fix English spelling
Use codespell to fix typos in code, comments and man pages.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: inwit <inwit@sindominio.net>
2025-01-21 13:39:01 +01:00
Jelte Fennema-Nio
ae38305d2f reply: support multiple copy-to destinations
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>
2025-01-16 21:00:06 +01:00
Robert Günzler
d7954c2ba6 style: add back support for valid header patterns
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>
2025-01-16 20:55:16 +01:00
Robin Jarry
c48a9144b1 templates: add filters folders to exec path
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>
2025-01-14 21:48:24 +01:00
Robin Jarry
2ae8b13831 html: allow passing arguments to w3m
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>
2025-01-14 15:01:02 +01:00
Robin Jarry
fa0b99800e compose: differentiate between edit and review commands
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>
2025-01-14 15:00:56 +01:00
Robin Jarry
e50dbedc6a compose: disable {prev,next}-field on review screen
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>
2025-01-14 15:00:50 +01:00
Radim Krčmář
ac2e370581 reply: add -f flag to always include From header addresses
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>
2025-01-07 19:19:41 +01:00
Robin Jarry
0d37fd74ce filters: remove hard dependency on socksify
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>
2024-12-26 11:44:19 +01:00
Robin Jarry
56002158df expand,collapse: allow specifying folder name
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>
2024-12-21 17:02:31 +01:00
Matt Smith
baa0b698ef doc: fix some grammar in search docs
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>
2024-12-20 20:16:15 +01:00
Christoph Heiss
65dc87db62 style: allow specifying multiple headers on dynamic styles
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>
2024-12-19 16:43:18 +01:00
Christoph Heiss
a8bac8b75e docs: stylesets: fix typo in dynamic style section
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>
2024-12-19 16:43:18 +01:00
Robin Jarry
6512eb2e29 send: avoid leaking bcc addresses to all recipients
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>
2024-12-19 13:35:51 +01:00
Drew DeVault
1899b12cdc doc: fix typo in aerc-startup hook documentation
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>
2024-12-17 20:59:48 +01:00
Robin Jarry
5a119d7c64 viewer: allow filters to provide their own paging
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>
2024-12-05 10:57:11 +01:00
Markus Unkel
1a3b2b24eb composer: add focus-body option
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>
2024-11-10 18:08:40 +01:00
Koni Marti
9039eba68d import-mbox: unzip compressed mboxes
Unzip data when importing gzip compressed mbox files.

Suggested-by: diederich
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2024-11-09 18:48:19 +01:00
Koni Marti
e28feb5a70 import-mbox: enable url import
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>
2024-11-09 18:47:53 +01:00