summaryrefslogtreecommitdiff
path: root/commands
AgeCommit message (Collapse)Author
2022-03-14bindings: fix panic for terminal keybindKoni Marti
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>
2022-03-14viewer: add key passthrough modekt programs
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>
2022-03-12all: fix minor issues found by staticcheckMoritz Poldrack
Signed-off-by: Moritz Poldrack <git@moritz.sh>
2022-03-07commands: implement fuzzy completion for commands and optionskt programs
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>
2022-03-03reply: add automatic replacement of localized Re:Moritz Poldrack
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>
2022-02-25pipe: allow piping multiple marked messagesRobin Jarry
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>
2022-02-25aerc: always check SelectedAccount return valueRobin Jarry
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>
2022-02-24threading: implement on-the-fly message threadingKoni Marti
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>
2022-02-23commands: add expand-folder and collapse-folderKoni Marti
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>
2022-02-23search/filter: display in extra statusRobin Jarry
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>
2022-02-19search/filter: remove from status bar after 20 secondsRobin Jarry
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>
2022-02-19filter/search: display current search/filter argumentsinwit
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>
2022-02-19unsubscribe: parse internationalized headersKoni Marti
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>
2022-02-06postpone: re-open review mode on errorKoni Marti
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>
2022-01-31completions: add folder flexible search as an optioninwit
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>
2022-01-31compose: add option to never include your own address when replyingjohn1doe@ya.ru
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)
2022-01-29recover: recover emails from tempdir after a crashKoni Marti
implements a recover command that searches the local temp dir for aerc emails. If a file is found and selected, a new composer tab will open with the file contents as the message body. No header data is stored in the temp file and thus this information cannot be recovered. Recover will not remove the temporary file unless the force flag (-f) is explicitly used. This recovery method only works when the editor buffer is saved to disk and the Close() function of the composer has not been called yet. Sending, postponing or quitting will call the Close() function which removes the temporary file completely. After Close() is called, no recovery is possible anymore. Signed-off-by: Koni Marti <koni.marti@gmail.com>
2022-01-27reply: use new-message template for non-quoted repliesRobin Jarry
Unless a template is specified with reply -T, use the new-message template for non-quoted replies. Fixes: 877a94f5d9a7 ("compose: add default template for new messages") Signed-off-by: Robin Jarry <robin@jarry.cc>
2022-01-22msgstore: fetch missing headers in visual modeKoni Marti
fetches missing headers when in visual selection mode. This prevents large archive operations from panicking due to a nil pointer dereference. The archive command will return an error to the ui when a nil message is encountered to signal that the message store is not ready yet. Signed-off-by: Koni Marti <koni.marti@gmail.com>
2022-01-19compose: add default template for new messagesRobin Jarry
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>
2022-01-19docs: mention missing -T options for compose and forwardRobin Jarry
A template file may be specified for compose and forward as well. Signed-off-by: Robin Jarry <robin@jarry.cc>
2022-01-07pgp: PGP/MIME encryption for outgoing emailsKoni Marti
implements PGP/MIME encryption with go-pgpmail. The Encrypt() function of go-pgpmail requires a list of public keys which are taken from the keystore. The keystore is searched for the email addresses of all recipients (to, cc, and bcc). If you want to be able to read the encrypted email afterwards, add yourself as a recipient in either to, cc, or bcc as well. Public keys can be exported from gpg into aerc as follows: $ gpg --export >> ~/.local/share/aerc/keyring.asc When composing a message, the encryption is enabled with the ":encrypt" command. This sets a bool flag in the Composer struct. A reapted application of this command will toggle the flag. The encrypted message can also be signed by using the ":sign" command before or after ":encrypt". References: https://todo.sr.ht/~rjarry/aerc/6 Signed-off-by: Koni Marti <koni.marti@gmail.com>
2022-01-07pgp: PGP/MIME signing for outgoing emailsKoni Marti
implements PGP/MIME signing with go-pgpmail. The Sign() function of go-pgpmail requires a private (signing) key. The signing key which matches the senders email address (from field in email header) is looked up in aerc's copy of the keyring. Private keys can be exported from gpg into aerc as follows: $ gpg --export-secret-keys >> ~/.local/share/aerc/keyring.asc A message is signed with the ":sign" command. The sign command sets a bool flag in the Composer struct. Using the command repeatedly will toggle the flag. References: https://todo.sr.ht/~rjarry/aerc/6 Signed-off-by: Koni Marti <koni.marti@gmail.com>
2021-12-13recall: allow recalling messages from any folderinwit
Recall fails when called outside of the "postpone" folder (usually "Drafts"). This makes sense for postponed messages. However, sometimes the user would like to re-edit and re-send an old, possibly sent, message, which would serve as a basis for the new one. This patch allows recall to work outside the postpone folder, thus allowing for re-edition of any message. In the original recall function, if the recalled message is found in the "postpone" folder, once the message has been recalled, re-edited and sent, the original draft is deleted. With this patch, when the message is not in the "postpone" folder, the original message is not deleted. Signed-off-by: inwit <inwit@sindominio.net>
2021-11-05imap: add manual {dis,}connect supportRobin Jarry
Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-11-05go.mod: change base git urlRobin Jarry
I'm not sure what are the implications but it seems required. Link: https://github.com/golang/go/issues/20883 Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-03-07add mimeType to OriginalMail struct for both forward and replyReto Brunner
2021-02-28send: fix missing error returnReto Brunner
2021-02-26Fix linter warningsReto Brunner
* Remove redundant return (code was never reached) * Remove redundant type information * Rename unused function parameters to "_"
2021-02-05send: fix crash if invalid password is givenReto Brunner
2021-01-30Get rid of the aerc.PushError(" " + $string) idiomReto Brunner
The individual callers should not be responsible for padding
2021-01-30Refactor lib/open to accept user provided argumentsReto Brunner
* Get rid of open_darwin It just lead to code duplication for a simple one string change. Instead we query it during initialization * Accept user provided arguments "open" on MacOS accepts things like -A to use a specific application Pass trough arguments the user provided in order to facilitate this * Refactor the function to a struct This makes it more convenient for the caller and avoids signatures like lib.OpenFile(nil, u.String(), nil) which are fairly unreadable
2021-01-24send: don't block the UI thread during the sendingReto Brunner
2021-01-14save: if part name is a path, only use the filenameRobin Opletal
2020-12-18update tcell to v2 and enable TrueColor supporty0ast
Also update to the tcell v2 PaletteColor api, which should keep the chosen theme of the user intact. Note, that if $TRUECOLOR is defined and a truecolor given, aerc will now stop clipping the value to one of the theme colors. Generally this is desired behaviour though.
2020-11-21Refactor send commandReto Brunner
2020-11-14reply: add References headerReto Brunner
2020-11-14allow the loading of existing headersReto Brunner
2020-11-14format: remove parse methods, use the one from go-messageReto Brunner
2020-11-14compose: use a proper header instead of a string mapReto Brunner
Prior to this commit, the composer was based on a map[string]string. While this approach was very versatile, it lead to a constant encoding / decoding of addresses and other headers. This commit switches to a different model, where the composer is based on a header. Commands which want to interact with it can simply set some defaults they would like to have. Users can overwrite them however they like. In order to get access to the functions generating / getting the msgid go-message was upgraded.
2020-11-14models: add RFC822 headers to OriginalMailReto Brunner
2020-11-14remove models.Address in favor of go-message AddressReto Brunner
We made a new type out of go-message/mail.Address without any real reason. This suddenly made it necessary to convert from one to the other without actually having any benefit whatsoever. This commit gets rid of the additional type
2020-09-22propagate error from sendmaily0ast
2020-09-21reply: don't override the answered flag if we didn't sendReto Brunner
Aerc just sent the true / false update regardless, meaning if someone already replied to a mail, then drafted yet another mail to the same parent the flag would vanish. This commit fixes this behaviour.
2020-08-31handle message unknown charset errorJeff Martin
This change handles message parse errors by printing the error when the user tries to view the message. Specifically only handling unknown charset errors in this patch, but there are many types of invalid messages that can be handled in this way. aerc currently leaves certain messages in the msglist in the pending (spinner) state, and I'm unable to view or modify the message. aerc also only prints parse errors with message when they are initially loaded. This UX is a little better, because you can still see the header info about the message, and if you try to view it, you will see the specific error.
2020-08-27reply: use set instead of linear searchReto Brunner
2020-08-20msg/reply: don't cc the sending address on reply allReto Brunner
2020-08-20Add account alias configuration and correctly set From fieldy0ast
We infer the correct From using the To: and Cc: field of the email that we reply to.
2020-08-20msg/reply: handle addresses as addressesReto Brunner
This simplifies the code considerably and makes it easier to follow
2020-08-20base models.Address on the mail.Address typeReto Brunner
This allows us to hook into the std libs implementation of parsing related stuff. For this, we need to get rid of the distinction between a mailbox and a host to just a single "address" field. However this is already the common case. All but one users immediately concatenated the mbox/domain to a single address. So this in effects makes it simpler for most cases and we simply do the transformation in the special case.