MCPcopy Create free account
hub / github.com/foxcpp/maddy / NewSession

Method NewSession

internal/endpoint/smtp/smtp.go:385–399  ·  view source on GitHub ↗
(conn *smtp.Conn)

Source from the content-addressed store, hash-verified

383}
384
385func (endp *Endpoint) NewSession(conn *smtp.Conn) (smtp.Session, error) {
386 sess := endp.newSession(conn)
387
388 // Executed before authentication and session initialization.
389 if err := endp.pipeline.RunEarlyChecks(context.TODO(), &sess.connState); err != nil {
390 if err := sess.Logout(); err != nil {
391 endp.log.Error("early checks logout failed", err)
392 }
393 return nil, endp.wrapErr("", true, "EHLO", err)
394 }
395
396 endp.sessionCnt.Add(1)
397
398 return sess, nil
399}
400
401func (endp *Endpoint) newSession(conn *smtp.Conn) *Session {
402 s := &Session{

Callers 1

TestSubmissionPrepareFunction · 0.45

Calls 6

newSessionMethod · 0.95
wrapErrMethod · 0.95
RunEarlyChecksMethod · 0.80
AddMethod · 0.80
LogoutMethod · 0.45
ErrorMethod · 0.45

Tested by 1

TestSubmissionPrepareFunction · 0.36