mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
parent
862739292e
commit
4934aee8fb
2 changed files with 8 additions and 1 deletions
1
changes/28032-email-to-header
Normal file
1
changes/28032-email-to-header
Normal file
|
|
@ -0,0 +1 @@
|
|||
- Fixed missing To: email header
|
||||
|
|
@ -78,7 +78,13 @@ func getMessageBody(e fleet.Email, f fromFunc) ([]byte, error) {
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to obtain from address: %w", err)
|
||||
}
|
||||
msg := []byte(subject + from + mime + content + "\r\n" + string(body) + "\r\n")
|
||||
to := ""
|
||||
if len(e.To) == 1 {
|
||||
to = "To: " + e.To[0] + "\r\n"
|
||||
} else if len(e.To) > 1 {
|
||||
to = "To: undisclosed-recipients\r\n"
|
||||
}
|
||||
msg := []byte(subject + from + to + mime + content + "\r\n" + string(body) + "\r\n")
|
||||
return msg, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue