Adding IP address to logs for 535 LOGIN errors, to use with fail2ban (#301)

This commit is contained in:
tlavoie 2021-08-19 15:17:28 -07:00 committed by GitHub
parent 3d40ea7280
commit dc7ac3c696
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,7 +76,7 @@ sub SASL {
else { else {
$msg = $msg =
uc($mechanism) uc($mechanism)
. " authentication failed for $user" . " authentication failed for $user from $ENV{TCPREMOTEIP}"
. ($msg ? " - $msg" : ''); . ($msg ? " - $msg" : '');
$session->respond(535, $msg); $session->respond(535, $msg);
$session->log(LOGDEBUG, $msg); # already logged by $session->respond $session->log(LOGDEBUG, $msg); # already logged by $session->respond