aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* completion: install panic handler in completion callbackRobin Jarry2022-03-251-0/+2
| | | | | | | | | This callback is actually invoked in a goroutine by time.AfterFunc. The panic handler must be explicitly installed. Link: https://github.com/golang/go/blob/go1.18/src/time/sleep.go#L160-L173 Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* show-ics-details.py: fix error with python < 3.9Jens Grassel2022-03-241-16/+16
| | | | | | | | Change the pattern matching into a if/elif construct because pattern matching is not supported on python < 3.9. Signed-off-by: Jens Grassel <jens@wegtam.com> Acked-by: Robin Jarry <robin@jarry.cc>
* save: add -a option to save all attachmentsRobin Jarry2022-03-243-18/+69
| | | | | | | | | | Allow saving all message parts that have the content disposition "attachment" header to a folder. Suggested-by: Ondřej Synáček <ondrej@synacek.org> Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Koni Marti <koni.marti@gmail.com> Tested-by: Moritz Poldrack <moritz@poldrack.dev>
* logging: fix race condition in startupMoritz Poldrack2022-03-244-7/+14
| | | | | | | | | If a panic occurs in one of the workers, it can happen after the UI was initialised, but before the cleanup function has been registered. With this the start of the worker loops is deferred until the cleanup routine was registered. Signed-off-by: Moritz Poldrack <git@moritz.sh>
* readme: add ~rjarry/aerc-discuss@lists.sr.ht in resourcesRobin Jarry2022-03-241-2/+5
| | | | | | | Add a reference to a new end-user discussion list. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Moritz Poldrack <moritz@poldrack.dev>
* readme: add links to documentationRobin Jarry2022-03-241-3/+20
| | | | | | | Let's make it easier for new users to find information. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Moritz Poldrack <moritz@poldrack.dev>
* threading: fix msg-id order in references headerKoni Marti2022-03-231-5/+17
| | | | | | | | | | | Fix order in the references header when an in-reply-to msg-id is erroneously added at the beginning instead of at the end. Add description to the function that cleans up the reference headers for threading. Reported-by: Evan Gates <evan.gates@gmail.com> Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* Add filter script for ics files.Jens Grassel2022-03-232-0/+90
| | | | | | | | This is a python script for python 3 using the vobject library to show details about an ics file (text/calendar attachment). Signed-off-by: Jens Grassel <jens@wegtam.com> Tested-by: Moritz Poldrack <moritz@poldrack.dev>
* logging: added a log on panicMoritz Poldrack2022-03-2327-23/+161
| | | | | | | | | | | | | Since panics still regularly "destroy" the terminal, it is hard to get a stack trace for panics you do not anticipate. This commit adds a panic handler that automatically creates a logfile inside the current working directory. It has to be added to every goroutine that is started and will repair the terminal on a panic. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* statusline: make statusline folder-specificKoni Marti2022-03-234-46/+67
| | | | | | | | | | | | Make statusline folder-specific. Update filter, search and threading status when changing folders. Commit 2512c04 ("statusline: implement per-account status") introduced an account-specific statusline. This makes it account- and folder-specific. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Moritz Poldrack <moritz@poldrack.dev>
* compose: make headerEditor focusing more reliableTim Culverhouse2022-03-223-22/+10
| | | | | | | | | | | | Focusing header editors was hardcoded as integers which only worked with the default ui. If a user changed the UI to, for example, put CC as a field below "to", FocusSubject would focus the CC field instead of the subject. This commit reuses and modifies the function FocusEditor to generalize the focusing of header editors - which can now be called by name via FocusEditor(name string) Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* threading: fix stack overflow from faulty headersKoni Marti2022-03-221-1/+13
| | | | | | | | | | | Fix stack overflow from faulty headers that cause a circularity in the threading algorithm. Remove duplicated message-ids in the references headers. Check that the message-id itself is not part of the references. Fixes: https://todo.sr.ht/~rjarry/aerc/32 Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Robin Jarry <robin@jarry.cc> Acked-by: Robin Jarry <robin@jarry.cc>
* Release version 0.9.00.9.0Robin Jarry2022-03-211-1/+1
| | | | Signed-off-by: Robin Jarry <robin@jarry.cc>
* readme: fix typoRobin Jarry2022-03-211-1/+1
| | | | | Fixes: 7e6c0d2e6e8c ("readme: add more details about the review process") Signed-off-by: Robin Jarry <robin@jarry.cc>
* msglist: update message counter upon filter changeKoni Marti2022-03-202-0/+17
| | | | | | | | | | | | | | | | Update message counter in msglist when the filter is changed (either set or cleared in the msgstore). When we apply a filter, we change the number of uids in the message store. This can unintentionally trigger the storeUpdate() function of the msglist which checks the number of uids for new messages and advances the pointer by the difference in the number of messages. This can be avoided when we update the message counter upon changing the filter. Fixes: https://todo.sr.ht/~rjarry/aerc/23 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* store: fix deleting messages in filter modeKoni Marti2022-03-201-0/+8
| | | | | | | | | | | fix deleting messages when in filter mode. Link: https://lists.sr.ht/~rjarry/aerc-devel/%3CCIO3IVSM2JUB.3L46NM6LJZ2KB%40Archetype%3E Reported-by: Moritz Poldrack <git@moritz.sh> Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* statusline: update status only when necessaryKoni Marti2022-03-201-1/+6
| | | | | | | | | | | | | Update statusline only when changed to reduce cpu usage. commit 2512c0403fa4 ("statusline: implement per-account status") updates the status irrespective of whether the statusline changed or not. This can lead to high cpu usage that can be avoided. Reported-by: Jens Grassel <jens@wegtam.com> Reported-by: inwit <inwit@sindominio.net> Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* statusline: implement per-account statusKoni Marti2022-03-1810-45/+196
| | | | | | | | | | | | | | | | Implement a statusline state for each account. Keep the ex line and the push notifications global. Add account name prefix to push notifications. Prefix status line with account name when multiple accounts are available. Use account-specific status line for each tab where an account is defined. Handle threading, filter/search, viewer passthrough and connection status. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* colorize: handle mailto prefixes in urlsRobin Jarry2022-03-181-1/+1
| | | | | | | | | mailto:email@domain.tld is the only exception that does not use the <scheme>:// prefix. Requested-by: Moritz Poldrack <moritz@poldrack.dev> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Moritz Poldrack <moritz@poldrack.dev>
* mailto: handle bcc and body fieldsTim Culverhouse2022-03-181-0/+10
| | | | | | | Enable handling of bcc and body fields in mailto links Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> 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>
* go vet: unreachable codeMoritz Poldrack2022-03-181-5/+0
| | | | | | | | 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>
* go vet: composite literal uses unkeyed fieldsMoritz Poldrack2022-03-1815-102/+102
| | | | | | | | 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>
* mailto: allow empty recipient fieldTim Culverhouse2022-03-181-1/+4
| | | | | | | | Allow a mailto link to open a new composer even if no recipient is in the url. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Moritz Poldrack <git@moritz.sh>
* commands: use SelectedAccountUiConfig instead of explicit nil checkkt programs2022-03-163-19/+5
| | | | | | | Remove code duplication and provide completion even when acct is nil Signed-off-by: kt programs <ktprograms@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* commands: fix possible panic in CompletionFromListkt programs2022-03-161-1/+1
| | | | | | | Panic might occur if aerc.SelectedAccount() is nil Signed-off-by: kt programs <ktprograms@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* store: allow consecutive filter and search queriesKoni Marti2022-03-141-7/+21
| | | | | | | | | | | | Enable consecutive filter and search queries. Filter narrows down message list consecutively and clears search results. Search applies to the current message list. Fixes: https://todo.sr.ht/~rjarry/aerc/24 Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Tested-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* bindings: fix panic for terminal keybindKoni Marti2022-03-141-1/+1
| | | | | | | | | | Fix panic in the GetCompletions function when using the keybind for the terminal command. Fixes: https://todo.sr.ht/~rjarry/aerc/29 Reported-by: inwit <inwit@sindominio.net> Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* viewer: add key passthrough modekt programs2022-03-146-24/+91
| | | | | | | | | | | | | | | | 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>
* all: fix minor issues found by staticcheckMoritz Poldrack2022-03-1211-27/+17
| | | | Signed-off-by: Moritz Poldrack <git@moritz.sh>
* threading: honor user-defined sort criteriaKoni Marti2022-03-093-50/+70
| | | | | | | | | | | | | | | Apply the user-defined sort criteria to the message with the highest uid in a threaded discussion. Restore the default sort order when leaving threading mode. Commit 7811620eb809 ("threading: implement on-the-fly message threading") introduced message threading with the threaded messages being only sorted by their message uids irrespective of the defined sorting criteria. It did not restore the default sort order either. Reported-by: Sebastien Binet <s@sbinet.org> Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* 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>