aboutsummaryrefslogtreecommitdiffstats
path: root/config
Commit message (Collapse)AuthorAgeFilesLines
* logging: rename package to logRobin Jarry2022-12-0211-36/+36
| | | | | | | | | | Use the same name than the builtin "log" package. That way, we do not risk logging in the wrong place. Suggested-by: Tim Culverhouse <tim@timculverhouse.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* logging: homogenize levelsRobin Jarry2022-12-022-2/+2
| | | | | | | | | | | | | | | | | | The main goal is to ensure that by default, the log file (if configured) does not grow out of proportions. Most of the logging messages in aerc are actually for debugging and/or trace purposes. Define clear rules for logging levels. Enforce these rules everywhere. After this patch, here is what the log file looks like after starting up with a single account: INFO 2022/11/24 20:26:16.147164 aerc.go:176: Starting up version 0.13.0-100-g683981479c60 (go1.18.7 amd64 linux) INFO 2022/11/24 20:26:17.546448 account.go:254: [work] connected. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* config: fix [filters] orderingRobin Jarry2022-11-241-6/+5
| | | | | | | | | | | | | | | | | | | Using KeysHash() does not guarantee any stable ordering of elements. This causes random weirdness when some filters are using wildcards: [filters] text/plain=colorize text/html=html text/*=bat -fP --file-name="$AERC_FILENAME" --style=plain When the source order is not preserved, the text/* filter may be matched first against text/plain or text/html parts. Use Keys() which does not create a map and preserve original ordering. Fixes: 17bb9387c4a3 ("config: move [filters] parsing to separate file") Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* config: sanitize default valuesRobin Jarry2022-11-241-59/+52
| | | | | | | | | | | | | Remove `Default: none` or `Default: ""` statements which may be confusing. If there is no default value, simply do not mention a default value. Comment all settings in aerc.conf so that real default values are used. Adjust man pages. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Koni Marti <koni.marti@gmail.com>
* compose binds: add backtab to field cycleBence Ferdinandy2022-11-211-0/+1
| | | | | | | | Currently we have tab to go forward among the tabs, but not backwards. Add backtab bound to prev-field to make the defaults symmetrical. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* attach: open file picker menu with -m flagKoni Marti2022-11-212-0/+9
| | | | | | | | | | | | | | | | | | | | | Open a user-defined file picker with the -m flag for the attach command to select attachments. Specify your file picker of choice with the 'file-picker-cmd' in the [composer] section of aerc.conf, e.g. "file-picker-cmd=fzf -m". A '%s' placeholder can be used in the 'file-picker-cmd' which is then substituted for the argument <arg> provided to :attach -m <arg>. For example, when you set 'file-picker-cmd=find %s -type f | fzf -m', you can easily change the directory to start the search with ':attach -m <path-to-search>'. Tested with fzf, fzy and peco. Implements: https://todo.sr.ht/~rjarry/aerc/108 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* config: add log-file and log-level settingsRobin Jarry2022-11-214-14/+57
| | | | | | | | | | | Allow configuring persistent logging to file with a log level. When redirecting the output of aerc to a file these two settings are ignored and all messages are printed to stdout. Suggested-by: Moritz Poldrack <moritz@poldrack.dev> Suggested-by: Tim Culverhouse <tim@timculverhouse.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* config: move [triggers] parsing in proper fileRobin Jarry2022-11-162-19/+20
| | | | | | | | | | The config.go file is getting too big. Move the aerc.conf [triggers] section parsing logic into a dedicated triggers.go file. No functional change. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: move [openers] parsing in separate fileRobin Jarry2022-11-162-13/+32
| | | | | | | | | | The config.go file is getting too big. Move the aerc.conf [openers] section parsing logic into a dedicated openers.go file. No functional change. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: move [statusline] in separate fileRobin Jarry2022-11-162-29/+45
| | | | | | | | | | | | | The config.go file is getting too big. Move the aerc.conf [statusline] section parsing logic into a dedicated statusline.go file. No functional change. Please ignore the casual "realignment" of fields in the default config initialization. Thanks gofmt. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: move [viewer] parsing in separate fileRobin Jarry2022-11-162-37/+58
| | | | | | | | | | The config.go file is getting too big. Move the aerc.conf [viewer] section parsing logic into a dedicated viewer.go file. No functional change. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: move [compose] parsing in separate fileRobin Jarry2022-11-162-41/+63
| | | | | | | | | | The config.go file is getting too big. Move the aerc.conf [compose] section parsing logic into a dedicated compose.go file. No functional change. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: move [filters] parsing to separate fileRobin Jarry2022-11-162-47/+71
| | | | | | | | | | The config.go file is getting too big. Move the aerc.conf [filters] section parsing logic into a dedicated filters.go file. No functional change. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: move [general] parsing in separate fileRobin Jarry2022-11-162-35/+51
| | | | | | | | | | The config.go file is getting too big. Move the aerc.conf [general] section parsing logic into a dedicated general.go file. No functional change. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: move [templates] parsing in separate fileRobin Jarry2022-11-162-46/+67
| | | | | | | | | | The config.go file is getting too big. Move the aerc.conf [templates] section parsing logic into a dedicated templates.go file. No functional change. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: move [ui] parsing in separate fileRobin Jarry2022-11-162-316/+345
| | | | | | | | | | | | | | | | | | | | | The config.go file is getting too big. Move the aerc.conf [ui] section parsing logic into a dedicated ui.go file. Add a defaultUiConfig() function to also get the default configuration values in a separate file. Extract fragmented bits of code in AercConfig.parseConfig() in a new AercConfig.parseUi() function defined in ui.go. Change parseUiConfig() into a UIConfig.parse() method. Change some methods receiver args to pointers to avoid unnecessary copies. No functional change. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: move binds.conf parsing in binds.goRobin Jarry2022-11-162-191/+207
| | | | | | | | | | The config.go file is getting too big. Move all binds.conf parsing logic into binds.go where it belongs. No functional change. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: move accounts.conf parsing in separate fileRobin Jarry2022-11-162-250/+257
| | | | | | | | | | The config.go file is getting too big. Move accounts.conf parsing logic into a dedicated accounts.go file. No functional change. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: rename bindings -> bindsRobin Jarry2022-11-162-0/+0
| | | | | | | For consistency with binds.conf Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: remove unused Ini fieldRobin Jarry2022-11-161-3/+0
| | | | | | | There is no point in keeping an open reference to the ini file. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* reply: allow to override localized Re regexp in configurationjp392022-11-131-0/+10
| | | | | | | | | | | | | | | My corporate email server annoyingly adds an "[External] " prefix when delivering emails from outside my organization. I'd like to be able to automatically strip it from the subject line when replying to external emails. With this patch, I can achieve it by setting this line in my account configuration: subject-re-pattern = ^(\[External\] : )?((?i)((AW|RE|SV|VS|ODP|R): ?)+) Signed-off-by: jp39 <jp39@gmx.com> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* filters: export more info to filter processesRobin Jarry2022-11-131-0/+3
| | | | | | | Export some more environment variables to the pager commands. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Koni Marti <koni.marti@gmail.com>
* style: add italic optionTim Culverhouse2022-11-091-1/+13
| | | | | | | | Add italic option to style config. Update docs. Suggested-by: inwit <inwit@sindominio.net> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* composer: add message previewKoni Marti2022-11-091-0/+1
| | | | | | | | | | Add message preview to the composer. Add preview option to the review window. Open the message in a message viewer before sending to check the headers and attachments. Implements: https://todo.sr.ht/~rjarry/aerc/86 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* msglist: style search resultsTim Culverhouse2022-11-062-0/+3
| | | | | | | | Add option to style search results in the message list. Set default style for results. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* status: add warning style and methodsTim Culverhouse2022-11-062-0/+4
| | | | | | | | Add a warning style to default statusline. Add methods to status, aerc, and account to push a warning message. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* threadbuilder: sort siblings by sort criteriaKoni Marti2022-11-062-0/+10
| | | | | | | | | | | | | | Sort the client-side thread siblings according to the sort criteria. Activate this option by setting "sort-thread-siblings" to true in the ui section of aerc.conf. "sort-thread-siblings" is false by default and the siblings will be sorted based on their uid number. Note that this options will only work with client-side threading and when the backend supports sorting. Also, it comes with a slight performance penalty. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* auto-completion: add option to require a min number of charsRobin Jarry2022-11-062-0/+8
| | | | | | | | | | When doing address completion via commands that take a while to run, having the completion trigger even with a single character can be non-optimal. Add an option to allow requiring a minimum number of characters to actually run the completion command. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* threads: reverse thread orderingKoni Marti2022-10-272-1/+10
| | | | | | | | | | | Add reverse-thread-order option to the ui config to enable reverse display of the mesage threads. Default order is the the intial message is on the top with all the replies being displayed below. The reverse options will put the initial message at the bottom with the replies on top. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* store: reverse message list order with iteratorsKoni Marti2022-10-272-0/+11
| | | | | | | | | | | | | | | | | Reverse the order of the messages in the message list. The complexity of reversing the order is abstracted away by the iterators. To reverse the message list, add the following to your aerc.conf: [ui] reverse-msglist-order=true Thanks to |cos| for sharing his initial implementation of reversing the order in the message list [0]. [0]: https://git.netizen.se/aerc/commit/?h=topic/asc_sort_imap Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* msgview: add separate date formattingBence Ferdinandy2022-10-191-38/+55
| | | | | | | | | | The ThisDayTimeFormat and friends are missing from the message view which just uses the message list's default setting. This might not be desirable since the amount of space available is different. Introduce separate settings for formatting dates in the message view. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: check for bad white space habitsRobin Jarry2022-10-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A little coding hygiene cannot hurt. Add a simple awk script to check all source files for bad white space habits: - trailing white space - trailing new lines at the end of files - missing new line at the end of files - spaces followed by tabs The script outputs color when the terminal supports it. It exits with a non-zero code when there was at least one white space issue found. Call the script in the lint step. Example output of the awk script: config/default_styleset:1:# <-- trailing whitespace config/default_styleset:3:# <-- trailing whitespace doc/aerc.1.scd:78: Executes an arbitrary command in the background. Aerc will set the <-- trailing whitespace doc/aerc.1.scd:234: <-- trailing whitespace doc/aerc.1.scd:237: <-- trailing whitespace worker/types/thread_test.go:74: // return ErrSkipThread<-- space(s) followed by tab(s) worker/lib/testdata/message/invalid/hexa: trailing new line(s) Fix issues reported by the script. NB: The ENDFILE match is a GNU extension. It will be ignored on BSD-awk and trailing new lines will not be detected. The lint make target is only invoked on alpine linux which has GNU awk anyway. NB: Empty cells in scdoc tables require trailing white space... Avoid this by setting content in these cells. I don't really see a use for empty cells. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Moritz Poldrack <moritz@poldrack.dev>
* compose: warn before sending without attachmentJason Cox2022-10-172-4/+29
| | | | | | | | | | Prevent the embarrassing forgotten attachment scenario by warning the user before sending a message that may need an attachment but does not have one. Whether a message needs an attachment is determined by testing a configurable regex against the message body. Signed-off-by: Jason Cox <dev@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* filters: export mime type and filename in envRobin Jarry2022-10-161-0/+6
| | | | | | | | | | | Export AERC_MIME_TYPE and AERC_FILENAME in the filters command environment. This allows dynamic coloring with tools that require a filename and/or a mime type to determine the syntax. Update docs and add example use in the default config file. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: reference built-in filter scriptsRobin Jarry2022-10-161-4/+10
| | | | | | | | | | | | | Now that the share/filters folders are in $PATH when running the commands, let's reference the scripts by their name. Add more filter examples, some of them using the built-in filters, some of them not... Suggested-by: Teo Luppi <me@luppi.uk> Suggested-by: Bence Ferdinandy <bence@ferdinandy.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* filters: append well known dirs to exec PATHRobin Jarry2022-10-162-3/+11
| | | | | | | | | | | | | | | | | | | To allow referencing built-in filters without hard coding a path during installation, append the following folders to the exec PATH when running the filter commands: ~/.config/aerc/filters ~/.local/share/aerc/filters $PREFIX/share/aerc/filters /usr/share/aerc/filters If a filter script has the same name than a command in the default exec PATH, it will not shadow it. In that edge case, the absolute path to the filter script must be specified. Suggested-by: Teo Luppi <me@luppi.uk> Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* viewer: option to not mark message as seenKoni Marti2022-10-042-0/+8
| | | | | | | | | | | | | | | | | Add option to open a message in the message viewer without setting the seen flag. Enables the message viewer to be used as a preview pane without changing the message flags unintentionally. Before, the message viewer would set the seen flag by default. The IMAP backend will now always fetch the message body with the peek option enabled (same as we fetch the headers). An "auto-mark-read" option is added to the ui config which is set to true by default. If set the false, the seen flag is not set by the message viewer. Co-authored-by: "James Cook" <falsifian@falsifian.org> Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* open: allow overriding default programRobin Jarry2022-10-012-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | Instead of xdg-open (or open on MacOS), allow forcing a program to open a message part. The program is determined in that order of priority: 1) If :open has arguments, they will be used as command to open the attachment. If the arguments contain the {} placeholder, the temporary file will be substituted, otherwise the file path is added at the end of the arguments. 2) If a command is specified in the [openers] section of aerc.conf for the part MIME type, then it is used with the same rules of {} substitution. 3) Finally, fallback to xdg-open/open with the file path as argument. Update the docs and default config accordingly with examples. Fixes: https://todo.sr.ht/~rjarry/aerc/64 Co-authored-by: Jason Stewart <support@eggplantsd.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: add default-save-path in default aerc.confRobin Jarry2022-09-251-0/+7
| | | | | | | | This setting has been around for ages but not in the default aerc.conf file. Add it to make it more visible to new users. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: remove default values for this-*-time-formatRobin Jarry2022-09-252-9/+9
| | | | | | | | | | | | | | | Having a default value is confusing because to disable the dynamic time format, the users need to explicitly configure these settings to the empty string. Do not set default values for these settings when they are unset in the configuration. Comment the default config file values to serve as examples. Fixes: aae29324fdf5 ("config: fix default time format values") Reported-by: Nicolai Dagestad <nicolai@dagestad.fr> Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* switch: add -n and -p flags for relative switchRobin Jarry2022-09-201-0/+2
| | | | | | | | | Allow switching to next or previous account with switch-account -n and switch-account -p, respectively. By default, these are bound to Alt-n and Alt-p. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Koni Marti <koni.marti@gmail.com>
* binds: allow typing ? in subject headerRobin Jarry2022-09-201-0/+3
| | | | | | | | | | | | | | | Since commit 5c8a749cfa97 ("binds: display active keybinds in a dialog box") the ? key is bound to `:help keys` in the global section which applies to all binding contexts. Pressing ? while editing any email headers in the compose window (when the editor is not selected) displays the active bindings menu. Add $noinherit=true in the [compose] context to allow typing any character. Copy the bindings for next-tab and prev-tab so that users can still change tabs while editing headers. Cc: Akspecs <akspecs@gmail.com> Signed-off-by: Robin Jarry <robin@jarry.cc>
* config: add option to hide timezone in sent emailsMoritz Poldrack2022-09-141-0/+1
| | | | | | | | | | | | Some people are worried that they might leak their timezone and wish to send their mails with the Date header in UTC. For this a new key is added to the account sections to enforce sending in UTC instead of the system's timezone. Suggested-by: "Ricardo Correia" <aerc-lists.sr.ht@wizy.org> Thanks: to Ricardo for checking and correcting my incorrect assertions Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* bindings: add alt modifierJohn Gebbie2022-09-131-0/+39
| | | | | | | Enables bindings like <A-left>. Signed-off-by: John Gebbie <me@johngebbie.com> Acked-by: Robin Jarry <robin@jarry.cc>
* config: keep cache of resolved credential commandsRobin Jarry2022-09-101-11/+25
| | | | | | | | | | | | | | | | | | outgoing-cred-cmd is used to retrieve the password from a password manager such as UNIX pass or bitwarden CLI. These tools often prompt for a passphrase to secure the passwords and it is annoying having to enter it every time sending an email with aerc. Add a new option outgoing-cred-cmd-cache (default to true) to control whether aerc will keep a cache of the password or run outgoing-cred-cmd every time an email needs to be sent. NB: If the cached password is incorrect, the only way to change it is to restart aerc. Fixes: ca9034385029 ("outgoing-cred-cmd: delay execution until an email needs to be sent") Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* main: change account order sortTobias Wölfel2022-09-101-1/+1
| | | | | | | Sort the accounts based on case insensitive names. Signed-off-by: Tobias Wölfel <tobias.woelfel@mailbox.org> Acked-by: Robin Jarry <robin@jarry.cc>
* config: move ui config parse in functionRobin Jarry2022-09-081-42/+38
| | | | | | | | | | Avoid repetition. Also, commit de24d2d5909a ("config: fix setting of zero-value time.Duration config values") did not apply to contextual ui config sections. Fix that. Fixes: de24d2d5909a ("config: fix setting of zero-value time.Duration config values") Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* config: fix default time format valuesRobin Jarry2022-09-082-5/+5
| | | | | | | | Adjust default values in config.go to follow what is set in the default aerc.conf file. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* main: add cli flag to load specified account(s)Tim Culverhouse2022-08-221-3/+25
| | | | | | | | | | Make it possible to specify which account(s) to load. Preserve listed order when creating account tabs. aerc -a <account-name[,account-name]> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* 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>