1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00

chasquid: Add an expvar to count incoming TLS status

This commit is contained in:
Alberto Bertogli
2016-10-11 22:58:05 +01:00
parent eadd0ffc89
commit 6747f0785e

View File

@@ -52,6 +52,7 @@ var (
responseCodeCount = expvar.NewMap("chasquid/smtpIn/responseCodeCount")
spfResultCount = expvar.NewMap("chasquid/smtpIn/spfResultCount")
loopsDetected = expvar.NewInt("chasquid/smtpIn/loopsDetected")
tlsCount = expvar.NewMap("chasquid/smtpIn/tlsCount")
)
func main() {
@@ -798,6 +799,11 @@ func (c *Conn) DATA(params string) (code int, msg string) {
}
c.tr.Debugf("<- 354 You experience a strange sense of peace")
if c.onTLS {
tlsCount.Add("tls", 1)
} else {
tlsCount.Add("plain", 1)
}
// Increase the deadline for the data transfer to the connection-level
// one, we don't want the command timeout to interfere.