1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-08-13 20:04:49 +02:00

Fix: Align websocket new message values with global Message Summary (no null values) (#526)

This commit is contained in:
Ralph Slooten
2025-06-24 17:06:44 +12:00
parent cc5991c038
commit 79e9439858

View File

@@ -168,6 +168,24 @@ func Store(body *[]byte, username *string) (string, error) {
return "", err
}
// we do not want to to broadcast null values for MetaData else this does not align
// with the message summary documented in the API docs, so we set them to empty slices.
if c.From == nil {
c.From = &mail.Address{}
}
if c.To == nil {
c.To = []*mail.Address{}
}
if c.Cc == nil {
c.Cc = []*mail.Address{}
}
if c.Bcc == nil {
c.Bcc = []*mail.Address{}
}
if c.ReplyTo == nil {
c.ReplyTo = []*mail.Address{}
}
c.Created = created
c.ID = id
c.MessageID = messageID