Open lel-amri opened 11 months ago
Hello @austinvalle, I'm sorry to ping you, but I'd like to bring your attention to this three months old issue, which have a small pull request (https://github.com/hashicorp/terraform-provider-cloudinit/pull/170) waiting. It seems to me that you are the only maintainer for this provider currently.
Terraform CLI and Provider Versions
terraform version
:Use Cases or Problem Statement
The cloud-init provider sets
Content-Transfer-Encoding
to7bit
and doesn't make that configurable. This prevent users from having non-ASCII encoded payloads, such as UTF-8 encoded text with characters above the 0x7F code point.Proposal
There are two encodings that "officially" allow non-ASCII characters in MIME body: quoted-printable and base64. Terraform does not provide a built-in way to escape a string with the quoted-printable style, as defined in RFC 2045, which leave the base64 encoding, which is provided by the textencodebase64 function. This is why I lean towards using base64 encoding rather than quoted-printable escaping.
I suggest we let the user decide a value for
Content-Transfer-Encoding
inpart
blocks, with a default of7bit
. This way the cloud-init provider can stay dumb (the user is responsible for providing sensible values to the arguments (this is already the case as of today)) and there are no retro-compatibility issues.Otherwise, we could do the "smart" thing automatically: If we detect bytes greater than 0x7F in
content
, we automatically encode the content to base64 and we setContent-Transfer-Encoding
tobase64
. This is a simple behavior that should always work, if we believe the RFCs. This shouldn't break retro-compatibility because cloud-init is unable to read MIME that haveContent-Transfer-Encoding
set to7bit
and a body with characters greater than 0x7F. The error looks like this:Working configurations will keep working. Broken configurations will at best start working and at worst stay broken.
How much impact is this issue causing?
Medium
Additional Information
No response
Code of Conduct