mirror of https://git.sr.ht/~sircmpwn/core-go
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.
This commit is contained in:
parent
144fc447a3
commit
78b6f7232a
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue