aboutsummaryrefslogtreecommitdiffstats
path: root/worker/imap
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2024-08-23 20:12:56 +0200
committerRobin Jarry <robin@jarry.cc>2024-08-24 15:49:17 +0200
commit7346d20343b9fa8b192c9a5294b26efac9186c4f (patch)
tree6737fd56133a963cae415d7893c6db5de64f346b /worker/imap
parent3ce5670fdcb39cab15000c6248adfd127fd8b398 (diff)
downloadaerc-7346d20343b9fa8b192c9a5294b26efac9186c4f.tar.gz
gpg: fix signed message encoding
Fix the content encoding for GPG-signed messages. To remove the Mime-Version header field for the signed message part, the raw message is parsed with go-message. go-message.Read(), however, decodes the message body as well (i.e. from quoted-printable to UTF8 depending on the Content-Transfer-Encoding header). This means that the msg.Body field now contains the decoded message (it is no longer encoded as quoted-printable). We never encode the message back to the proper Content-Transfer-Encoding. To fix this, use net/mail.ReadMessage() to parse the headers and to not decode the message body. To verify the issue, send a signed message with the following text: "19+1=20!" The message will be properly signed, but the text is wrong; it shows "19+1 !"; instead it should read "19+1=3D20!". Fixes: 5e443bce ("gpg: fix mime-version header position") References: https://todo.sr.ht/~rjarry/aerc/79 Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Jens Grassel <jens@wegtam.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'worker/imap')
0 files changed, 0 insertions, 0 deletions