mirror of
https://github.com/mjl-/mox.git
synced 2025-07-13 06:54:38 +03:00
in starttls command in smtp & imap server, add the cid in the "ok, go ahead with tls" response
so facilitate debugging. a remote client that logs details about failing connections can give the cid to the mox operator to find the relevant logging.
This commit is contained in:
@ -880,7 +880,8 @@ func (c *conn) cmdStarttls(p *parser) {
|
||||
}
|
||||
}
|
||||
|
||||
c.writecodeline(smtp.C220ServiceReady, smtp.SeOther00, "go!", nil)
|
||||
// We add the cid to the output, to help debugging in case of a failing TLS connection.
|
||||
c.writecodeline(smtp.C220ServiceReady, smtp.SeOther00, "go! ("+mox.ReceivedID(c.cid)+")", nil)
|
||||
tlsConn := tls.Server(conn, c.tlsConfig)
|
||||
cidctx := context.WithValue(mox.Context, mlog.CidKey, c.cid)
|
||||
ctx, cancel := context.WithTimeout(cidctx, time.Minute)
|
||||
|
Reference in New Issue
Block a user