satellite/email: Move MIME-Version header to the last element before Content-Type

Some MTAs are marking our emails as SPAM because of the current location of the header.

Change-Id: I3f12c36b184f69b643a8299f5ccbc609f4599ef9
This commit is contained in:
Ethan 2021-12-17 11:25:34 -06:00
parent b7b010adc9
commit 185617326c

View File

@ -46,7 +46,6 @@ func (msg *Message) Bytes() (data []byte, err error) {
var body bytes.Buffer
// write headers
fmt.Fprintf(&body, "MIME-Version: 1.0\r\n")
fmt.Fprintf(&body, "Subject: %v\r\n", mime.QEncoding.Encode("utf-8", msg.Subject))
fmt.Fprintf(&body, "From: %s\r\n", &msg.From)
for _, to := range msg.To {
@ -62,6 +61,7 @@ func (msg *Message) Bytes() (data []byte, err error) {
if msg.ID != "" {
fmt.Fprintf(&body, "Message-ID: <%v>\r\n", mime.QEncoding.Encode("utf-8", msg.ID))
}
fmt.Fprintf(&body, "MIME-Version: 1.0\r\n")
switch {
// multipart upload