aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* commands: implement fuzzy completion for commands and optionskt programs2022-03-0712-78/+90
| | | | | | | | 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>
* maildir: fix data race in maildir workerwagner riffel2022-03-071-25/+82
| | | | | | | | | | | | | Fix a data race due dirInfo pointer being read in the main goroutine by NewMessageStore and written in the anonymous goroutine launched in Worker.getDirectoryInfo. To address the issue raised in https://todo.sr.ht/~rjarry/aerc/16, we use readdir(3) once, parse and cache its results, this replaces go-maildir library Dir.Flags based stat(3) and filepath.Glob causing the issue when N (emails) is large. Signed-off-by: wagner riffel <w@104d.net>
* contrib: fix desktop fileMoritz Poldrack2022-03-071-11/+1
| | | | | | | | | | A Gentoo user found that the .desktop file was failing validation. Bug: https://bugs.gentoo.org/834145 Link: https://834145.bugs.gentoo.org/attachment.cgi?id=765905 Fixes: 5abc3cab96b7 ("contrib: add xdg desktop entry") Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* filters: fix colorize urls in signaturesRobin Jarry2022-03-031-1/+1
| | | | | | | | | | | | | | | | | When a signature contains a line that starts with an url, the url is not highlighted properly: -- Foobar [38;2;255;255;175mmhttps://foobar.org The trailing m of the signature color start \x1b[38;2;175;135;255m is considered as part of the URL scheme (i.e. mhttps:// instead of https://). Colorize the URLs first before wrapping with the signature color. Fixes: df8c129235d9 ("filters: port colorize to awk") Signed-off-by: Robin Jarry <robin@jarry.cc>
* 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-035-15/+60
| | | | | | | | | | | | | 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>
* readme: add more details about the review processRobin Jarry2022-03-031-3/+34
| | | | | | | | | | | * All patches must be signed-off. * All patches must receive at least one independent review and approval before being applied. * Remove the --in-reply-to= option for git send-email. This breaks lists.sr.ht UI. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: akspecs <akspecs@gmail.com>
* reply: add automatic replacement of localized Re:Moritz Poldrack2022-03-031-6/+10
| | | | | | | | | | Some MUAs (namely Outlook) use localized prefixes for replied-to and forwarded mail. With this patch aerc replaces known localized prefixes and repetitions with the common Re: prefix. Link: https://office-watch.com/2014/outlook-reply-forward-prefixes/ Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* scrollable: extract scrolling behavior for reuseKoni Marti2022-03-034-139/+101
| | | | | | | | | Extract the vertical scrolling ability into its own Scrollable struct that can be embedded and reused across any ui element that relies on scrolling. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* add removal of existing socketsMoritz Poldrack2022-03-031-0/+3
| | | | | | | | | | The kept socket after crashes or unclean exits can lead to a unexpected behaviour. This commit just removes dangling sockets if they exist. Since the "does not exist" error is the best case scenario error handling was deemed unnecessary. Signed-off-by: Moritz Poldrack <git@moritz.sh> 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>
* mk: fix dynamic source dependencies with bsd makeRobin Jarry2022-02-271-1/+1
| | | | | | | | | | | | | | | | | When building with BSD make, running `make` after updating a source file will not cause the binary to be rebuilt. After inspection, it appears that the GOSRC variable only contains "go.mod go.sum". The aerc target does not depend on .go source files. The $(shell) construct is GNU make specific. BSD make has a special assignment operator (!=) which evaluates a shell command. Since GNU make 4.0, the BSD != operator is supported for compatibility. Use a syntax that is available in both make flavours. Link: https://git.savannah.gnu.org/cgit/make.git/commit/?id=b34438bee83ee Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Koni Marti <koni.marti@gmail.com>
* mk: rebuild if goflags or ldflags have changedRobin Jarry2022-02-272-2/+14
| | | | | | | | | | | | | | | Running make with different values for GOFLAGS or VERSION does not cause aerc to be rebuilt whereas it should. Write the go build command line into a file and force aerc to be rebuilt if the command line has changed. Use the BSD make compatible != operator to run the command. This operator is also available in GNU make since version 4.0. Link: https://git.savannah.gnu.org/cgit/make.git/commit/?id=b34438bee83ee Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Koni Marti <koni.marti@gmail.com>
* pipe: allow piping multiple marked messagesRobin Jarry2022-02-252-9/+105
| | | | | | | | | | | | | | | | When messages are marked, pipe their contents into the specified command. The messages are ordered according to their respective Message-Id headers. This allows applying complete patch series with a single command. When piping more than one message, make sure to write them in the mbox format as git am expects them to be. Link: https://en.wikipedia.org/wiki/Mbox Link: https://github.com/git/git/blob/v2.35.1/builtin/mailsplit.c#L15-L44 Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Koni Marti <koni.marti@gmail.com> Tested-by: akspecs <akspecs@gmail.com>
* aerc: always check SelectedAccount return valueRobin Jarry2022-02-259-28/+64
| | | | | | | | | | | | | | | | aerc.SelectedAccount() is used in lots of places. Most of them without checking the return value. In some cases, the currently selected tab is not related to any account (widget.Terminal for example). This can lead to unexpected crashes when accessing account specific configuration. When possible, return an error when no account is currently selected. If no error can be returned, fallback to non-account specific configuration. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Koni Marti <koni.marti@gmail.com>
* ui: make dirlist-delay context-awareinwit2022-02-241-1/+1
| | | | | | | | | | | | | | Allow this in aerc.conf: dirlist-delay=200ms ... [ui:account=CrappyO365Account] dirlist-delay=2000ms Fixes: https://todo.sr.ht/~rjarry/aerc/26 Signed-off-by: Koni Marti <koni.marti@gmail.com> Signed-off-by: inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* threading: implement on-the-fly message threadingKoni Marti2022-02-2410-4/+440
| | | | | | | | | | | | | | | | | | | | 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-233-0/+48
| | | | | | | | 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-236-3/+517
| | | | | | | | | | | | | | 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>
* thread: add method to append new nodeKoni Marti2022-02-231-0/+13
| | | | | | | implement a method function for a *types.Thread receiver to append a new node to its linked list. Signed-off-by: Koni Marti <koni.marti@gmail.com>
* search/filter: display in extra statusRobin Jarry2022-02-234-8/+29
| | | | | | | | | | Add an extra attribute to the status line. When non-empty, display it after the current status. Set that extra status after a successful :search or :filter. Remove it after :clear. Signed-off-by: Robin Jarry <robin@jarry.cc>
* filters: port colorize to awkRobin Jarry2022-02-211-168/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Python is not available on all systems. Port the colorize filter to awk as it is a more widespread POSIX utility. Users are free to copy the filter into their home dir and tweak the colors to their needs. The highlighted items are: =============== ======= ======= ========= ================= Item Red Green Blue Color =============== ======= ======= ========= ================= quoted text 1 95 175 255 Blue quoted text 2 255 135 0 Orange quoted text 3 175 135 255 Purple quoted text 4 255 95 215 Pink quoted text * 128 128 128 Grey diff meta 255 255 255 White bold diff chunk 205 0 205 Cyan diff added 0 205 0 Red diff removed 205 0 0 Green signature 175 135 255 Purple header 175 135 255 Purple url 255 255 175 Yellow =============== ======= ======= ========= ================= This assumes a terminal emulator with true color support and with a dark/black background. Link: https://github.com/termstandard/colors Signed-off-by: Robin Jarry <robin@jarry.cc>
* filters: restore plaintext awk scriptRobin Jarry2022-02-202-0/+17
| | | | | | | | This script is referenced by some users configuration. Restore it to avoid breaking existing setups. Fixes: bca93cd91536 ("filters: add a more complete plaintext filter") Signed-off-by: Robin Jarry <robin@jarry.cc>
* filters: rename plaintext to colorizeRobin Jarry2022-02-202-1/+1
| | | | | | | | This filter script is not compatible with the previous one. Rename it to avoid issues with existing configs. Fixes: bca93cd91536 ("filters: add a more complete plaintext filter") Signed-off-by: Robin Jarry <robin@jarry.cc>
* imap: start reconnect when initial connect failsKoni Marti2022-02-201-3/+11
| | | | | | | Start the reconnect cycle when the initial connect fails. Make the connection observer send a connection error when the imap client is nil. Signed-off-by: Koni Marti <koni.marti@gmail.com>
* mk: bump versionRobin Jarry2022-02-201-1/+1
| | | | | | I should have done this before creating the tag. Signed-off-by: Robin Jarry <robin@jarry.cc>
* main: use terminfo to set window titleRobin Jarry2022-02-203-11/+18
| | | | | | | | | | Parse the terminal capabilities from the TERM environment variable instead of using a hard coded list of terminals. tcell does not expose the status line capabilities. Use another library for this: github.com/xo/terminfo Signed-off-by: Robin Jarry <robin@jarry.cc>
* 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>
* contrib: fix aerc.desktop install pathRobin Jarry2022-02-191-4/+4
| | | | | | | | | Add missing $(PREFIX). Note to self: always test install before accepting patches. Fixes: 5abc3cab96b7 ("contrib: add xdg desktop entry") Signed-off-by: Robin Jarry <robin@jarry.cc>
* search/filter: remove from status bar after 20 secondsRobin Jarry2022-02-191-4/+5
| | | | | | | The status is not cleared. It is annoying. Fixes: c37f1eaaeaa1 ("filter/search: display current search/filter arguments") Signed-off-by: Robin Jarry <robin@jarry.cc>
* filters: add a more complete plaintext filterRobin Jarry2022-02-191-0/+171
| | | | | | Colorize most plain text messages. Signed-off-by: Robin Jarry <robin@jarry.cc>
* config: set a default filter for text/plainRobin Jarry2022-02-192-16/+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>
* contrib: add xdg desktop entryMoritz Poldrack2022-02-192-1/+31
| | | | | | | | Add an XDG desktop file to handle mailto: links, to make it easier to reply to mailing list threads and compose emails with aerc in general. Signed-off-by: Moritz Poldrack <git@moritz.sh> Signed-off-by: Robin Jarry <robin@jarry.cc>
* filter/search: display current search/filter argumentsinwit2022-02-191-2/+3
| | | | | | | Make the statusbar message after search and filter completion more informative by showing the full call that was used. Signed-off-by: inwit <inwit@sindominio.net>
* unsubscribe: parse internationalized headersKoni Marti2022-02-191-1/+5
| | | | | | | Fix the parsing of internationalized headers (RFC 6532). Enable unsubscribe to work with regular and encoded headers. Signed-off-by: Koni Marti <koni.marti@gmail.com>
* imap: reconnect with exponential backoffKoni Marti2022-02-191-4/+28
| | | | | | | | | | | | | waits an increasing amount of time before attempting a reconnect. Wait is capped at 16s. Prevents many reconnect attemps in a short time period. Fixes commit 05ad96a30cb8 ("imap: improve reconnect stability") that improved the reliability of the reconnect mechanism but did not implement controls to prevent the triggering of too many reconnects within a short period of time. Fixes: 05ad96a30cb8 ("imap: improve reconnect stability") Signed-off-by: Koni Marti <koni.marti@gmail.com>
* config: do not hardcode sharedirRobin Jarry2022-02-197-51/+102
| | | | | | | | | | | | 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>
* imap: improve reconnect stabilityKoni Marti2022-02-062-8/+22
| | | | | | | | | | | | | | | | improves the robustness of the imap reconnect feature which was introduced in commit beae17a6da37 ("imap: auto-reconnects on connection error"). If a connection error is emitted, the message list is cleared and a corresponding error message is shown in the ui. Status bar is updated as well. Upon reconnect, the directories and the message list will be re-fetched (same behavior as the connect command). Reconnect can be enabled and disabled with the connect and the disconnect commands. Signed-off-by: Koni Marti <koni.marti@gmail.com>
* postpone: re-open review mode on errorKoni Marti2022-02-061-4/+9
| | | | | | | | | re-opens the review UI when the postpone operation fails. Before, the composer would close, even on error, and we would lose the email draft. Now, the user can decide on how to proceed when postponing fails. References: https://lists.sr.ht/~rjarry/aerc-devel/patches/28824 Signed-off-by: Koni Marti <koni.marti@gmail.com>
* readme: add license infoRobin Jarry2022-02-061-0/+2
| | | | Signed-off-by: Robin Jarry <robin@jarry.cc>
* readme: remove #aerc-devel irc channelRobin Jarry2022-02-061-2/+1
| | | | | | | This channel has not received much activity and all development discussions are happening on #aerc. No need to multiply channels. Signed-off-by: Robin Jarry <robin@jarry.cc>
* imap: do not abort on malformed messagesRobin Jarry2022-02-061-1/+7
| | | | | | | | | | | | | | Some messages contain invalid headers, textproto.ReadHeader fails with an error: malformed MIME header key: From nobody Fri Jan 14 19 And all other messages of the selected folder are ignored. Return an explicit error message to the UI and continue processing other messages. This is consistent with what the maildir worker does. Signed-off-by: Robin Jarry <robin@jarry.cc>
* LICENSE: add license nameRobin Jarry2022-02-061-1/+3
| | | | | | | It is not obvious by reading the license text that aerc is distributed under the MIT license. Explicitly state it. Signed-off-by: Robin Jarry <robin@jarry.cc>
* lib/ui/textinput: stop at /, ", and ' charsPranjal Kole2022-02-031-5/+11
| | | | This matches the default behaviour of Ctrl+W in vim.
* compose: allow setting all headers in templatesRobin Jarry2022-02-032-2/+6
| | | | | | | Allow setting To, Cc, Subject, Bcc in template headers. Fixes: https://todo.sr.ht/~rjarry/aerc/19 Signed-off-by: Robin Jarry <robin@jarry.cc>
* review: display actual bindings for commandsRobin Jarry2022-02-022-8/+99
| | | | | | | | | 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>
* mk: use debug to generate a non-optimized binaryRobin Jarry2022-02-022-3/+8
| | | | | | | | Do not use this to run the debugger. Instead, build a non-optimized binary and display what command should be executed to attach to a running program. Signed-off-by: Robin Jarry <robin@jarry.cc>
* completions: add folder flexible search as an optioninwit2022-01-314-1/+26
| | | | | | | | | | | 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-314-0/+28
| | | | | | | 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)