8 "src.bluestatic.org/mailpopbox/smtp"
11 func runSMTPServer(config Config) <-chan error {
20 type smtpServer struct {
25 func (server *smtpServer) run() {
26 l, err := net.Listen("tcp", fmt.Sprintf(":%d", server.config.SMTPPort))
33 conn, err := l.Accept()
39 go smtp.AcceptConnection(conn, server)
43 func (server *smtpServer) Name() string {
44 return server.config.Hostname
47 func (server *smtpServer) TLSConfig() *tls.Config {
51 func (server *smtpServer) OnEHLO() *smtp.ReplyLine {
55 func (server *smtpServer) OnMessageDelivered(en smtp.Envelope) *smtp.ReplyLine {
56 fmt.Printf("MSG: %#v\n%s\n", en, string(en.Data))