aboutsummaryrefslogtreecommitdiffstats
path: root/config
Commit message (Collapse)AuthorAgeFilesLines
* perf: reduce calls to GetUiConfigTim Culverhouse2022-07-031-0/+4
| | | | | | | | | | | | | | | | | | GetUiConfig was being called many times, and came up as a high CPU user in a cpuprofile. Every call would merge a UIConfig, which is a costly operation. Ideally, we would only need to have a config for every account X every directory. We also have a context for subjects. This patch stores all FOLDER and ACCOUNT level configs and reuses those merged objects. The SUBJECT contexts are not stored in favor of merging on-the-go, with a TODO comment to deprecate that feature and implement a better per-message styling option. I suspect this feature is not used very much. Before applying this patch with my setup, GetUiConfig is called 1159 times just to open aerc. After applying, this is reduced to 37. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* uiconfig: use pointer references to uiConfigTim Culverhouse2022-07-031-2/+2
| | | | | | | | This patch changes references to uiConfig in function signatures and structs to be pointers. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* pgp: add customizable iconsMoritz Poldrack2022-06-242-0/+22
| | | | | Signed-off-by: Moritz Poldrack <git@moritz.sh> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* config: fix location of completion-{delay,popover} in default configTim Culverhouse2022-06-221-11/+11
| | | | | | | | | The default config had completion-{delay,popover} in the [viewer] section, but they belong in the [ui] section Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* config: fix setting of zero-value time.Duration config valuesTim Culverhouse2022-06-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using section.MapTo(struct) (go-ini), if the struct has a default value for a time.Duration type, a zero-value in the config will not overwrite the default. If the type is *time.Duration, it will be overwritten properly. One consideration was to change all time.Duration types to *time.Duration. This method was chosen for ease of implementation. For example, if you set dirlist-delay = 0s, the delay will be 200ms. This can be observed by logging the value just after mapping the ui section in config.go. A config value of 0.1ms will have a delay of 0.1ms. Currently, aerc has 4 time.Duration config values: 1. DirlistDelay - default 200 ms 2. CompletionDelay - default 250 ms 3. CheckMail - default unset (0) 4. CheckMailTimeout - default 10 s 1, 2, and 4 have a non-zero default value and are subject to this bug. Only 1 and 2 are fixed in this patch. Number 4 would not make sense to have a 0 second timeout, therefore we can prevent the user from doing this by keeping it as it is. Another option could be to set these to 0 in config.go. The default config (aerc.conf) has these keys in it with their default values. Presumably, we don't need to set them again in config.go. If a user deletes the config values out of aerc.conf, the UI will function but with 0s delays. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Moritz Poldrack <moritz@poldrack.dev>
* binds: Open msgs in default Postpone folder in edit-modeTim Culverhouse2022-06-221-0/+3
| | | | | | | | | | | | | Add a default keybind to open messages in the default Postpone folder ("Drafts") in edit-mode. A frequent question on IRC is "how do I edit a draft?". When a user selects a Draft and presses <Enter>, the intent is usually to edit that draft. This commit makes this the default behaviour for the default Postpone folder. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* binds: add folder context for message list bindsTim Culverhouse2022-06-221-0/+5
| | | | | | | | | | | Add option to specify folder-specific binds for message lists. The binds are layered: any existing binds in [messages] are overwritten by a more specific bind in say, [messages:folder=Drafts]. The order is currently: [messages] < [messages:account=<account>] < [messages:folder=<folder>] Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* msgviewer: open http links from messagesKoni Marti2022-06-143-0/+10
| | | | | | | | | | | | | | | | | Parse http links from a message and display them as completions in the :open-link command. Add the following binds to the [view] section in your binds.conf: <C-l> = :open-link <space> Parsing can be disabled in aerc.conf by setting parse-http-links to false in the viewer section. Thanks to Moritz for the help with the regular expression. Signed-off-by: Koni Marti <koni.marti@gmail.com> Reviewed-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* msgviewer: parse and display authentication resultsKoni Marti2022-06-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Parse the Authentication-Results header and display it in the message viewer (not enabled by default). DKIM, SPF and DMARC authentication methods are supported. Implement recommendation from RFC 7601 Sec 7.1 to have an explicit list of trustworthy hostnames before displaying the authentication results. Be aware that the authentication headers can be forged. To display the results for a specific authentication method, add the corresponding name to the layout of headers in the viewer section of aerc.conf, e.g. to display all three, use: header-layout = From|To,Cc|Bcc,Date,Subject,DKIM|SPF|DMARC More information will be displayed when "+" is appended to the authentication method name, e.g. DKIM+ or SPF+ or DMARC+. Also, add the trustworthy hosts per account with the trusted-authres parameter, e.g. trusted-authres = * to trust every host or use regular expressions for a finer control. Multiple hosts can be entered as a comma-separated list. Authentication results will only be displayed when the host is listed in the trusted-authres list. Link: https://datatracker.ietf.org/doc/html/rfc7601 Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* feat: add background mail polling option for all workersTim Culverhouse2022-05-311-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Check for new mail (recent, unseen, exists counts) with an external command, or for imap with the STATUS command, at start or on reconnection and every X time duration IMAP: The selected folder is skipped, per specification. Additional config options are included for including/excluding folders explicitly. Maildir/Notmuch: An external command will be run in the background to check for new mail. An optional timeout can be used with maildir/notmuch. Default is 10s New account options: check-mail check-mail-cmd (maildir/notmuch only) check-mail-timeout (maildir/notmuch only), default 10s check-mail-include (IMAP only) check-mail-exclude (IMAP only) If unset, or set less than or equal to 0, check-mail will be ignored Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* pgp: add options auto-sign & opportunistic-encryptTim Culverhouse2022-05-061-1/+9
| | | | | | | | Add account level config options for auto-sign and opportunistic encryption. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Koni Marti <koni.marti@gmail.com>
* feat: add gpg integrationTim Culverhouse2022-04-272-1/+11
| | | | | | | | | | | | | | | | | | | This commit adds gpg system integration. This is done through two new packages: gpgbin, which handles the system calls and parsing; and gpg which is mostly a copy of emersion/go-pgpmail with modifications to interface with package gpgbin. gpg includes tests for many cases, and by it's nature also tests package gpgbin. I separated these in case an external dependency is ever used for the gpg sys-calls/parsing (IE we mirror how go-pgpmail+openpgp currently are dependencies) Two new config options are introduced: * pgp-provider. If it is not explicitly set to "gpg", aerc will default to it's internal pgp provider * pgp-key-id: (Optionally) specify a key by short or long keyId Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* refactor: refactor pgp implementationTim Culverhouse2022-04-271-0/+20
| | | | | | | | | This commit refactors the internal PGP implementation to make way for GPG integration. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* style: add style config options for dirlist_unread and dirlist_recentTim Culverhouse2022-04-271-0/+4
| | | | | | | | Adds two style options: dirlist_unread and dirlist_recent. These options apply in layers, in the same way as msglist_* styles do. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* config: add unsafe-accounts-conf optionVictor Freire2022-04-252-6/+24
| | | | | | | | | | | This adds the option "unsafe-accounts-conf" under the section [general] of aerc.conf. This allows an user to specify if the accounts.conf file must be restrict to be read by the file owner (0600). By default it is set to "false". Signed-off-by: Victor Freire <victor@freire.dev.br> Acked-by: Robin Jarry <robin@jarry.cc>
* binds: fix incorrect key names for c-] and c-[Ivan Oleynikov2022-04-251-2/+2
| | | | | | | The left and right square brackets are inverted. Fix that. Signed-off-by: Ivan Oleynikov <ivan.oleynikov95@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* statusline: refactor to make it more customizableKoni Marti2022-04-252-5/+40
| | | | | | | | | | | | | | | | | Refactor statusline by clearly separating the rendering part from the text display. Use printf-like format string for statusline customization. Document printf-like format string to customize the statusline. Allow to completely mute the statusline (except for push notifications) with a format specifier. Provide a display mode with unicode icons for the status elements. Implements: https://todo.sr.ht/~rjarry/aerc/34 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* config: clarify threading-enabled optionKenneth Flak2022-04-191-1/+3
| | | | | | | This is only supported with notmuch and specific imap servers. Signed-off-by: Kenneth Flak <kennethflak@protonmail.com> Signed-off-by: Robin Jarry <robin@jarry.cc>
* binds: allow to bind a command to < and >Koni Marti2022-04-171-0/+8
| | | | | | | | | | | | | | | Allow to bind to < and > by using \< and \> in binds.conf. Ensure that the single \ can still be properly used to bind to other commands. For example, the following binds would work now: \< = :prev-tab<Enter> \> = :next-tab<Enter> \ = :filter<space> Fixes: https://todo.sr.ht/~rjarry/aerc/37 Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Sebastian LaVine <mail@smlavine.com> Acked-by: Robin Jarry <robin@jarry.cc>
* binds: add binding for :open by default in viewerkt programs2022-04-141-1/+2
| | | | | | | | Also move binding for :delete such that the :open, :save, :pipe command bindings are grouped together. Signed-off-by: kt programs <ktprograms@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* config: don't swallow error in checkConfigPermsConnor Kuehl2022-04-141-1/+5
| | | | | | | | | | os.Stat might return other errors aside from one stating that the file does not exist. If it does, propagate the error down. As before, if the file does not exist, just do nothing. Signed-off-by: Connor Kuehl <cipkuehl@gmail.com> Reviewed-by: Moritz Poldrack <moritz@poldrack.dev> Tested-by: Moritz Poldrack <moritz@poldrack.dev>
* stylesets: allow specifying color by numberTobias Wölfel2022-04-071-2/+14
| | | | | | | | | Make it possible to specify the color in the style sets by number in addition to the color name. This allows using colors defined by the terminal. Signed-off-by: Tobias Wölfel <tobias.woelfel@mailbox.org> Acked-by: Robin Jarry <robin@jarry.cc>
* go vet: not compatible with reflect.StructTag.GetMoritz Poldrack2022-03-181-1/+1
| | | | | | | | This commit fixes all occurrences of the abovementioned lint-error in the codebase. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* viewer: add key passthrough modekt programs2022-03-142-23/+33
| | | | | | | | | | | | | | | | When trying to search in less, keys bound to viewer functions can't be used as part of the search query, which makes the search useless. Add a view::passthrough binding mode and a :toggle-key-passthrough command go toggle in and out of that mode. By default, typing '/' in the viewer is bound to enabling key passthrough and automatically inserting '/', to easily enter "less" search mode. When in the passthrough mode, all bindings are ignored by default. The default binds.conf only defines a single keybinding in that mode: <Esc> to get back out. $ex is bound to <C-x> to allow typing colons. Signed-off-by: Kt Programs <ktprograms@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* commands: implement fuzzy completion for commands and optionskt programs2022-03-072-5/+6
| | | | | | | | Change the option to enable fuzzy completion to be fuzzy-complete, since it's no longer only used for folders Signed-off-by: Kt Programs <ktprograms@gmail.com> Acked-by: Koni Marti <koni.marti@gmail.com>
* config: expand tilde in search directoriesDaniel Patterson2022-03-031-1/+9
| | | | | | | | | Will expand a user-provided custom sharedir, XDG_CONFIG_HOME and XDG_DATA_HOME if necessary. Will not alter those strings if they do not begin with a tilde. Signed-off-by: Daniel Patterson <me@danielpatterson.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* config: specify sharedir during buildDaniel Patterson2022-03-032-11/+36
| | | | | | | | | | | | | We should use the Makefile value of SHAREDIR when searching for config files and templates etc. This is important for systems which do not use the standard file hierarchy or which do not have a consistent location for installing program files, for example NixOS, which will have a different install location with every update. Signed-off-by: Daniel Patterson <me@danielpatterson.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* config: fix default PgUp/PgDn bindingsMaxim Karasev2022-02-281-2/+2
| | | | | | | If -s is present, aerc just shows usage info. Signed-off-by: Maxim Karasev <begs@disroot.org> Acked-by: Inwit <inwit@sindominio.net>
* threading: implement on-the-fly message threadingKoni Marti2022-02-241-0/+2
| | | | | | | | | | | | | | | | | | | | implement message threading on the message store level using the jwz algorithm. Build threads on-the-fly when new message headers arrive. Use the references header to create the threads and the in-reply-to header as a fall-back option in case no references header is present. Does not run when the worker provides its own threading (e.g. imap server threads). Include only those message headers that have been fetched and are stored in the message store. References: https://www.jwz.org/doc/threading.html Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Tested-by: akspecs <akspecs@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* commands: add expand-folder and collapse-folderKoni Marti2022-02-231-0/+2
| | | | | | | | add the expand-folder and collapse-folder commands to navigate the directory tree view. Provide keybinds for a vi-like folder navigation experience. Signed-off-by: Koni Marti <koni.marti@gmail.com>
* dirtree: implement foldable tree for directory listKoni Marti2022-02-232-0/+7
| | | | | | | | | | | | | | implement a foldable tree for the directory list. Expand all parent directories when a hidden directory is selected with the change-folder command. folders-sort considers the top-level directories only. The folders and foldersexclude filters work with the full directory path. Enable tree view by adding 'dirlist-tree=true' to the config file. Implements: https://todo.sr.ht/~sircmpwn/aerc2/228 Signed-off-by: Koni Marti <koni.marti@gmail.com>
* config: fix default text/plain filter0.8.0Robin Jarry2022-02-191-1/+1
| | | | | | | | | | | | | | | | | | ; is a special character for the INI format. It starts a comment and apparently cannot be escaped nor quoted. This causes the default text/plain filter to be truncated and causes this obscure error when viewing a message: sh: 1: Syntax error: Unterminated quoted string Debugging shows that the filter command is: sh -c "sed 's/^>\\+.*/\\x1b[2" Remove the explicit dim style. It should be the default anyway. Fixes: 7c3ce816c8a6 ("config: set a default filter for text/plain") Signed-off-by: Robin Jarry <robin@jarry.cc>
* config: set a default filter for text/plainRobin Jarry2022-02-191-0/+1
| | | | | | | | | | | | Avoid the following issue when running aerc with the default configuration: No filter configured for this mimetype ('text/plain') Use a very basic sed command to replace the default plaintext filter. Fixes: bb0f1801402e ("config: do not hardcode sharedir") Signed-off-by: Robin Jarry <robin@jarry.cc>
* config: do not hardcode sharedirRobin Jarry2022-02-192-30/+65
| | | | | | | | | | | | Instead of using a static SHAREDIR at compile time, use a list of standard paths to use at runtime for templates, config files and stylesets. This implies removing all default filters in the default configuration. Replace them with basic commands. New users can configure the filters as they wish. Signed-off-by: Robin Jarry <robin@jarry.cc>
* review: display actual bindings for commandsRobin Jarry2022-02-021-0/+47
| | | | | | | | | Parse the actual user bindings to determine what shortcuts are available in the compose::review stage. Add a predefined list of commands for which we want to display the keyboard shortcuts. Fixes: https://todo.sr.ht/~rjarry/aerc/14 Signed-off-by: Robin Jarry <robin@jarry.cc>
* binds.conf: change default review bindingsRobin Jarry2022-02-021-1/+2
| | | | | | | Add missing :detach binding. Ask user for confirmation when pressing 'q'. Signed-off-by: Robin Jarry <robin@jarry.cc>
* completions: add folder flexible search as an optioninwit2022-01-312-0/+6
| | | | | | | | | | | Provide an option to change the completion style when selecting a folder from completing with folders starting with the input string to completing with folders in which the input string is a substring present at any point in the folder name. References: https://lists.sr.ht/~sircmpwn/aerc/%3C20201129181020.186984-1-inwit%40sindominio.net%3E References: https://lists.sr.ht/~sircmpwn/aerc/%3C20210223202536.199355-1-clayton%40craftyguy.net%3E Signed-off-by: inwit <inwit@sindominio.net>
* compose: add option to never include your own address when replyingjohn1doe@ya.ru2022-01-312-0/+8
| | | | | | | Introduce an option in aerc.conf to disable the auto-including of your own address when replying to your own emails (address replies to the original To: and Cc: instead); default to true (allow the auto-including)
* dirlist: use shorter delay before listing directory contentsRobin Jarry2022-01-292-0/+9
| | | | | | | | | | | | 1 second is a bit excessive. Use 200ms which should cover most quick folder changes. Add an option to make that delay configurable by the users. References: https://todo.sr.ht/~rjarry/aerc/16 Fixes: cb3090956cfd ("dirlist: skip unnecessary change-folder action") Suggested-by: Koni Marti <koni.marti@gmail.com> Signed-off-by: Robin Jarry <robin@jarry.cc>
* binds: Warning on unexistent account bindingsinwit2022-01-241-4/+6
| | | | | | | | | After commit 175d0ef ("binds: add account specific bindings"), when bindings are defined for an account not defined in accounts.conf, aerc quits with an error. After this commit, a warning is logged and aerc ignores those bindings. Signed-off-by: inwit <inwit@sindominio.net>
* bindings: fix ctrl-h binding not workingRobin Jarry2022-01-201-1/+1
| | | | | | | | | For some unknown reason. tcell does not include the ctrl modifier for the ctrl-h key event. Fixes: 7a6c808c042b ("bindings: prepare for more modifers") Fixes: https://todo.sr.ht/~rjarry/aerc/8 Signed-off-by: Robin Jarry <robin@jarry.cc>
* compose: add default template for new messagesRobin Jarry2022-01-192-0/+7
| | | | | | | Allow defining a default template to use when composing new messages. Add an example to be used for new users. Signed-off-by: Robin Jarry <robin@jarry.cc>
* docs: mention missing -T options for compose and forwardRobin Jarry2022-01-191-2/+2
| | | | | | A template file may be specified for compose and forward as well. Signed-off-by: Robin Jarry <robin@jarry.cc>
* config: fix code formattingRobin Jarry2021-12-111-11/+11
| | | | | | | Tabs are required. Fixes: 175d0efeb22e ("binds: add account specific bindings") Signed-off-by: Robin Jarry <robin@jarry.cc>
* binds: add account specific bindingsJonathan Bartlett2021-12-112-53/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using aerc for multiple accounts often bindings might differ slightly between accounts. For example: * Account A archives to one directory (:archive) * Account B archives to monthly directories (:archive month) Add account specific bindings to allow the user to add a "context" to a binding group using a context specifier and a regular expression. Currently the only context specifier is 'account'. The regular expression is validated against the accounts loaded from accounts.conf and the configuration fails to load if there are no matches. Contextual bindings are merged with global bindings, with contextual bindings taking precedence, when that context is active. Bindings are be configured using a generic pattern of 'view:context=regexp'. E.g.: # Globally Applicable Archiving [messages] A = :read<Enter>:archive<Enter> # Monthly Archiving for 'Mailbox' Account [messages:account=Mailbox$] A = :read<Enter>:archive month<Enter> In the above example all accounts matching the regular expression will archive in the monthly format - all others will use the global binding. Signed-off-by: Jonathan Bartlett <jonathan@jonnobrow.co.uk>
* style: customize vertical and horizontal border charactersDian M Fay2021-11-302-0/+38
| | | | | | | | | New border-char-horizontal and border-char-vertical config settings in aerc.conf allow users to modify border appearance from the default 1-wide/tall blank space. In stylesets, border.fg now affects the foreground color when custom characters are defined. Signed-off-by: Robin Jarry <robin@jarry.cc>
* notmuch: allow sort by file orderKalyan Sriram2021-11-131-22/+27
| | | | | | | | | | | | When using the notmuch backend, it often makes more sense to sort folders (actual virtual folders, or queries) by the order specified in the query-map file, rather than alphabetically. This patch introduces a configuration option (disabled by default) that allows this. Additionally, due to the notmuch backend previously using maps (which are order-undefined) to store the list of queries, default query selection on aerc startup fluctuated. This patch fixes that by using slices to store query order.
* binds: add escape to clear searchKalyan Sriram2021-11-131-0/+1
|
* messages: allow displaying email threadsy0ast2021-11-132-0/+9
| | | | | | | | | | | | | Display threads in the message list. For now, only supported by the notmuch backend and on IMAP when the server supports the THREAD extension. Setting threading-enable=true is global and will cause the message list to be empty with maildir:// accounts. Co-authored-by: Kevin Kuehler <keur@xcf.berkeley.edu> Co-authored-by: Reto Brunner <reto@labrat.space> Signed-off-by: Robin Jarry <robin@jarry.cc>
* config: use dynamic time format for default configRobin Jarry2021-11-061-7/+7
| | | | | | New users may find this nicer than a static format. Signed-off-by: Robin Jarry <robin@jarry.cc>