Skip to content

Commit

Permalink
server: drop Server.caps
Browse files Browse the repository at this point in the history
No need for this indirection.
  • Loading branch information
emersion committed Feb 21, 2024
1 parent 33fe6a6 commit f7e2f0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 6 additions & 2 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,12 @@ func (c *Conn) handleGreet(enhanced bool, arg string) {
return
}

caps := []string{}
caps = append(caps, c.server.caps...)
caps := []string{
"PIPELINING",
"8BITMIME",
"ENHANCEDSTATUSCODES",
"CHUNKING",
}
if _, isTLS := c.TLSConnectionState(); c.server.TLSConfig != nil && !isTLS {
caps = append(caps, "STARTTLS")
}
Expand Down
2 changes: 0 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ type Server struct {

wg sync.WaitGroup

caps []string
auths map[string]SaslServerFactory
done chan struct{}

Expand All @@ -91,7 +90,6 @@ func NewServer(be Backend) *Server {
Backend: be,
done: make(chan struct{}, 1),
ErrorLog: log.New(os.Stderr, "smtp/server ", log.LstdFlags),
caps: []string{"PIPELINING", "8BITMIME", "ENHANCEDSTATUSCODES", "CHUNKING"},
auths: map[string]SaslServerFactory{
sasl.Plain: func(conn *Conn) sasl.Server {
return sasl.NewPlainServer(func(identity, username, password string) error {
Expand Down

0 comments on commit f7e2f0b

Please sign in to comment.