MailCore / mailcore2

MailCore 2 provide a simple and asynchronous API to work with e-mail protocols IMAP, POP and SMTP. The API has been redesigned from ground up.
Other
2.62k stars 628 forks source link

PGP Encrypted Attachments need a filename #1589

Open wyllys66 opened 7 years ago

wyllys66 commented 7 years ago

When "openPGPEncryptedMessageDataWithEncryptedData" function in src/core/rfc822/MCMessageBuilder.mm adds the encrypted attachment, it should also add a filename, content-transfer-encoding, and content-disposition so mail clients that dont handle PGP directly can at least display the contents in a text file.

For example, currently the encrypted part looks like this in the message that the MessageBuilder generates:

--5861d624_74b0dc51_11470
Content-Type: application/octet-stream

-----BEGIN PGP MESSAGE-----

hQEMA/Lu3LbUsEKQAQf+LvlaImWZGXQ0IXememfGqv6jCAE0v41CdLeEvdZVjGq18YTYVjh/Bg3r
9RJDkTd5s4R1tE9ep1Nkvmc1hV2/PY2q0292zbaonJ0tThY9ARm0Qdk/TuZdUvqDpGQqPoPtXe6h
...

It should look something like this:

Content-Type: application/octet-stream; name="encrypted.asc"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="encrypted.asc"

-----BEGIN PGP MESSAGE-----

hQEMA/Lu3LbUsEKQAQgArYn299ttrQ7dkKP0orAonK+0cVYVfSZv8lYTGcJAz4vf
x9OvkSv0CBbd6O7WttiZjzWt2UsB1oqfYwX8FRYxvIrxzdMz+kjy9edeUZqi62Cw
zVKQM6yXlybLuz+aDNVRv6Px3XfgqU6GAjVqNUe+46Ty4xMB97sxfzvJknuq8l+t
...

Most PGP/MIME clients generate the PGP attachment with a filename such as "encrypted.asc" so that the recipient knows which part contains the PGP message, otherwise it can be confusing.

yaroslav2308 commented 3 months ago

Implementing PGP in my client and facing same issue. Hope this will be made public