mirror of
https://github.com/mjl-/mox.git
synced 2025-07-13 06:54:38 +03:00
reject attempts at starttls for smtp & imap when no tls config is present
we didn't announce starttls as capability, but clients can still try them. we would try to do a handshake with a nil certificate, which would cause a goroutine panic (which is handled gracefully, shutting down the connection). found with code that was doing starttls unconditionally.
This commit is contained in:
@ -931,6 +931,9 @@ func (c *conn) cmdStarttls(p *parser) {
|
||||
if c.account != nil {
|
||||
xsmtpUserErrorf(smtp.C503BadCmdSeq, smtp.SeProto5BadCmdOrSeq1, "cannot starttls after authentication")
|
||||
}
|
||||
if c.tlsConfig == nil {
|
||||
xsmtpUserErrorf(smtp.C503BadCmdSeq, smtp.SeProto5BadCmdOrSeq1, "starttls not offered")
|
||||
}
|
||||
|
||||
// We don't want to do TLS on top of c.r because it also prints protocol traces: We
|
||||
// don't want to log the TLS stream. So we'll do TLS on the underlying connection,
|
||||
|
Reference in New Issue
Block a user