From 288ba11452a203b0d5ae7e9b8979c50cbad082c5 Mon Sep 17 00:00:00 2001 From: James Houlahan Date: Thu, 1 Oct 2020 16:56:38 +0200 Subject: [PATCH] test: add test for sending pgp/mime as plaintext --- internal/smtp/preferences_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/internal/smtp/preferences_test.go b/internal/smtp/preferences_test.go index 45f172f9..c0e3446e 100644 --- a/internal/smtp/preferences_test.go +++ b/internal/smtp/preferences_test.go @@ -254,6 +254,20 @@ func TestPreferencesBuilder(t *testing.T) { wantMIMEType: "multipart/mixed", }, + { + name: "external with sign enabled, sending plaintext, should still send as ClearMIME", + + contactMeta: &ContactMetadata{Sign: true, SignIsSet: true}, + receivedKeys: []pmapi.PublicKey{}, + isInternal: false, + mailSettings: pmapi.MailSettings{PGPScheme: pmapi.PGPMIMEPackage, DraftMIMEType: "text/plain"}, + + wantEncrypt: false, + wantSign: true, + wantScheme: pmapi.ClearMIMEPackage, + wantMIMEType: "multipart/mixed", + }, + { name: "external with pinned contact public key but no intention to encrypt/sign",