1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-21 11:37:07 +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

@@ -14,6 +14,7 @@ import (
"github.com/jhillyerd/inbucket/config"
"github.com/jhillyerd/inbucket/httpd"
"github.com/jhillyerd/inbucket/log"
"github.com/jhillyerd/inbucket/msghub"
"github.com/jhillyerd/inbucket/pop3d"
"github.com/jhillyerd/inbucket/rest"
"github.com/jhillyerd/inbucket/smtpd"
@@ -95,6 +96,9 @@ func main() {
}
}
// Create message hub
msgHub := msghub.New(rootCtx, 100)
// Grab our datastore
ds := smtpd.DefaultFileDataStore()
@@ -110,7 +114,7 @@ func main() {
go pop3Server.Start(rootCtx)
// Startup SMTP server
smtpServer = smtpd.NewServer(config.GetSMTPConfig(), ds, shutdownChan)
smtpServer = smtpd.NewServer(config.GetSMTPConfig(), shutdownChan, ds, msgHub)
go smtpServer.Start(rootCtx)
// Loop forever waiting for signals or shutdown channel