From ec5b5939b9e980694368fe2d0cf9778bff6cfb22 Mon Sep 17 00:00:00 2001 From: James Houlahan Date: Tue, 1 Jun 2021 09:04:05 +0000 Subject: [PATCH] GODT-949: Add comment about ignoring InvalidMediaParameter --- pkg/message/encrypt.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/message/encrypt.go b/pkg/message/encrypt.go index 5e81265c..aba838f6 100644 --- a/pkg/message/encrypt.go +++ b/pkg/message/encrypt.go @@ -66,6 +66,7 @@ func writeEncryptedPart(kr *crypto.KeyRing, header *textproto.Header, r io.Reade encoded := new(bytes.Buffer) contentType, contentParams, err := parseContentType(header.Get("Content-Type")) + // Ignoring invalid media parameter makes it work for invalid tutanota RFC2047-encoded attachment filenames since we often only really need the content type and not the optional media parameters. if err != nil && !errors.Is(err, mime.ErrInvalidMediaParameter) { return nil, err }