func newMsgListener(hub *msghub.Hub, mailbox string) *msgListener {
	ml := &msgListener{
		hub:     hub,
		c:       make(chan msghub.Message, 100),
		mailbox: mailbox,
	}
	hub.AddListener(ml)
	return ml
}
newMsgListener creates a listener and registers it.  Optional mailbox parameter will restrict
messages sent to WebSocket to that mailbox only.
package rest
import (
	"net/http"
	"time"
	"github.com/gorilla/websocket"
	"github.com/inbucket/inbucket/pkg/msghub"
	"github.com/inbucket/inbucket/pkg/rest/model"
	"github.com/inbucket/inbucket/pkg/server/web"
	"github.com/rs/zerolog/log"
)
const (
	writeWait = 10 * time.Second
	pingPeriod = (pongWait * 9) / 10
	pongWait = 60 * time.Second
	maxMessageSize = 512
)
var upgrader = websocket.Upgrader{
	ReadBufferSize:  1024,
	WriteBufferSize: 1024,
}
type msgListener struct {
	hub     *msghub.Hub          
	c       chan msghub.Message  
	mailbox string               
}