From: Marco Bettini Date: Fri, 19 May 2023 09:50:45 +0000 (+0000) Subject: auth: user_callback() - Check if the user is anonymous X-Git-Tag: 2.4.0~2722 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d38b0a9df563cb9a00775457e1d4934482727413;p=thirdparty%2Fdovecot%2Fcore.git auth: user_callback() - Check if the user is anonymous --- diff --git a/src/auth/auth-master-connection.c b/src/auth/auth-master-connection.c index 476515449e..7e7d8b002b 100644 --- a/src/auth/auth-master-connection.c +++ b/src/auth/auth-master-connection.c @@ -299,6 +299,14 @@ user_callback(enum userdb_result result, str_append_tabescaped(str, auth_request->fields.user); auth_fields_append(auth_request->fields.userdb_reply, str, AUTH_FIELD_FLAG_HIDDEN, 0, TRUE); + if (*auth_request->set->anonymous_username != '\0' && + strcmp(auth_request->fields.user, + auth_request->set->anonymous_username) == 0) { + /* this is an anonymous login, either via ANONYMOUS + SASL mechanism or simply logging in as the anonymous + user via another mechanism */ + str_append(str, "\tanonymous"); + } break; }