Closed cocoliliace closed 1 year ago
What is the motivation for this? Why is the case-mapping important to you?
Consumers must process header field names in a case-insensitive manner.
If this is purely cosmetic, I'd rather not make go-message more complicated.
My email provider (migadu) automatically converts the Mime-Version
in my outgoing emails to MIME-Version
. This messes up all my GPG-signed emails, since the signature is made with Mime-Version
in the content, but the received email has MIME-Version
.
This sounds like a Migadu bug. Even if we change it to MIME-Version
, this may break another provider may convert the casing to the other way around. I'd suggest getting in touch with Migadu support.
I've reached out. Thank you for the help.
This came up on IRC today too, and the user was able to send me a message encrypted with neomutt through migadu. After looking at the differences, I found that aerc has MIME-Version in the body part (which is included in the signed content) while neomutt has it at the top level. I checked the RFC2045 and it does state:
Note that the MIME-Version header field is required at the top level of a message. It is not required for each body part of a multipart entity.
So, this turns out to be an aerc bug. I'll send in a patch to the aerc mailing list for it.
The casing for
Mime-Version
,Content-Id
, andMessage-Id
in RFC 2045 appear to beMIME-Version
,Content-ID
, andMessage-ID
. The header keys are currently being processed bytextproto.CanonicalMIMEHeaderKey
, which produces the former casing. The upstream said that they will not change it, so I propose that we change go-message, or add the option to use the RFC 2045 convention.A discussion from another project suggested adding a wrapper to
textproto.CanonicalMIMEHeaderKey
in go-message, and replacing calls totextproto.CanonicalMIMEHeaderKey
with the wrapper, if I understood it correctly.