aboutsummaryrefslogtreecommitdiff
path: root/notmuch-show.c
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2023-12-21 09:04:00 -0800
committerDavid Bremner <david@tethera.net>2024-08-06 06:50:33 -0300
commita691d54280b574035d38f3827d5caca9d0a6ae5b (patch)
tree05271c8eafe3c20356d0d46c188018af9bd62580 /notmuch-show.c
parentbc989209171d406b3671024542e59b86b0ecb23d (diff)
CLI/show: warn if crypto options are used with mbox format
This limitation seems somewhat hard to fix, but at least try to warn users when combining crypto operations with mbox output format. Because the default is --decrypt=auto, the warning is omitted if --decrypt=auto is specified. While this is not great, it seems more wrong to always warn, or to change the default because of this.
Diffstat (limited to 'notmuch-show.c')
-rw-r--r--notmuch-show.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/notmuch-show.c b/notmuch-show.c
index 7fb40ce9..8c23f821 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -1399,6 +1399,14 @@ notmuch_show_command (notmuch_database_t *notmuch, int argc, char *argv[])
fprintf (stderr, "Error: specifying parts is incompatible with mbox output format.\n");
return EXIT_FAILURE;
}
+ if (params.crypto.decrypt != NOTMUCH_DECRYPT_FALSE
+ && params.crypto.decrypt != NOTMUCH_DECRYPT_AUTO) {
+ fprintf (stderr, "Warning: mbox format does not support decryption (ignored)\n");
+ }
+ if (params.crypto.verify) {
+ fprintf (stderr,
+ "Warning: mbox format does not support signature verification (ignored)\n");
+ }
} else if (format == NOTMUCH_FORMAT_RAW) {
/* raw format only supports single message display */
single_message = true;