diff --git a/builtin/providers/template/resource_cloudinit_config.go b/builtin/providers/template/resource_cloudinit_config.go index 88af9bef2..86798b8c7 100644 --- a/builtin/providers/template/resource_cloudinit_config.go +++ b/builtin/providers/template/resource_cloudinit_config.go @@ -170,6 +170,7 @@ func renderPartsToWriter(parts cloudInitParts, writer io.Writer) error { } writer.Write([]byte(fmt.Sprintf("Content-Type: multipart/mixed; boundary=\"%s\"\n", mimeWriter.Boundary()))) + writer.Write([]byte("MIME-Version: 1.0\r\n")) for _, part := range parts { header := textproto.MIMEHeader{} @@ -179,6 +180,9 @@ func renderPartsToWriter(parts cloudInitParts, writer io.Writer) error { header.Set("Content-Type", part.ContentType) } + header.Set("MIME-Version", "1.0") + header.Set("Content-Transfer-Encoding", "7bit") + if part.Filename != "" { header.Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"`, part.Filename)) }