Skip to content

Commit

Permalink
mail: unset Message-Id if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
emersion committed Jan 10, 2024
1 parent 07f7264 commit ee2a79e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mail/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,11 @@ func base36(input uint64) string {
// SetMessageID sets the Message-ID field. id is the message identifier,
// without the angle brackets.
func (h *Header) SetMessageID(id string) {
h.Set("Message-Id", "<"+id+">")
if id != "" {
h.Set("Message-Id", "<"+id+">")
} else {
h.Del("Message-Id")
}
}

// SetMsgIDList formats a list of message identifiers. Message identifiers
Expand Down

0 comments on commit ee2a79e

Please sign in to comment.