]>
src.bluestatic.org Git - mailpopbox.git/blob - smtp.go
9 "src.bluestatic.org/mailpopbox/smtp"
12 func runSMTPServer(config Config
) <-chan error
{
21 type smtpServer
struct {
26 func (server
*smtpServer
) run() {
27 l
, err
:= net
.Listen("tcp", fmt
.Sprintf(":%d", server
.config
.SMTPPort
))
34 conn
, err
:= l
.Accept()
40 go smtp
.AcceptConnection(conn
, server
)
44 func (server
*smtpServer
) Name() string {
45 return server
.config
.Hostname
48 func (server
*smtpServer
) TLSConfig() *tls
.Config
{
52 func (server
*smtpServer
) VerifyAddress(addr mail
.Address
) smtp
.ReplyLine
{
56 func (server
*smtpServer
) OnEHLO() *smtp
.ReplyLine
{
60 func (server
*smtpServer
) OnMessageDelivered(en smtp
.Envelope
) *smtp
.ReplyLine
{
61 fmt
.Printf("MSG: %#v\n%s\n", en
, string(en
.Data
))