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, 18 May 2022 07:29:03 -0300	[thread overview]
Message-ID: <87pmkbb0cw.fsf@tethera.net> (raw)
In-Reply-To: <5fdc515751380c0ea8844fd9994895ec@condition-alpha.com>

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


>
> Ok, I have added the line as you suggest. I was wondering though, as in
> principle the secret key of test_suite@notmuchmail.org could be
> available (it's in the key-ring at least)?

Yes, it's added to the test suite's temporary keyring. One of the
messages in test/corpora/crypto is not encrypted to that key though.

$ for file in *; do 
echo $file      
gpg < $file |& grep encrypted; echo
done

basic-encrypted.eml
gpg: encrypted with 1024-bit RSA key, ID C44D36DEAD54AB16, created 2011-02-05

encrypted-rfc822-attachment
gpg: encrypted with 4096-bit RSA key, ID 70E3C0DE87068451, created 2019-06-08
gpg: encrypted with 1024-bit RSA key, ID C44D36DEAD54AB16, created 2011-02-05

encrypted-signed.eml
gpg: encrypted with 1024-bit RSA key, ID C44D36DEAD54AB16, created 2011-02-05

simple-encrypted
gpg: encrypted with 4096-bit RSA key, ID 3B7AA7F014E69B5A, created 2016-12-21



> It seems this refers to the very first line of the expected output? I
> have updated the expected file to use an absolute date, and the test
> script to set notmuch-show-relative-dates to nil as you suggest.
>

Yes, it's referring to the first line of output.

>> 	 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.
>
> T357?
>
>> I think the same solution can be applied, but you will need to inline
>> the output so that you can do variable substitution.
>
> I'm lost on what you're suggesting/expecting for this one. Remove the
> angle brackets from the "Good signature" line of the expected file?

Have a look at commit 8723e707c15f7b435f07f5d5ea693496bb9769bb, in
particular the lines

if [ $NOTMUCH_GMIME_EMITS_ANGLE_BRACKETS == 1 ]; then
   EXPECTED_EMAIL_ADDR='<test_suite@notmuchmail.org>'
else
   EXPECTED_EMAIL_ADDR='test_suite@notmuchmail.org'
fi

Then you can use $EXPECTED_EMAIL_ADDR in the expected output. This means
you'll have to generate the expected output rather than hard coding it
in a file. To pick some examples at random, you can see how to do
something similar on lines 157 and 222 of T035-read-config.sh

>
>> 	 [ 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.
>> [...]
>
> I see; unfortunate choice of MIME part. As it seems I will need to
> generate a new test message anyway, what would be a more "portable"
> part? PNG?

PNG should not be worse, but the output might still need postprocessing
to avoid variation.

      reply	other threads:[~2022-05-18 10:29 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
2022-05-11 15:41                   ` Alexander Adolf
2022-05-16 16:17                   ` Alexander Adolf
2022-05-18 10:29                     ` David Bremner [this message]

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=87pmkbb0cw.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).