Split the concrete SMTP struct into separate MSA and MTA implementations

This commit is contained in:
2018-03-07 23:52:42 +00:00
parent 2ac0975dfc
commit 1d0fdec642
4 changed files with 152 additions and 105 deletions

View File

@@ -40,16 +40,16 @@ type concrete struct {
}
// For now, bind unconditionally to these ports, on IPv4 + IPv6:
// 25 - incoming SMTP (STARTTLS)
// 587 - outgoing SMTP (STARTTLS)
// 25 - SMTP+MTA (STARTTLS)
// 587 - SMTP+MSA (STARTTLS)
// 143 - IMAP (STARTTLS)
// 993 - IMAP (TLS)
//
// Each listener gets incoming connections serviced against the passed-in store.
func (c *concrete) Run() {
c.servers = []genServer{
smtp.NewServer(c.cancel, c.store, false),
smtp.NewServer(c.cancel, c.store, true),
smtp.NewMTA(c.cancel, c.store),
smtp.NewMSA(c.cancel, c.store),
imap.NewServer(c.cancel, c.store, false),
imap.NewServer(c.cancel, c.store, true),