aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* sendemail-validate: put prefix directly after -t flagGregory Anders2024-05-291-1/+1
| | | | | | | | | On macOS the -t option must immediately precede the prefix template or else the generated temp name includes a newline (!), which causes the rest of the sendemail-validate script to fail. Signed-off-by: Gregory Anders <greg@gpanders.com> Acked-by: Robin Jarry <robin@jarry.cc>
* wrap: include xlocale.h header on macOSGregory Anders2024-05-291-0/+4
| | | | | | | | | | | | Compiling the wrap filter fails on macOS because the locale.h header does not include declarations for locale_t, freelocale, or newlocale. Instead, these are included in the xlocale.h header. We use a conditional include because glibc no longer ships the xlocale.h header in its distribution. Signed-off-by: Gregory Anders <greg@gpanders.com> Acked-by: Robin Jarry <robin@jarry.cc>
* jmap: fix go static check failureTristan Partin2024-05-291-1/+1
| | | | | | | | The missing variable was being set but unused. Fixes: 9f97c698e3dd ("jmap: fetch entire threads") Signed-off-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
* jmap: fix error messageTristan Partin2024-05-291-1/+1
| | | | | | | | A v1 got committed when a v2 existed. Fixes: f9113810cc6c ("jmap: invalidate cache if mailbox state is not consistent") Signed-off-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
* ui: add select-last-message optionKoni Marti2024-05-285-1/+22
| | | | | | | | | | | | | | Add a [ui].select-last-message option to position the cursor at the bottom of the message list view. Fixes: https://todo.sr.ht/~rjarry/aerc/254 Changelog-added: Add `[ui].select-last-message` option to position cursor at the bottom of the view. Suggested-by: Bence Ferdinandy <bence@ferdinandy.com> Requested-by: Tomasz Kramkowski <tomasz@kramkow.ski> Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Tomasz Kramkowski <tomasz@kramkow.ski> Acked-by: Robin Jarry <robin@jarry.cc>
* jmap: fetch entire threadsTristan Partin2024-05-285-32/+223
| | | | | | | JMAP was missing good thread support, especially when compared to Gmail. This will fetch entire threads when possible. Signed-off-by: Tristan Partin <tristan@partin.io>
* jmap: invalidate cache if mailbox state is not consistentTristan Partin2024-05-282-11/+57
| | | | | | | | | We weren't checking if the cached state was the same as the remote state before reading it. This led to aerc not knowing about new mailboxes on the remote. Signed-off-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
* sendemail-validate: optionally use patatt to attest patchesMatěj Cepl2024-05-281-1/+8
| | | | | | | | | | | | | | | One weakness of the email based workflow as used on Sourcehut is that git send-email strips all signatures from commits. patatt is not strict equivalent of signed commits, but at least there is a cryptographic attestation that the patch was send by the person it pretends it was sent. Optional, default off, switched on by setting $ git config --bool sendemail.runPatatt true Signed-off-by: Matěj Cepl <mcepl@cepl.eu> Acked-by: Robin Jarry <robin@jarry.cc>
* wrap: use nl_langinfo to get locale codesetMatěj Cepl2024-05-281-2/+6
| | | | | | | | | | | | Using more and more complicated constructs comparing locale strings doesn't lead to anywhere. Even with the current two steps long comparison the program is wrong on systems which use "utf8" in their locale names (e.g., my openSUSE/Tumbleweed). It is better to use proper locale functions to get canonical name of the current codeset. Link: https://lists.sr.ht/~rjarry/aerc-devel/%3CD1L7746XIJ3Z.3SN11SOVO175Q@cepl.eu%3E Signed-off-by: Matěj Cepl <mcepl@cepl.eu> Acked-by: Robin Jarry <robin@jarry.cc>
* binds: fix default d binding to actually ask a questionMatěj Cepl2024-05-281-1/+1
| | | | | | | | | The previous version of the binding must be intended for some older version of those commands, because it just could not work with the current version of aerc. Signed-off-by: Matěj Cepl <mcepl@cepl.eu> Acked-by: Robin Jarry <robin@jarry.cc>
* doc: fix new-account mentions for all protocolsRobin Jarry2024-05-286-8/+13
| | | | | | | | | | | The new-account wizard now supports all backends. Fixes: 28c7dd8746a0 ("wizard: add jmap support") Fixes: 459724889a62 ("wizard: add sendmail support") Fixes: a78814a9aa55 ("wizard: add notmuch support") Fixes: aa70b46fb3d5 ("wizard: add support for maildir") Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Bence Ferdinandy <bence@ferdinandy.com>
* github: fix macos buildRobin Jarry2024-05-091-3/+17
| | | | | | | | | | setup-go@v2 does not work anymore. Let's not run on deprecated stuff. Update action versions. Also, homebrew base prefix has changed and is not in the default clang search path anymore. Update CGO_*FLAGS accordingly. Signed-off-by: Robin Jarry <robin@jarry.cc>
* config: fix typos in aerc.conf commentsRyan Winograd2024-05-091-2/+2
| | | | | | | | | I've recently started using aerc and I love it. I hope this exceedingly small contribution is helpful. Signed-off-by: Ryan Winograd <ryan@thewinograds.com> Acked-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* readme: fix broken arch binary linkJoey Schaff2024-05-091-1/+1
| | | | | | | | Modified the Arch binary link in README.md to not point towards a 404 page. Signed-off-by: Joey Schaff <j@jaoh.xyz> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: fix panic in connectKoni Marti2024-05-091-2/+3
| | | | | | | | | | | | | Fix a nil pointer dereference panic in connect when trying to obtain the folder delimiter. There is a List call to the imap server that in some instances can return a nil *imap.MailboxInfo that is not checked before it is dereferenced. Link: https://lists.sr.ht/~rjarry/aerc-devel/%3CEDE672E5-3F6F-402D-B1A4-5477183FC13C@ukr.net%3E Reported-by: Misha <ulianich_mihail@ukr.net> Signed-off-by: Koni Marti <koni.marti@gmail.com> Reviewed-by: Tim Culverhouse <tim@tim.culverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* docs: remove msmtp noticeKarel Balej2024-05-091-3/+0
| | | | | | | | | Remove the warning about the behaviour of the msmtp --read-envelope-from flag with bouncing as it ceased to be true with the release of msmtp version 1.8.26. Signed-off-by: Karel Balej <balejk@matfyz.cz> Acked-by: Robin Jarry <robin@jarry.cc>
* msgstore: restore the directoryChange bool to fix new message bellKarel Balej2024-05-091-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 24eab0f5ef63 the condition under which the triggerDirectoryChange callback is executed was changed so that it would now only run if there were new messages in the currently scrolled into view part of the message list whereas previously it ran for new messages anywhere in the list. The motivation for this was to make the mail-received hook work even when the tab of the receiving account is not currently focused by fetching the new message's/s' headers needed for the hook to execute based on what changed in the scrolled into part of the list. This limitation is needed because apparently we don't currently have a better way to recognize new messages other than comparing the list of UIDs provided by the worker and that kept by the store. My current understanding is that we cannot remove the scroll view limit because then we would be fetching headers for all messages in the directory which can be a somewhat intensive operation. However we can disregard the view limit for the bell as that does not require the headers: it only cares about that something has changed. It is noteworthy that the bell is rung on aerc startup: I assume that this occurs with the initial load of the message store for every account when the else branch where directoryChange is set to true inevitably executes. Overall, this patch is more of a workaround than a proper fix: the ideal situation would be if we were able to fetch headers for new messages independently of the scroll status. However as this is how this was before, it should be suitable as a temporary solution. There are also further problems here: currently we have triggerNewEmail and triggerDirectoryChange callbacks which are both supposed to run when new mail is received, the latter only implicitly. And yet they both use a different mechanism and thus execute under different circumstances. It would be ideal to move the bell into the new mail trigger and get rid of the directory change one as it is otherwise unused. However this is not done here because for some setups the new mail trigger does not run until the tab is focused which is what the aforementioned commit was meant to fix but apparently succeeded in doing so only partially. The directoryChange trigger does not have this drawback and thus should be kept until the issue is resolved for all setups. Also note that for instance for O365 mail the bell still doesn't work properly as there new mail only appears in the store after the given folder is reopened (:prev-folder :next-folder) and the bell is thus rung only then. Fixes: 24eab0f5ef63 ("msglist: fetch headers even when not focused") Fixes: https://todo.sr.ht/~rjarry/aerc/249 Changelog-fixed: Restore previous behaviour of the new message bell which was broken in the last two releases for at least some setups. Signed-off-by: Karel Balej <balejk@matfyz.cz> Acked-by: Robin Jarry <robin@jarry.cc>
* app: make aerc satisfy the Beeper interface againKarel Balej2024-05-091-5/+3
| | | | | | | | | | | | | | During the Vaxis switchover, the Beeper interface was changed because Vaxis' Bell() function does not return error. However the corresponding change was not made on aerc making it not satisfy this interface and thus the DrawableInteractiveBeeper interface. This lead to the Bell function not getting registered making aerc unable to ring the terminal bell. Fix this. Fixes: 0fd5f4115792 ("ui: initialize vaxis directly, drop tcell.Screen initialization") Signed-off-by: Karel Balej <balejk@matfyz.cz> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: add imaps+insecure modeMoritz Poldrack2024-05-012-0/+6
| | | | | | | | | | | | | | When connecting through environments bypassing hostnames, like SSH tunnels, the certificate verification of the server will fail, making it impossible to connect, if plain IMAP has been disabled. Add handling for the insecure modifier to the imaps connection. Changelog-added: Add `imaps+insecure` to the available protocols, for connections that should ignore issues with certificate verification. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* config: add tag-modified hook to default configMaarten Aertsen2024-04-161-0/+4
| | | | | | | | Add `tag-modified=` to the hooks section of aerc.conf. Signed-off-by: Maarten Aertsen <maarten@nlnetlabs.nl> Acked-by: Robin Jarry <robin@jarry.cc>
* config: add flag-changed hook to default configMaarten Aertsen2024-04-161-0/+4
| | | | | | | | | Add `flag-changed=` to the hooks section of aerc.conf, with a (commented) default corrensponding to the docs. Signed-off-by: Maarten Aertsen <maarten@nlnetlabs.nl> Acked-by: Robin Jarry <robin@jarry.cc>
* docs: correct flag-changed exampleMaarten Aertsen2024-04-161-1/+1
| | | | | | | | Correct the flag-changed example to use the flag-changed hook. Signed-off-by: Maarten Aertsen <maarten@nlnetlabs.nl> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: fix disappearing messagesJulio B2024-04-141-1/+4
| | | | | | | | | | | The current implementation assumes that 'root[0].FirstChild' is nil, but this is not always the case. Instead of overwriting the FirstChild, detect and link the messages to the LastChild of root[0]. Fixes: 672b4edca7af ("notmuch: draw incomplete threads") Signed-off-by: Julio B <julio.bacel@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* attach: use absolute paths instead of relativeBence Ferdinandy2024-04-142-1/+6
| | | | | | | | | | | | Sometimes it is easier to change folders when adding attachments, but currently we store relative paths, which doesn't work with this. Add the absolute paths when attaching files. Replace the current user home dir with ~ to make it prettier in the UI. Implements: https://todo.sr.ht/~rjarry/aerc/134 Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: add completions for :cf, :filter and :searchBence Ferdinandy2024-04-142-4/+31
| | | | | | | | | | | Add completion of notmuch search-terms for :cf, :filter and :search. Implements: https://todo.sr.ht/~rjarry/aerc/244 Changelog-added: Notmuch completions for `:cf`, `:filter` and `:search`. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Tested-by: Julio B <julio.bacel@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* query: add completions for notmuch search-termsBence Ferdinandy2024-04-142-2/+60
| | | | | | | | | | | | | | Add completions to :query for the notmuch search terms. Most search terms that seemed valid for interactive use in aerc are listed as options. Some of them (from, to, tag, path, and folder) get actual completions. The function was designed, so later patches can reuse it to add completions to :cf, :filter and :search for notmuch accounts. References: https://todo.sr.ht/~rjarry/aerc/244 Changelog-added: Notmuch search term completions to `:query`. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Tested-by: Julio B <julio.bacel@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* hooks: add flag-changedBence Ferdinandy2024-04-145-1/+73
| | | | | | | | | Add the flag-changed hook. References: https://todo.sr.ht/~rjarry/aerc/136 Changelog-added: New `flag-changed` hook. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* hooks: add tag-modifiedBence Ferdinandy2024-04-145-2/+58
| | | | | | | | | Add the tag-modified hook for notmuch and JMAP accounts. References: https://todo.sr.ht/~rjarry/aerc/136 Changelog-added: New `tag-modified` hook for notmuch and JMAP accounts. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* open: create a file even if filename is emptyBence Ferdinandy2024-04-141-1/+12
| | | | | | | | | Without a filename, aerc tries to open a directory. In this case, create a random filename. Fixes: d99c49de2fc1 ("open: preserve the original filename") Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* compose,viewer: do not always wrap people names in quotesRobin Jarry2024-04-131-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Currently, names of recipients in From, To, Cc and Bcc headers are (almost) always wrapped in quotes. Even if they are pure ASCII and contain one upper case letter. E.g.: From: "Foo" <foo@baz.org> There is no valid reason to add these quotes unless the name contains special characters as specified by RFC 5322, section 3.2.3: specials = "(" / ")" / ; Special characters that do "<" / ">" / ; not appear in atext "[" / "]" / ":" / ";" / "@" / "\" / "," / "." / DQUOTE Adapt the check accordingly. Link: https://datatracker.ietf.org/doc/html/rfc5322#section-3.2.3 Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* sendemail-validate: add fallback for older gitRobin Jarry2024-04-131-1/+3
| | | | | | | | | | | | Before version 2.41, the sendemail-validate script can only be used to validate patches one by one, even when sending patch series. Set both GIT_SENDEMAIL_FILE_{COUNTER,TOTAL} to 1 in case they are not defined to avoid obscure errors. At least with older git versions, single patch validation should be possible. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
* compose: explicitly identify converted text/* partsRobin Jarry2024-04-133-9/+20
| | | | | | | | | | | | | | | | | | | | | When running :accept, an error is displayed on the review screen: text/calendar error: no command defined for mime/type When running :multipart text/xxx, its contents are not specified. They are regenerated every time the review screen is displayed. When running :accept, a text/calendar part is added with actual contents. Update the Part object to hold a boolean initialized when first being created. If body is nil, identify the part as "Converted" and update its contents every time the review screen is displayed. When body is not nil but contains text (e.g. when running :accept), identify the part as *not* converted and ignore the conversion step. Fixes: cbcabfafaab2 ("compose: allow writing multipart/alternative messages") Reported-by: Inwit <inwit@sindominio.net> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net>
* vaxis: fix panic trace print on stderrRobin Jarry2024-04-131-0/+1
| | | | | | | | | | | | | | | | | | By default, vaxis tries to open stderr, stdout and stdin in that order and uses the first one as its TTY file descriptor. Upon exit, vaxis.Close() closes that file descriptor. When aerc panics, our panic handler calls UICleanup() which is an alias for vaxis.Close(). This effectively makes os.Stderr unusable and all error messages are written to a closed file descriptor. This also break the regular go runtime panic() handler which prints on stderr as well. Use an explicit /dev/tty path instead of stderr to keep it open. Fixes: 6eff242090dc ("ui: so long tcell") Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
* pipe: allow closing the terminal automaticallyJohannes Thyssen Tishman2024-04-133-2/+9
| | | | | | | | | | | | | Add a new -s flag to :pipe. When specified, the terminal tab opened by the :pipe command will be automatically closed after the process is completed instead of prompting for a key press. While this doesn't technically silence the command (the output is not suppressed), the output is not shown to the user. Changelog-added: Silently close the terminal tab after piping a message to a command with `:pipe -s <cmd>`. Signed-off-by: Johannes Thyssen Tishman <johannes@thyssentishman.com> Acked-by: Robin Jarry <robin@jarry.cc>
* gitignore: add tags and aerc-release-stats.pngBence Ferdinandy2024-04-131-0/+2
| | | | | | | | | | Ignore the tags file generated by ctags and the image generated by python3 contrib/git-stats-graph.py (i.e. the default output of the script. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* docs: be more explicit about the behaviour of :acceptBence Ferdinandy2024-04-131-1/+6
| | | | | | | | | | Accept can be a bit confusing when coming from something like gmail or outlook, where clicking the accept button not only sends the accept email, but also inserts the meeting into one's calendar. Be more explicit about what happens. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* config: allow global options in accounts.confJohannes Thyssen Tishman2024-04-132-3/+13
| | | | | | | | | | | | | Global options may be configured by placing them at the top of the accounts.conf file, before any account-specific sections. These can be overridden for an account by specifying them again in the account section. Changelog-added: Set global options in `accounts.conf` by placing them at the top of the file. Signed-off-by: Johannes Thyssen Tishman <johannes@thyssentishman.com> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* composer: block :quit command if composer is activeVitaly Ovchinnikov2024-04-131-0/+4
| | | | | | | | Prevent aerc from quiting if there is an active composer instance, unless `:quit -f` is used. Signed-off-by: Vitaly Ovchinnikov <v@ovch.ru> Acked-by: Robin Jarry <robin@jarry.cc>
* binds: fix FormatKeyStrokes to properly display certain keystrokesVitaly Ovchinnikov2024-04-132-1/+15
| | | | | | | | | | Fix FormatKeyStrokes so it properly displays the strokes that are not directly listed in `keyNames`, like ctrl+left, ctrl+pgup etc. Add a test to check that the strokes are now formatted. Signed-off-by: Vitaly Ovchinnikov <v@ovch.ru> Acked-by: Robin Jarry <robin@jarry.cc>
* readme: add missing link for aerc-patch man pageMatěj Cepl2024-04-131-0/+1
| | | | | | | | | We have added new manpage to aerc with the patch module, but it hasn’t been mentioned in README.md. Signed-off-by: Matěj Cepl <mcepl@cepl.eu> Acked-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* open: preserve the original filenameMaarten Aertsen2024-04-131-15/+12
| | | | | | | | | | | | | Change the name of the temporary file that is :open'ed using the system handler from `aerc-<randint>.ext` to `aerc-<randint>/<actual-filename.ext>`. This preserves the original filename, while retaining collision avoidance and the current base location (os.TempDir()). Changelog-changed: `:open` commands now preserve the original filename. Signed-off-by: Maarten Aertsen <maarten@nlnetlabs.nl> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* contrib: improve readability of meeting requestsBence Ferdinandy2024-04-131-10/+23
| | | | | | | | | | | | | | | | | | | | Meeting requests may contain dozens of participants, making the attendee list potentially very long, hiding one of the most important piece of information in the request, namely the time of the meeting. Also the RSVP statuses of participants usually does not carry any information, since when the meeting is created all participants RSVP status will be the same (needs-action). The current layout uses three rows for a single participant, making it hard to glance over quickly. Move the start and end time of the meeting up into a more prominent place and leave the variable length attendee list last. Add a quick overview list of attendees before listing the participations status. Changelog-changed: Improved readability of the builtin `calendar` filter. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Tested-by: "Matěj Cepl" <mcepl@cepl.eu> Tested-by: inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* ipc: add more fine-grained options to disable IPCJason Cox2024-04-134-1/+30
| | | | | | | | | | | | Add disable-ipc-mailto and disable-ipc-mbox to make mailto:... and mbox:... commands always run in a new instance, while still allowing aerc-internal commands (i.e., aerc :<command...>) to run over IPC. Changelog-added: Add config options `disable-ipc-mailto` and `disable-ipc-mbox` to make `mailto:...` and `mbox:...` commands always run in a new aerc instance. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* ipc: disable IPC completely when disable-ipc=trueJason Cox2024-04-135-19/+26
| | | | | | | | | | | | | | | Truly disable IPC when disable-ipc is set to true in aerc.conf. Don't run commands over IPC and don't start an IPC server. Being able to disable IPC in the config is useful because it allows making aerc open mailto links in a new instance without modifying the aerc.desktop file. There are of course potential security benefits as well. Changelog-changed: The `disable-ipc` option in `aerc.conf` completely disables IPC. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* ipc: add --no-ipc flag to completely disable IPCJason Cox2024-04-132-9/+30
| | | | | | | | | | | | | | | | | Running aerc mailto:... and aerc mbox:... can be confusing; if there's another aerc instance already open, the action will be performed in the other instance, which may not be visible. Add a --no-ipc flag that runs these actions, and aerc-internal commands (i.e., aerc :<command>), in the new aerc instance instead. Also, if --no-ipc is passed, don't listen on a socket for IPC calls from other aerc instances. Changelog-added: Add `--no-ipc` flag to run `aerc mailto:...`, `aerc mbox:...`, and `aerc :<command...>` within the current aerc instance and prevent listening for IPC calls from other aerc instances. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* ipc: retry failed command directly, not over IPCJason Cox2024-04-135-66/+40
| | | | | | | | | If IPC fails the first time we try it, we know that no other aerc instance is running. When we retry, run the command directly instead of going through the current instance's own IPC server. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* ipc: improve error handlingJason Cox2024-04-133-24/+28
| | | | | | | | | | | | | | | Detect error responses in addition to errors connecting, sending the request, and receiving the response. If an error occurs when retrying the IPC call, keep the new aerc instance running and simply show the error. We already know (due to the initial failed IPC call) that no other aerc instance is running. Keeping the new instance open also improves the visibility of the error in some cases, such as when clicking on a malformed mailto link causes a new aerc instance to open. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* ui: use a custom prefix for dummy rootJulio B2024-04-136-1/+36
| | | | | | | | | | These messages are not really the root of the thread, and should not be displayed as such. Add a new special prefix to make them appear like the first child of a rootless thread. Signed-off-by: Julio B <julio.bacel@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: draw incomplete threadsJulio B2024-04-131-5/+11
| | | | | | | | | | Create a "pseudo thread" with the first message as root. This is a temporary solution, until we have a more generic implementation of dummy messages that works for all backends. Signed-off-by: Julio B <julio.bacel@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* send: prevent sending if multipart conversion failedVitaly Ovchinnikov2024-04-033-6/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given the following configuration: binds.conf: [compose::review] y = :multipart text/html<Enter>:send<Enter> aerc.conf: [multipart-converters] text/html = /path/to/some/script.sh /path/to/some/script.sh: #!/bin/sh exit 10 # falls for some reason When you press `y` aerc runs `:multipart` command and although it gets an error from the converter script, the error is ignored and then the `:send` command actually sends a broken message. Add ConversionError field to Composer.Part to track multipart conversion errors. Check for conversion errors in :send, block sending if the errors are found. There is no way to skip this like missing attachment or empty subject. This is done intentionally. The user needs to update or delete the problematic part before actually sending a message. Signed-off-by: Vitaly Ovchinnikov <v@ovch.ru> Acked-by: Robin Jarry <robin@jarry.cc>