1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2026-05-01 09:05:27 +00:00

maillog: Fix empty lines in the authentication log entries

In maillog.Auth, we currently have a newline in the log entry args.

The blitiri.com.ar/go/log package handles trailing newlines, but only in
the format parameter, not in the args.

Because of this, the authentication log entries in the maillog currently
end with an extra newline.

This patch fixes the problem by removing the unnecessary newline from
the message.

https://github.com/albertito/chasquid/pull/82

Amended-by: Alberto Bertogli <albertito@blitiri.com.ar>
  Adjusted commit message.
This commit is contained in:
xrstf
2026-04-06 17:39:51 +02:00
committed by Alberto Bertogli
parent af7b1d895c
commit 013af62116

View File

@@ -96,7 +96,7 @@ func (l *Logger) Auth(netAddr net.Addr, user string, successful bool) {
if !successful { if !successful {
res = "failed" res = "failed"
} }
msg := fmt.Sprintf("%s auth %s for %s\n", netAddr, res, user) msg := fmt.Sprintf("%s auth %s for %s", netAddr, res, user)
l.printf("%s", msg) l.printf("%s", msg)
authLog.Debugf("%s", msg) authLog.Debugf("%s", msg)
} }