go-pgpmail
go-pgpmail copied to clipboard
writer creates multipart MIME messages without the MIME-Version header
MIME messages must specify the MIME-Version header at the top level of the message to be compliant with the rfc. However, the writer sets only the multipart MIME types, not the MIME-Version.
Users could set the MIME-Version in the header that is passed to pgpmail. But most are not aware of this. It would be helpful if pgpmail would set the MIME-Version directly.
Would it make sense to set the MIME-Version in the writer?
I'm not sure. pgpmail is supposed to only add PGP-related header fields, not other arbitrary header fields.
On Sun Jan 21, 2024 at 4:06 PM CET, Simon Ser wrote:
I'm not sure. pgpmail is supposed to only add PGP-related header fields, not other arbitrary header fields.
Ok, no worries. I just thought I'd bring it to your attention.
go-message.CreateWriter will set the MIME-Version correctly. And in combination with go-pgpmail, the correct cleartext part with the MIME-Version header is wrapped in a new multipart MIME. So one needs to remember to explicitly set the MIME-Version for the top level.
Hm, that's a good point… And actually, with the examples in the repo, a MIME-Version header field will be added to the encrypted header, which isn't very nice...
I'm not sure what's the best way to fix this issue, but re-opening because I agree it's a valid concern.