1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-20 02:57:05 +00:00

Broadcast deliveries into msghub for #44

This commit is contained in:
James Hillyerd
2017-01-16 13:09:50 -08:00
parent 6ca2c27747
commit b3db619db9
8 changed files with 69 additions and 13 deletions

View File

@@ -13,6 +13,7 @@ import (
"time"
"github.com/jhillyerd/inbucket/log"
"github.com/jhillyerd/inbucket/msghub"
)
// State tracks the current mode of our SMTP state machine
@@ -464,6 +465,18 @@ func (ss *Session) deliverMessage(r recipientDetails, msgBuf [][]byte) (ok bool)
return false
}
// Broadcast message information
broadcast := msghub.Message{
Mailbox: r.mailbox.Name(),
ID: msg.ID(),
From: msg.From(),
To: msg.To(),
Subject: msg.Subject(),
Date: msg.Date(),
Size: msg.Size(),
}
ss.server.msgHub.Broadcast(broadcast)
return true
}