aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* gpg: add pgp-self-encrypt optionBartkk2024-04-033-0/+16
| | | | | | | | | | Add an option to encrypt outgoing messages to the sender or the key specified in pgp-key-id. Implements: https://todo.sr.ht/~rjarry/aerc/237 Changelog-added: New `pgp-self-encrypt` option in `accounts.conf`. Signed-off-by: Bartkk <bartkk@bartkk.xyz> Acked-by: Robin Jarry <robin@jarry.cc>
* ui: update vaxis to v0.8.5Tim Culverhouse2024-04-022-3/+3
| | | | | | | | | | | | | Update vaxis library to v0.8.5 which includes several terminal widget fixes: - Tab stop positions were off by 1 - Now reponds to secondary DA queries - Fix encoding of function keys higher than F12 Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* config: make popover dialogs configurableJohannes Thyssen Tishman2024-04-028-39/+85
| | | | | | | | | | | | Add the [ui].dialog-{position,width,height} options in aerc.conf to set the position, width and height of popover dialogs such as the one from :menu, :envelope or :attach -m relative to the main window. Changelog-added: Add `[ui].dialog-{position,width,height}` to set the position, width and height of popover dialogs. Signed-off-by: Johannes Thyssen Tishman <johannes@thyssentishman.com> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: add strategies for multi-file messagesJason Cox2024-04-0214-132/+586
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A single notmuch message can represent multiple files. As a result, file-based operations like move, copy, and delete can be ambiguous. Add a new account config option, multi-file-strategy, to tell aerc how to handle these ambiguous cases. Also add options to relevant commands to set the multi-file strategy on a per-invocation basis. If no multi-file strategy is set, refuse to take file-based actions on multi-file messages. This default behavior is mostly the same as aerc's previous behavior, but a bit stricter in some cases which previously tried to be smart about multi-file operations (e.g., move and delete). Applying multi-file strategies to cross-account copy and move operations is not implemented. These operations will proceed as they have in the past -- aerc will copy/move a single file. However, for cross-account move operations, aerc will refuse to delete multiple files to prevent data loss as not all of the files are added to the destination account. See the changes to aerc-notmuch(5) for details on the currently supported multi-file strategies. Changelog-added: Tell aerc how to handle file-based operations on multi-file notmuch messages with the account config option `multi-file-strategy` and the `-m` flag to `:archive`, `:copy`, `:delete`, and `:move`. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Tested-by: Maarten Aertsen <maarten@nlnetlabs.nl> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: simplify moving a messageJason Cox2024-04-021-10/+1
| | | | | | | | | Delete the existing file from the database after indexing the new one to avoid the need to remember and re-apply tags. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Tested-by: Maarten Aertsen <maarten@nlnetlabs.nl> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: ignore duplicate msg ID error on deleteJason Cox2024-04-021-1/+1
| | | | | | | | | | | | | | | | | | According to the comments in notmuch.h, removing a file returns NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID when the "filename was removed but the message persists in the database with at least one other filename." Based on the fact that the db.DeleteMessage() function is used in a context that explicitly recognizes the possibility of multiple files and only attempts to delete one of them, I'm fairly certain that the existing behavior of ignoring all errors *except* the deplicate message ID error is the result of a typo. (It also doesn't make sense to ignore other errors, such as NOTMUCH_STATUS_XAPIAN_EXCEPTION.) Cc: Tim Culverhouse <tim@timculverhouse.com> Signed-off-by: Jason Cox <me@jasoncarloscox.com> Tested-by: Maarten Aertsen <maarten@nlnetlabs.nl> Acked-by: Robin Jarry <robin@jarry.cc>
* search: fix crash during message searchjp392024-04-021-5/+3
| | | | | | | | | | Initialize info in SearchMessage irregardless of the message parts flags otherwise it will crash when we attempt to read it in the next switch statement. Fixes: 8464b3738 ("search: use a common api for all workers") Signed-off-by: jp39 <jp39@gmx.com> Acked-by: Robin Jarry <robin@jarry.cc>
* mod: update all dependenciesRobin Jarry2024-04-023-101/+105
| | | | | | | | | | | | | | | | | | Patch produced with the following commands: go mod edit -dropreplace=golang.org/x/crypto go get -t -u go mod tidy I dropped the replace of x/crypto. The only use for the fork from ProtonMail is for openpgp which has been deprecated by the official implementation. And aerc explicitly uses the correct import path where needed. go-smtp update was a bit harsh. The API was changed completely. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* filters: add matching against attachment filenameBence Ferdinandy2024-03-253-1/+31
| | | | | | | | | | | | The mimetype of attachments are set by the sender, which can results in attachments getting not so useful mimetypes (e.g. application/octet-stream for a csv). Allow matching filter against filenames directly, by adding the `.filename,` and `.filename,~` syntax, similarly to headers. Changelog-added: Match filters on filename via `.filename,~<regexp> =`. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* docs: update filter tips for imagesBence Ferdinandy2024-03-251-7/+9
| | | | | | | | | | Since aerc uses vaxis, the image/* filter has incorrect information. Update this with the new behaviour. Fixes: 4e26faf498b8 ("msgviewer: implement inline image viewing") Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Reviewed-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* docs: correct IMAP IDLE default settingGary Kim2024-03-251-1/+1
| | | | | | | | Correct aerc-imap(5) which currently has the default idle-timeout listed as 10ms even though the actual default is 10s. Signed-off-by: Gary Kim <gary@garykim.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* templates: do not add new line after signatureDaniel Gray2024-03-251-1/+1
| | | | | | | | | The new_message template currently adds a new line after the signature which is an error and not likely what the user expects. Signed-off-by: Daniel Gray <dngray@polarbear.army> Acked-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* mod: update vaxisTim Culverhouse2024-03-102-3/+3
| | | | | | | | | | | | | Update Vaxis to v0.8.4. This version has a few bug fixes relevant to aerc: - Charset handling in the terminal (John) - Various key encoding issues (Robin) - Fix resize race conditions with underlying terminal (inwit, Bence) - Explicit cursor positioning on new rows to fix wrapped selections (Tristan) Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* detach: add glob supportTristan Partin2024-03-102-4/+43
| | | | | | | | | This matches the behavior of :attach. Changelog-added: The `:detach` command now understands globs similar to `:attach`. Signed-off-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
* quit: add :q aliasTristan Partin2024-03-102-2/+3
| | | | | | | | | | | | This used to work, but after f3a61a34 (where :query) was added, we had two commands which then started with q. So, the automatic alias stopped working. Changelog-added: Specify a ":q" alias for quit. Signed-off-by: Tristan Partin <tristan@partin.io> Acked-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* mk: allow overriding install binaryRobin Jarry2024-03-101-3/+4
| | | | | | | | | | | This can be used by downstream packaging to force specific options. E.g.: make install INSTALL="/usr/bin/install -p" Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Gavin-John Noonan <mail@gjnoonan.co.uk> Reviewed-by: Gavin-John Noonan <mail@gjnoonan.co.uk>
* gpg: use export-minimal when attaching public keyRobin Jarry2024-03-101-1/+2
| | | | | | | | | | | Depending on how many signatures the public key has, it may be very large. The key signatures are not required to verify the authenticity of an email. Link: https://lists.sr.ht/~rjarry/aerc-devel/%3CCZKDO3ETIOAI.1DDOYI8Z8LY5O%40cepl.eu%3E Reported-by: Matěj Cepl <mcepl@cepl.eu> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Matěj Cepl <mcepl@cepl.eu>
* gpg: fix mime-version header positionRobin Jarry2024-03-102-11/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some MTAs try to normalize the case of all headers (including signed text parts headers). Unfortunately, Mime-Version can be normalized to different casing depending on the implementation (MIME- vs Mime-). Since the signature is computed on the whole part, including its header, changing the case can cause the signature to become invalid. Due to how multipart/signed messages are constructed, we need to hack around go-message writers to intercept the writing of a text part, compute its signature and write the actual message with the proper headers. Unfortunately, go-message does not allow creating a message writer that does not insert a Mime-Version header. This causes the Mime-Version header to be inserted in the wrong place: it is put inside the signed text part header instead on the top level header. Thus, included in the signed content. Make sure to remove any Mime-Version header from the signed part header. Finally, ensure that Mime-Version is set on the top-level header so that messages are compliant with RFC 2045. Fixes: https://todo.sr.ht/~rjarry/aerc/143 Link: https://github.com/emersion/go-message/issues/165 Link: https://github.com/emersion/go-pgpmail/pull/15 Link: https://lists.sr.ht/~rjarry/aerc-devel/%3CCQRPF5EA0TF8.PEJ4AKCEGMFM%40fembook%3E Changelog-fixed: `Mime-Version` is no longer inserted in signed text parts headers. MTAs normalizing header case will not corrupt signatures anymore. Reported-by: Coco Liliace <chloe@liliace.dev> Reported-by: Kirill Chibisov <contact@kchibisov.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* templates: add visual mode indicator to TrayInfoJason Cox2024-03-045-2/+29
| | | | | | | | | | | It's useful to have some indicator of whether or not aerc is in visual mark mode. Add such an indicator to the TrayInfo available in the status line. Changelog-changed: The `TrayInfo` template variable now includes a visual mark mode indicator. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* commands: rename confusing constantsRobin Jarry2024-03-0441-47/+45
| | | | | | | | There is an overlap between ACCOUNT and MESSAGE. Rename ACCOUNT to MESSAGE_LIST and use MESSAGE_LIST|MESSAGE_VIEWER instead of MESSAGE. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
* mk: add validate targetRobin Jarry2024-03-043-12/+7
| | | | | | | | | | Instead of hiding the actual checks deep into the CI framework and into the sendemail-validate hook, add a validate make target that uses proper variables and runs the required checks. Use it in the sendemail-validate hook and the CI builds. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
* contrib: use sed -E for shell scriptsMaarten Aertsen2024-02-294-11/+11
| | | | | | | | | The + character is not part of the 'basic regular expressions' in BSD grep. Use -E to enable extended (modern) regular expressions. Also remove escaping. This makes the commit msg hook work on macOS 14.2. Signed-off-by: Maarten Aertsen <maarten@nlnetlabs.nl> Signed-off-by: Robin Jarry <robin@jarry.cc>