~bigbes/core-go

78b6f7232af128cde421519c99e8cbb81b837f26 — Conrad Hoffmann 3 years ago 144fc44
email: remove content headers of passed-in message

The email has already been parsed according to the headers, but they are
still present. However, signing or encrypting the email will change the
content format, so remove any such headers before continuing.
1 files changed, 5 insertions(+), 0 deletions(-)

M email/worker.go
M email/worker.go => email/worker.go +5 -0
@@ 99,6 99,11 @@ func EnqueueStd(ctx context.Context, header mail.Header,
		rcpts = append(rcpts, addr.Address)
	}

	// Disallow content headers, signing/encrypting will change this
	header.Del("Content-Transfer-Encoding")
	header.Del("Content-Type")
	header.Del("Content-Disposition")

	if !header.Has("Message-Id") {
		header.GenerateMessageID()
	}