aboutsummaryrefslogtreecommitdiffstats
path: root/config
Commit message (Collapse)AuthorAgeFilesLines
* dirtree: add dirtree-collapse config settingSijmen2022-08-222-0/+7
| | | | | | | | | | | | | Adds a setting to the configuration to choose at which level the folders in the dirtree are collapsed by default. In my case, this is useful because my organisation has some rather deep nesting in the folder structure, and a _lot_ of folders, and this way I can keep my dirtree uncluttered while still having all folders there if I need them. Signed-off-by: Sijmen <me@sijman.nl> Acked-by: Koni Marti <koni.marti@gmail.com>
* binds: display active keybinds in a dialog boxKoni Marti2022-08-222-5/+6
| | | | | | | | | Show contextual keybinds in a textbox when using the ':help keys' command. This command is bound to '?' by default. Fixes: https://todo.sr.ht/~rjarry/aerc/42 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* go: removed io/ioutilMoritz Poldrack2022-08-221-3/+2
| | | | | | | | | | Since the minimum required version of Go has been bumped to 1.16, the deprecation of io/ioutil can now be acted upon. This Commit removes the remaining dependencies on ioutil and replaces them with their io or os counterparts. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* bindings: fix FormatKeyStrokes for <tab> and <enter>Robin Jarry2022-08-101-1/+4
| | | | | | | | | | | Sometimes, a <tab> or <enter> key in a binding will be formatted as a <c-i> or <c-m> respectively. This is because these keys are equivalent. Prefer their canonical name instead of the control modifier variant. Fixes: 5e600d7ab46b ("binds: fix ctrl-i and ctrl-m key definitions") Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Koni Marti <koni.marti@gmail.com>
* lint: work nicely with wrapped errors (errorlint)Moritz Poldrack2022-08-041-4/+4
| | | | | | | | Error wrapping as introduced in Go 1.13 adds some additional logic to use for comparing errors and adding information to it. Signed-off-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: homogenize operations and minor fixes (gocritic)Moritz Poldrack2022-08-042-34/+38
| | | | | | | | | | | | | | | | | | Apply GoDoc comment policy (comments for humans should have a space after the //; machine-readable comments shouldn't) Use strings.ReplaceAll instead of strings.Replace when appropriate Remove if/else chains by replacing them with switches Use short assignment/increment notation Replace single case switches with if statements Combine else and if when appropriate Signed-off-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: ensure errors are at least logged (errcheck)Moritz Poldrack2022-08-041-1/+4
| | | | | Signed-off-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: fix ineffective assignments (SA4005)Moritz Poldrack2022-08-041-1/+0
| | | | | Signed-off-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* filters: make it explicit that encoding is UTF-8q3cpma2022-08-031-0/+1
| | | | | | | | | | Document filter input charset Add w3m filter example to default config Adapt html and html-unsafe filters Fixes: https://todo.sr.ht/~rjarry/aerc/65 Signed-off-by: q3cpma <q3cpma@posteo.net> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: apply new formatting rulesMoritz Poldrack2022-08-014-27/+27
| | | | | | | Run `make fmt`. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* outgoing-cred-cmd: delay execution until an email needs to be sentStas Rudakou2022-07-311-42/+53
| | | | | | | | | | | | | | | | | | This can be useful in cases when: 1. outgoing-cred-cmd requires a user action or confirmation (e.g. when using pass with a Yubikey or similar smart card that requires a user to enter a pin or touch the device when decrypting the password) 2. A user starts aerc frequently, but not all the sessions end up with sending emails 3. So the user only wants to execute outgoing-cred-cmd when the password is really used, so the user doesn't have to enter pin or touch their Yubikey each time aerc starts Signed-off-by: Stas Rudakou <stas@garage22.net> Acked-by: Robin Jarry <robin@jarry.cc>
* threads: debounce client-side thread buildingKoni Marti2022-07-262-0/+7
| | | | | | | | | | | | | | | | Debounce client-side thread building in the message store. Debouncing is useful when multiple messages are loaded, i.e. when scrolling with PgUp/PgDown. Without the debouncing, all client-side threads will be built everytime the message store is updated which creates a noticable lag in the message list ui when client-side threading is activated. The default debouncing delay can be changed by changing 'client-threads-delay' in the UI config section. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* logging: print init procedure and config contentsRobin Jarry2022-07-231-5/+25
| | | | | | | This may help debugging issues. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* logging: use level-based logger functionsRobin Jarry2022-07-232-5/+7
| | | | | | | | | | | | Do not pass logger objects around anymore. Shuffle some messages to make them consistent with the new logging API. Avoid using %v when a more specific verb exists for the argument types. The loggers are completely disabled (i.e. Sprintf is not even called) by default. They are only enabled when redirecting stdout to a file. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* doc: fix typosRobin Jarry2022-07-181-1/+1
| | | | | | | | These were reported by lintian when packaging aerc 0.11.0. There are probably others. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* binds: fix ctrl-i and ctrl-m key definitionsRobin Jarry2022-07-171-2/+2
| | | | | | | | | | | | | | | | On all terminals, ctrl-i sends a tab character (0x09). For some reason, tcell.ModCtrl+tcell.KeyCtrlI is interpreted as ctrl-tab. Similarly, ctrl-m sends a new line (0x0a) and tcell.ModCtrl+tcell.KeyCtrlM is interpreted as ctrl-enter. Remove control modifier for these two key definitions only. All others do not work without them. Fixes: 7a6c808c042b ("bindings: prepare for more modifers") Fixes: https://todo.sr.ht/~rjarry/aerc/56 Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: allow per-account address-book-cmdRobin Jarry2022-07-172-0/+5
| | | | | | | | When using multiple accounts, the contacts may be different. Allow using specific address book commands per account. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* threading: add force-client-threads optionTim Culverhouse2022-07-102-0/+6
| | | | | | | | | | | | | | | | | | | | This patch adds a config option to force the use of client side threads. This option will override a servers Thread capability, and only build threads on the client. It can be enabled contextually. For example: [ui] threading-enabled = true [ui:folder~^Archive] force-client-threads = true This config would enable threads for all views, and use client threads for folders that start with Archive. This can be advantageous if, for example, the folder is very large and the server has a slow response due to building threads for the entire mailbox Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* threading: enable toggle-threads for server-side threadsTim Culverhouse2022-07-101-4/+2
| | | | | | | | | | Enable the :toggle-threads command to work for workers which have Thread capability. The implementation of that feature has the side effect that the threading-enabled config option now sets the default view (threaded or not threaded) for any worker, not just IMAP or notmuch. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* 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>