AERC(1) | General Commands Manual | AERC(1) |
NAME¶
aerc - a pretty good email client.
SYNOPSIS¶
aerc [-h] [-v] [-a <name>] [-C <file>] [-A <file>] [-B <file>] [-I] [mailto:<...> | mbox:<file> | :<command...>]
For a guided tutorial, use :help tutorial from aerc, or man aerc-tutorial from your terminal.
OPTIONS¶
-h, --help
-v, --version
-a <name>
--account <name>
-C </path/to/aerc.conf>
--aerc-conf </path/to/aerc.conf>
-A </path/to/accounts.conf>
--accounts-conf </path/to/accounts.conf>
-B </path/to/binds.conf>
--binds-conf </path/to/binds.conf>
-I, --no-ipc
mailto:address[,address][?query[&query]]
If aerc is already running (and IPC is not disabled), the composer is started in that instance; otherwise a new instance is started with the composer.
The following (optional) query parameters are supported:
Query | Description |
subject=<text> | Subject line will be completed with the <text> |
body=<text> | Message body will be completed with the <text> |
cc=<address>[,<address>] | Cc header will be completed with the list of addresses |
bcc=<address>[,<address>] | Bcc header will be completed with the list of addresses |
in-reply-to=<message-id> | In-reply-to header will be set to the message id |
account=<accountname> | Specify the account (must be in accounts.conf; default is the selected account) |
template=<template-file> | Template sets the template file for creating the message |
:<command...>
The command to be executed and its arguments can either be passed as separate arguments in the shell (e.g., aerc :cmd arg1 arg2) or as a single argument in the shell (e.g., aerc ":cmd arg1 arg2"). In the former case, aerc may add quotes to the command before it is parsed in an attempt to preserve arguments containing spaces and other special characters. In the latter case, aerc will parse the command verbatim, as if it had been typed directly on aerc's command line. This latter form can be helpful for commands that don't interpret quotes in their arguments.
If aerc is already running (and IPC is not disabled), the command is run in that instance; otherwise a new instance is started with the command.
mbox:<file>
If aerc is already running (and IPC is not disabled), the file is opened in that instance; otherwise a new instance is started with the file.
RUNTIME COMMANDS¶
To execute a command, press : to bring up the command interface. Commands may also be bound to keys, see aerc-binds(5) for details. In some contexts, such as the terminal emulator, <c-x> is used to bring up the command interface.
Different commands work in different contexts, depending on the kind of tab you have selected.
Dynamic arguments are expanded following aerc-templates(7) depending on the context. For example, if you have a message selected, the following command:
:filter -f "{{index (.From | emails) 0}}"
Will filter all messages sent by the same sender.
Aerc stores a history of commands, which can be cycled through in command mode. Pressing the up key cycles backwards in history, while pressing down cycles forwards.
GLOBAL COMMANDS¶
These commands work in any context.
:help <topic>
:man <topic>
:help keys
:man keys
:new-account [-t]
-t: Create a temporary account. Do not modify accounts.conf.
:cd <directory>
:z <directory or zoxide query>
:change-tab [+|-]<tab name or
index>
:ct [+|-]<tab name or index>
:exec <command>
Note: commands executed in this way are not executed with the shell.
:eml [<path>]
:preview [<path>]
Can also be used in the message viewer to open an rfc822 attachment or in the composer to preview the message.
:pwd
:send-keys <keystrokes>
Here's an example of quiting a Vim-like editor:
Note: when used in binds.conf (see aerc-binds(5)), angle brackets need to be escaped in order to make their way to the command:
This way the <Esc> and the first <Enter> keystrokes are passed to :send-keys, while the last <Enter> keystroke is executed directly, committing the :send-keys command's execution.
:term [<command>...]
:terminal [<command>...]
:move-tab [+|-]<index>
:prev-tab [<n>]
:next-tab [<n>]
:pin-tab
:unpin-tab
:prompt <prompt> <command>...
:menu [-c "<shell-cmd>"] [-e] [-b] [-a] [-d] <aerc-cmd ...>
:menu can be used without an external program by setting <shell-cmd> to -. This also acts as a fallback in case where no <shell-cmd> was specified at all or the executable in the <shell-cmd> was not found.
-c "<shell-cmd>"
-e: Stop executing commands on the first error.
-b: Do NOT spawn the popover dialog. Start the commands in the background (NOT in a virtual terminal). Use this if <shell-cmd> is a graphical application that does not need a terminal.
<shell-cmd> may be fed with input text using the following flags:
-d: All current account directory names, one per line. E.g.:
-ad: All directories of all accounts, one per line. E.g.:
Quotes may be added by aerc when either tokens contain special characters. The quotes should be preserved for <aerc-cmd ...>.
Examples:
:menu -adc fzf :cf -a :menu -c 'fzf --multi' :attach :menu -dc 'fzf --multi' :cp :menu -bc 'dmenu -l 20' :cf :menu -c 'ranger --choosefiles=%f' :attach
This may also be used in key bindings (see aerc-binds(5)):
<C-p> = :menu -adc fzf :cf -a<Enter>
:choose -o <key> <text> <command> [-o <key> <text> <command>]...
:suspend
:quit [-f]
:exit [-f]
:q [-f]
MESSAGE COMMANDS¶
These commands are valid in any context that has a selected message (e.g. the message list, the message in the message viewer, etc).
:archive [-m <strategy>] <scheme>
flat: No special structure, all messages in the archive directory
year: Messages are stored in folders per year
month: Messages are stored in folders per year and subfolders per month
The -m option sets the multi-file strategy. See aerc-notmuch(5) for more details.
:accept [-e|-E]
-e: Forces [compose].edit-headers = true for this message only.
-E: Forces [compose].edit-headers = false for this message only.
:accept-tentative [-e|-E]
-e: Forces [compose].edit-headers = true for this message only.
-E: Forces [compose].edit-headers = false for this message only.
:copy [-p] [-a <account>]
[-m <strategy>] <folder>
:cp [-p] [-a <account>] [-m
<strategy>] <folder>
-p: Create <folder> if it does not exist.
-a: Copy to <folder> of <account>. If <folder> does not exist, it will be created whether or not -p is used.
-m: Set the multi-file strategy. See aerc-notmuch(5) for more details.
:decline [-e|-E]
-e: Forces [compose].edit-headers = true for this message only.
-E: Forces [compose].edit-headers = false for this message only.
:delete [-m <strategy>]
:delete-message [-m <strategy>]
-m: Set the multi-file strategy. See aerc-notmuch(5) for more details.
:envelope [-h] [-s <format-specifier>]
-h: Show all header fields
-s <format-specifier>
:recall [-f] [-e|-E]
-f: Open the message for re-editing even if it is not in the postpone directory. Aerc remembers the folder, so the further :postpone call will save the message back there.
-e: Forces [compose].edit-headers = true for this message only.
-E: Forces [compose].edit-headers = false for this message only.
Original recalled messages are deleted if they are sent or postponed again. In both cases you have another copy of the message somewhere. Otherwise the recalled message is left intact. This happens if the recalled message is discarded after editing. It can be deleted with :rm if it is not needed.
:forward [-A|-F] [-T <template-file>] [-e|-E] [<address>...]
-A: Forward the message and all attachments.
-F: Forward the full message as an RFC 2822 attachment.
-T <template-file>
-e: Forces [compose].edit-headers = true for this message only.
-E: Forces [compose].edit-headers = false for this message only.
:move [-p] [-a <account>]
[-m <strategy>] <folder>
:mv [-p] [-a <account>] [-m
<strategy>] <folder>
-p: Create <folder> if it does not exist.
-a: Move to <folder> of <account>. If <folder> does not exist, it will be created whether or not -p is used.
-m: Set the multi-file strategy. See aerc-notmuch(5) for more details.
:patch <args ...>
:pipe [-bmp] <cmd>
Operates on multiple messages when they are marked. When piping multiple messages, aerc will write them with mbox format separators.
-b: Run the command in the background instead of opening a terminal tab
-s: Silently close the terminal tab after the command is completed
-m: Pipe the full message
-p: Pipe just the selected message part, if applicable
This can be used to apply patch series with git:
When at least one marked message subject matches a patch series (e.g. [PATCH X/Y]), all marked messages will be sorted by subject to ensure that the patches are applied in order.
:reply [-acq] [-T <template-file>] [-A <account>] [-e|-E]
-a: Reply all
-c: Close the view tab when replying. If the reply is not sent, reopen the view tab.
-q: Insert a quoted version of the selected message into the reply editor
-T <template-file>
-A_: <account>
-e: Forces [compose].edit-headers = true for this message only.
-E: Forces [compose].edit-headers = false for this message only.
:read [-t]
-t: Toggle the messages between read and unread.
:unread [-t]
-t: Toggle the messages between read and unread.
:flag [-t] [-a | -x <flag>]
-t: Toggle the flag instead of setting (enabling) it.
-a: Mark message as answered/unanswered.
-x <flag>: Mark message with specific flag.
Seen
:unflag [-t] <flag>
:modify-labels [+|-]<label>...
:tag [+|-]<label>...
Example: add inbox and unread labels, remove spam label.
:unsubscribe [-e|-E]
-e: Forces [compose].edit-headers = true for this message only.
-E: Forces [compose].edit-headers = false for this message only.
MESSAGE LIST COMMANDS¶
:align top|center|bottom
top: Top of the message list.
center: Center of the message list.
bottom: Bottom of the message list.
:disconnect
:connect
:clear [-s]
By default, the selected message will be kept. To clear the selected message and move cursor to the top of the message list, use the -s flag.
-s: Selects the message at the top of the message list after clearing.
:cf [-a <account>] <folder>
-a <account>
:check-mail
:compose [-H "<header>: <value>"] [-T <template-file>] [-e|-E] [<body>]
-H "<header>: <value>"
-T <template-file>
-e: Forces [compose].edit-headers = true for this message only.
-E: Forces [compose].edit-headers = false for this message only.
<body>: The initial message body.
:bounce [-A <account>]
<address> [<address>...]
:resend [-A <account>] <address>
[<address>...]
Also please note that some providers (notably for instance Microsoft's O365) do not allow sending messages with the From header not matching any of the account's identities (even if Resent-From matches some).
:recover [-f] [-e|-E] <file>
-f: Delete the <file> after opening the composer.
-e: Forces [compose].edit-headers = true for this message only.
-E: Forces [compose].edit-headers = false for this message only.
:filter [<options>] <terms>...
:mkdir <name>
:rmdir [-f] [<folder>]
By default, it will fail if the directory is non-empty (see -f).
-f
Some programs that sync maildirs may recover deleted directories (e.g. offlineimap). These can either be specially configured to properly handle directory deletion, or special commands need to be run to delete directories (e.g. offlineimap --delete-folder).
It is possible, with a slow connection and the imap backend, that new messages arrive in the directory before they show up - using :rmdir at this moment would delete the directory and such new messages before the user sees them.
:next <n>[%]
:next-message <n>[%]
:prev <n>[%]
:prev-message <n>[%]
:next-folder <n>
:prev-folder <n>
:expand-folder
:collapse-folder
:export-mbox <file>
:import-mbox <file>
:next-result
:prev-result
:query [-a <account>] [-n name] [-f] <notmuch query>
-a <account>
-n <name>
-f
:search [<options>] <terms>...
:select <n>
:select-message <n>
:hsplit [[+|-]<n>] :split [[+|-]<n>]
:sort [[-r] <criterion>]...
Available criteria:
Criterion | Description |
arrival | Date and time of the messages arrival |
cc | Addresses in the Cc field |
date | Date and time of the message |
from | Addresses in the From field |
read | Presence of the read flag |
flagged | Presence of the flagged flag |
size | Size of the message |
subject | Subject of the message |
to | Addresses in the To field |
:toggle-threads
:fold [-at]
:unfold [-at]
:toggle-thread-context
:view [-p]
:view-message [-p]
:vsplit [[+|-]<n>]
MESSAGE VIEW COMMANDS¶
:close
:next <n>[%]
:prev <n>[%]
:next-part
:prev-part
:open [-d] [<args...>]
-d: Delete the temporary file after the opener exits
When arguments are provided:
- The first argument must be the program to open the message part with. Subsequent args are passed to that program.
- {} will be expanded as the temporary filename to be opened. If it is not encountered in the arguments, the temporary filename will be appened to the end of the command.
:open-link <url> [<args...>]
:save [-fpaA] <path>
-f: Overwrite the destination whether or not it exists
-p: Create any directories in the path that do not exist
-a: Save all attachments. Individual filenames cannot be specified.
-A: Same as -a but saves all the named parts, not just attachments.
:mark [-atvT]
-a: Apply to all messages in the current folder
-t: toggle the mark state instead of marking a message
-v: Enter / leave visual mark mode
-V: Same as -v but does not clear existing selection
-T: Marks the displayed message thread of the selected message.
:unmark [-at]
-a: Apply to all messages in the current folder
-t: toggle the mark state instead of unmarking a message
:remark
:toggle-headers
:toggle-key-passthrough
MESSAGE COMPOSE COMMANDS¶
:abort
If the text editor exits with an error (e.g. :cq in vim(1)), the message is immediately discarded.
:attach <path>
:attach -m [<arg>]
:attach -r <name> <cmd>
-m [<arg>]
-r <name> <cmd>
:attach-key
:detach [<path>]
:cc <addresses>
:bcc <addresses>
:edit [-e|-E]
-e: Forces [compose].edit-headers = true for this message only.
-E: Forces [compose].edit-headers = false for this message only.
:multipart [-d] <mime/type>
-d:
:next-field
:prev-field
:postpone [-t <folder>]
-t: Overrides the target folder for saving the message
If the message was force-recalled with :recall -f from a different folder, the :postpone command will save it back to that folder instead of the default postpone folder configured in settings. Use -t to override that or use :mv to move the saved message to a different folder.
:save [-p] <path>
:send [-a <scheme>] [-t <folder>]
-a: Archive the message being replied to. See :archive for schemes.
-t: Overrides the Copy-To folder for saving the message.
:switch-account <account-name>
:switch-account -n
:switch-account -p
-p: switch to previous account
-n: switch to next account
:header [-f] <name> [<value>] :header [-d] <name>
-f: Overwrite any existing header.
-d: Remove the header instead of adding it.
:encrypt
:sign
TERMINAL COMMANDS¶
:close
LOGGING¶
Aerc does not log by default, but collecting log output can be useful for troubleshooting and reporting issues. Redirecting stdout when invoking aerc will write log messages to that file:
Persistent logging can be configured via the log-file and log-level settings in aerc.conf.
SEE ALSO¶
aerc-config(5) aerc-imap(5) aerc-jmap(5) aerc-notmuch(5) aerc-smtp(5) aerc-maildir(5) aerc-sendmail(5) aerc-search(1) aerc-stylesets(7) aerc-templates(7) aerc-accounts(5) aerc-binds(5) aerc-tutorial(7) aerc-patch(7)
AUTHORS¶
Originally created by Drew DeVault and maintained by Robin Jarry who is assisted by other open source contributors. For more information about aerc development, see https://sr.ht/~rjarry/aerc/.
2024-07-29 |