1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-18 14:47:03 +00:00

chasquid: Keep an AUTH event log

This patch adds an AUTH event log, to help troubleshoot issues with
authentication.
This commit is contained in:
Alberto Bertogli
2016-10-12 16:26:04 +01:00
parent 6747f0785e
commit a7afa08e7c

View File

@@ -55,6 +55,11 @@ var (
tlsCount = expvar.NewMap("chasquid/smtpIn/tlsCount")
)
// Global event logs.
var (
authLog = trace.NewEventLog("Authentication", "Incoming SMTP")
)
func main() {
flag.Parse()
@@ -1013,9 +1018,13 @@ func (c *Conn) AUTH(params string) (code int, msg string) {
c.authUser = user
c.authDomain = domain
c.completedAuth = true
authLog.Debugf("%s successful for %s@%s",
c.netconn.RemoteAddr().String(), user, domain)
return 235, ""
}
authLog.Debugf("%s failed for %s@%s",
c.netconn.RemoteAddr().String(), user, domain)
return 535, "Incorrect user or password"
}