unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Alexander Adolf <alexander.adolf@condition-alpha.com>,
	notmuch@notmuchmail.org
Cc: Daniel Kahn Gillmor <dkg@debian.org>,
	michaeljgruber+grubix+git@gmail.com
Subject: Re: [PATCH] emacs/smime: render decrypted MIME entities in notmuch-show
Date: Wed, 13 Apr 2022 20:56:27 -0300	[thread overview]
Message-ID: <87r160o7v8.fsf@tethera.net> (raw)
In-Reply-To: <68e03382493db20b12786d19f79edfaf@condition-alpha.com>

Alexander Adolf <alexander.adolf@condition-alpha.com> writes:

> Hello David,
>
> David Bremner <david@tethera.net> writes:
>
>> [...]
>> I'm not sure it's less effort, 
>> [...]
>
> Neither am I... ;-))
>
> It might perhaps seem easier to run the tests I have added to the
> attached, updated patch in your complete environment?
>
>   --alexander


It seems that it is mostly working, but there are a few issues to iron out.

The first is easy, I think. Since we added a message to the crypto
corpus, we need to adjust the tests. I think it is fine to just add
the new message to the failing test output, as in the diff below.

T357-index-decryption: Testing indexing decrypted mail
 FAIL   indexing message fails when secret key not available
	--- T357-index-decryption.31.expected	2022-04-13 23:15:02.258922959 +0000
	+++ T357-index-decryption.31.output	2022-04-13 23:15:02.258922959 +0000
	@@ -1,5 +1,6 @@
	 #= simple-encrypted@crypto.notmuchmail.org index.decryption=failure
	 #notmuch-dump batch-tag:3 config,properties,tags
	++encrypted +inbox +unread -- id:575ddaaf0b234fd85e077cfb4d44d467@notmuchmail.org
	 +encrypted +inbox +unread -- id:basic-encrypted@crypto.notmuchmail.org
	 +encrypted +inbox +unread -- id:encrypted-rfc822-attachment@crypto.notmuchmail.org
	 +encrypted +inbox +unread -- id:encrypted-signed@crypto.notmuchmail.org


T450-emacs-show: Testing emacs notmuch-show view
 BROKEN show encrypted rfc822 message
!!! Bodypart handler `notmuch-show-insert-part-*/*' threw an error:
!!! Symbol’s value as variable is void: gnus-newsgroup-charset
 FAIL   process cryptographic MIME parts (S/MIME)
	--- T450-emacs-show.21.notmuch-show-smime-encrypted-signed-multipart	2022-04-13 23:15:11.267167711 +0000
	+++ T450-emacs-show.21.OUTPUT	2022-04-13 23:15:11.267167711 +0000
	@@ -1,4 +1,4 @@
	-test_suite@notmuchmail.org (0 mins. ago) (encrypted inbox)
	+test_suite@notmuchmail.org (Yest. 14:57) (encrypted inbox)

If you set notmuch-show-relative-dates to to nil, something like, with
maybe better indentation:

-test_emacs '(let ((notmuch-crypto-process-mime t))
+test_emacs '(let ((notmuch-crypto-process-mime t)
+          (notmuch-show-relative-dates nil))

Then you will get an actual date that you can hard code.

	 Subject: notmuch-show S/MIME test
	 To: test_suite@notmuchmail.org
	 Date: Tue, 12 Apr 2022 16:57:30 +0200
	@@ -6,10 +6,10 @@
	 [ smime.p7m: application/pkcs7-mime ]
	 [ Decryption successful ]
	 [ multipart/signed ]
	-[ Good signature by: <test_suite@notmuchmail.org> ]
	+[ Good signature by: test_suite@notmuchmail.org ]

This is exactly the problem we just dealt with for T355-smime. I think
the same solution can be applied, but you will need to inline the output
so that you can do variable substitution.

	 [ multipart/mixed ]
	 [ multipart/mixed ]
	 [ text/plain ]
	 The password is "12345678". But don't tell anyone!
	-[ test.dtd: application/octet-stream ]
	+[ test.dtd: application/octet-stream (as application/xml-dtd) ]

This seems related to the function
#'notmuch-show-get-mime-type-of-application/octet-stream, which is
calling (mailcap-extension-to-mime "dtd"). Probably this is hard to make
reproducible, so just seding away an "(as ...)" string is a reasonable
alternative.

	 [ smime.p7s: application/pkcs7-signature ]


\r

  reply	other threads:[~2022-04-13 23:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 13:43 [PATCH] emacs/smime: render decrypted MIME entities in notmuch-show Alexander Adolf
2022-03-29 13:18 ` David Bremner
2022-04-06 20:23   ` Alexander Adolf
2022-04-07 12:25     ` David Bremner
2022-04-07 13:02       ` Alexander Adolf
2022-04-07 14:01         ` David Bremner
2022-04-11 15:35           ` Alexander Adolf
2022-04-11 23:36             ` David Bremner
2022-04-12 16:21               ` Alexander Adolf
2022-04-13 23:56                 ` David Bremner [this message]
2022-05-11 15:41                   ` Alexander Adolf
2022-05-16 16:17                   ` Alexander Adolf
2022-05-18 10:29                     ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r160o7v8.fsf@tethera.net \
    --to=david@tethera.net \
    --cc=alexander.adolf@condition-alpha.com \
    --cc=dkg@debian.org \
    --cc=michaeljgruber+grubix+git@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).