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; diff --git a/test/T520-show.sh b/test/T520-show.sh index 8121c3db..1f7f6aa8 100755 --- a/test/T520-show.sh +++ b/test/T520-show.sh @@ -17,6 +17,25 @@ notmuch show foo.. exit_code=$? test_expect_equal 1 $exit_code +test_begin_subtest "warning for --mbox --decrypt" +notmuch show --format=mbox --decrypt=true '*' 1>/dev/null 2>OUTPUT +echo $? >> OUTPUT +cat < EXPECTED +Warning: mbox format does not support decryption (ignored) +Warning: mbox format does not support signature verification (ignored) +0 +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "warning for --mbox --verify" +notmuch show --format=mbox --verify '*' 1>/dev/null 2>OUTPUT +echo $? >> OUTPUT +cat < EXPECTED +Warning: mbox format does not support signature verification (ignored) +0 +EOF +test_expect_equal_file EXPECTED OUTPUT + test_begin_subtest "notmuch show --sort=newest-first" notmuch show --entire-thread=true '*' > EXPECTED notmuch show --entire-thread=true --sort=newest-first '*' > OUTPUT