AERC-CONFIG(5) | File Formats Manual | AERC-CONFIG(5) |
aerc-config - configuration file format for aerc(1)
There are three aerc config files: aerc.conf, binds.conf, and accounts.conf. The last one must be kept secret, as it may include your account credentials. We look for these files in your XDG config home plus aerc, which defaults to ~/.config/aerc.
Examples of these config files are typically included with your installation of aerc and are usually installed in /usr/share/aerc.
Each file uses the ini format, and consists of sections with keys and values. A line beginning with # is considered a comment and ignored, as are empty lines. New sections begin with [section-name] on a single line, and keys and values are separated with =.
This manual page focuses on aerc.conf. binds.conf is detailed in aerc-binds(5) and accounts.conf in aerc-accounts(5).
aerc.conf is used for configuring the general appearance and behavior of aerc.
These options are configured in the [general] section of aerc.conf.
default-save-path = <path>
pgp-provider = auto|gpg|internal
Default: auto
unsafe-accounts-conf = true|false
Default: false
log-file = <path>
log-level = trace|debug|info|warn|error
Default: info
These options are configured in the [ui] section of aerc.conf.
index-format = <format>
Default: %D %-17.17n %s
Format specifier | Description |
%% | literal % |
%a | sender address |
%A | reply-to address, or sender address if none |
%C | message number |
%d | formatted message timestamp |
%D | formatted message timestamp converted to local timezone |
%f | sender name and address |
%F | author name, or recipient name if the message is from you. The address is shown if no name part. |
%g | message labels (for example notmuch tags) |
%i | message id |
%n | sender name, or sender address if none |
%r | comma-separated list of formatted recipient names and addresses |
%R | comma-separated list of formatted CC names and addresses |
%s | subject |
%t | the (first) address the new email was sent to |
%T | the account name which received the email |
%u | sender mailbox name (e.g. "smith" in "smith@example.net") |
%v | sender first name (e.g. "Alex" in "Alex Smith <smith@example.net>") |
%Z | flags (O=old, N=new, r=answered, D=deleted, !=flagged, *=marked, a=attachment) |
timestamp-format = <timeformat>
Default: 2006-01-02 03:04 PM (ISO 8601 + 12 hour time)
this-day-time-format = <timeformat>
this-week-time-format = <timeformat>
this-year-time-format = <timeformat>
message-view-timestamp-format = <timeformat>
message-view-this-day-time-format = <timeformat>
message-view-this-week-time-format = <timeformat>
message-view-this-year-time-format = <timeformat>
sidebar-width = <int>
Default: 20
empty-message = <string>
Default: (no messages)
empty-dirlist = <string>
Default: (no folders)
mouse-enabled = true|false
Default: false
new-message-bell = true|false
Default: true
pinned-tab-marker = "<string>"
Default: `
spinner = "<string>"
Examples:
Default: "[..] , [..] , [..] , [..] , [..], [..] , [..] , [..] "
spinner-delimiter = <string>
Default: ,
sort = <criteria>
Example:
dirlist-format = <format>
Default: %n %>r
Format specifier | Description |
%% | literal % |
%n | directory name |
%N | compacted directory name |
%r | recent/unseen/total message count |
%>X | make format specifier 'X' be right justified |
dirlist-delay = <duration>
Default: 200ms
dirlist-tree = true|false
Default: false
dirlist-collapse = <int>
Default: 0
next-message-on-delete = true|false
Default: true
auto-mark-read = true|false
Default: true
completion-popovers = true|false
Default: true
completion-delay = <duration>
Default: 250ms
completion-min-chars = <int>
Default: 1
border-char-vertical = "<char>"
border-char-horizontal = "<char>"
Default: " "
stylesets-dirs = <path1:path2:path3...>
${XDG_CONFIG_HOME:-~/.config}/aerc/stylesets ${XDG_DATA_HOME:-~/.local/share}/aerc/stylesets /usr/local/share/aerc/stylesets /usr/share/aerc/stylesets
styleset-name = <string>
Default: default
Have a look at aerc-stylesets(7) as to how a styleset looks like.
icon-unencrypted = <string>
icon-encrypted = <string>
Default: [e]
icon-signed = <string>
Default: [s]
icon-signed-encrypted = <string>
icon-unknown = <string>
Default: [s?]
icon-invalid = <string>
Default: [s!]
icon-attachment = <string>
Default: a
fuzzy-complete = true|false
reverse-msglist-order = true|false
Default: false
reverse-thread-order = true|false
Default: false
sort-thread-siblings = true|false
Default: false
threading-enabled = true|false
Default: false
force-client-threads = true|false
Default: false
The UI configuration can be specialized for accounts, specific mail directories and message subjects. The specializations are added using contextual config sections based on the context.
The contextual UI configuration is merged to the base UiConfig in the following order: Base UIConfig > Account Context > Folder Context > Subject Context.
[ui:account=AccountName]
[ui:folder=FolderName]
[ui:folder~Regex]
[ui:subject~Regex]
Example:
[ui:account=Work] sidebar-width=... [ui:folder=Sent] index-format=... [ui:folder~Archive/d+/.*] index-format=... [ui:subject~^[PATCH] index-format=...
These options are configured in the [statusline] section of aerc.conf.
render-format = <format>
For a minimal statusline that only shows the current account and the connection information, use [%a] %c.
To completely mute the statusline (except for push notifications), use %m only.
Default: [%a] %S %>%T
Format specifier | Description |
%% | literal % |
%a | active account name |
%d | active directory name |
%c | connection state |
%p | current path |
%m | mute statusline and show only push notifications |
%S | general status information (e.g. connection state, filter, search) |
%T | general on/off information (e.g. passthrough, threading, sorting) |
%> | does not print anything but all format specifier that follow will be right justified. |
separator = "<string>"
Default: " | "
display-mode = text|icon
Default: text
These options are configured in the [viewer] section of aerc.conf.
pager = <command>
Default: less -R
alternatives = <mime,types>
Default: text/plain,text/html
header-layout = <header|layout,list...>
Notmuch tags can be displayed by adding Labels.
Authentication information from the Authentication-Results header can be displayed by adding DKIM, SPF or DMARC. To show more information than just the authentication result, append a plus sign (+) to the header name (e.g. DKIM+).
Default: From|To,Cc|Bcc,Date,Subject
show-headers = true|false
Default: false
always-show-mime = true|false
Default: false
parse-http-links = true|false
Default: true
These options are configured in the [compose] section of aerc.conf.
editor = <command>
Defaults to $EDITOR, or vi(1).
header-layout = <header|layout,list...>
Default: To|From,Subject
address-book-cmd = <command>
The command must output the completions to standard output, one completion per line. Each line must be tab-delimited, with an email address occurring as the first field. Only the email address field is required. The second field, if present, will be treated as the contact name. Additional fields are ignored.
This parameter can also be set per account in accounts.conf.
Example:
file-picker-cmd = <command>
The command must output the selected files to standard output, one file per line.
Example:
reply-to-self = true|false
Default: true
no-attachment-warning = <regexp>
Uses Go's regexp syntax, documented at https://golang.org/s/re2syntax. The (?im) flags are set by default (case-insensitive and multi-line).
Example:
Converters allow to generate multipart/alternative messages by converting the main text/plain body into any other text MIME type with the :multipart command. Only exact MIME types are accepted. The commands are invoked with sh -c and are expected to output valid UTF-8 text.
Only text/<subtype> MIME parts can be generated. The text/plain MIME type is reserved and cannot be generated. You still need to write your emails by hand in your favorite text editor.
Converters are configured in the [multipart-converters] section of aerc.conf.
Example:
[multipart-converters] text/html=pandoc -f markdown -t html --standalone
Obviously, this requires that you write your main text/plain body using the markdown syntax. Also, mind that some mailing lists reject emails that contain text/html alternative parts. Use this feature carefully and when possible, avoid using it at all.
Filters are a flexible and powerful way of handling viewing parts of an opened message. When viewing messages aerc will show the list of available message parts and their MIME type at the bottom, but unless a filter is defined for a specific MIME type, it will only show a menu with a few options (allowing you to open the part in an external program, save it to disk or pipe it to a shell command). Configuring a filter will allow viewing the output of the filter in the configured pager in aerc's built-in terminal.
Filters are configured in the [filters] section of aerc.conf. The first filter which matches the part's MIME type will be used, so order them from most to least specific. You can also match on non-MIME types, by prefixing with the header to match against (non-case-sensitive) and a comma, e.g. subject,text will match a subject which contains text. Use header,~regex to match against a regex.
Note that aerc will pipe the content into the configured filter program, so filters need to be able to read from standard input. Many programs support reading from stdin by putting - instead of a path to a file. You can also chain together multiple filters by piping with |.
aerc ships with some default filters installed in the share directory (usually /usr/share/aerc/filters). Note that these may have additional dependencies that aerc does not have alone.
The filter commands are invoked with sh -c command. The following folders are appended to the system $PATH to allow referencing filters from their name only.
${XDG_CONFIG_HOME:-~/.config}/aerc/filters ${XDG_DATA_HOME:-~/.local/share}/aerc/filters $PREFIX/share/aerc/filters /usr/share/aerc/filters
The following variables are defined in the filter command environment:
AERC_MIME_TYPE
Note that said email body is converted into UTF-8 before being passed to filters.
text/plain
text/plain=colorize
The built-in colorize filter supports alternative themes:
text/plain=colorize -v theme=solarized
Wrap long lines at 100 characters, while not messing up nested quotes. Handles format=flowed emails properly:
text/plain=wrap -w 100 | colorize
from,<sender>
from,thatguywhoneverhardwrapshismessages=wrap -r -w 72 | colorize
subject,~<regexp>
subject,~Git(hub|lab)=lolcat -f
text/html
text/html=html | colorize
Use pandoc to output plain text:
text/html=pandoc -f html -t plain
text/calendar
text/calendar=calendar
text/*
text/*=bat -fP --file-name="$AERC_FILENAME" --style=plain
message/delivery-status
message/delivery-status=colorize
message/rfc822
message/rfc822=caeml | colorize
https://github.com/ferdinandyb/caeml
application/mbox
application/mbox=catbox -c caeml | colorize
https://github.com/konimarti/catbox
application/pdf
application/pdf=pdftotext - -l 10 -nopgbrk -q - | fmt -w 100
https://www.xpdfreader.com/pdftotext-man.html
image/*
The built-in terminal can show pixelated images with catimg(1):
image/*=catimg -w$(tput cols) -
See the wiki at https://man.sr.ht/~rjarry/aerc/ for more examples and possible customizations of the built-in filters (e.g. colors of colorize).
Openers allow you to specify the command to use for the :open action on a per-MIME-type basis. They are configured in the [openers] section of aerc.conf.
{} is expanded as the temporary filename to be opened. If it is not encountered in the command, the temporary filename will be appened to the end of the command. Environment variables are also expanded. Tilde is not expanded.
Example:
[openers] text/html=surf -dfgms text/plain=gvim {} +125 message/rfc822=thunderbird
Triggers specify commands to execute when certain events occur.
They are configured in the [triggers] section of aerc.conf.
new-email = <command>
e.g. new-email=exec notify-send "New email from %n" "%s"
Format specifiers from index-format are expanded with respect to the new message.
Templates are used to populate the body of an email. The :compose, :reply and :forward commands can be called with the -T flag with the name of the template name.
aerc ships with some default templates installed in the share directory (usually /usr/share/aerc/templates).
These options are configured in the [templates] section of aerc.conf.
template-dirs = <path1:path2:path3...>
${XDG_CONFIG_HOME:-~/.config}/aerc/templates ${XDG_DATA_HOME:-~/.local/share}/aerc/templates /usr/local/share/aerc/templates /usr/share/aerc/templates
new-message = <template_name>
Default: new_message
quoted-reply = <template_name>
Default: quoted_reply
forwards = <template_name>
Default: forward_as_body
aerc(1) aerc-accounts(5) aerc-binds(5) aerc-imap(5) aerc-maildir(5) aerc-notmuch(5) aerc-templates(7) aerc-sendmail(5) aerc-smtp(5) aerc-stylesets(7)
Originally created by Drew DeVault <sir@cmpwn.com> and maintained by Robin Jarry <robin@jarry.cc> who is assisted by other open source contributors. For more information about aerc development, see https://sr.ht/~rjarry/aerc/.
2023-04-23 |