]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: auth-request-handler - Return "anonymous" field for AUTH command that yields...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Mon, 12 Aug 2019 19:06:51 +0000 (21:06 +0200)
committerStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 13 Aug 2019 22:46:26 +0000 (00:46 +0200)
src/auth/auth-request-handler.c

index 0575e0ce06efe099f400a898038edb34fa2b3650..cfdf55e6f556228bf5ed2629f917652594cfab1d 100644 (file)
@@ -182,7 +182,13 @@ auth_str_append_extra_fields(struct auth_request *request, string_t *dest)
        if (request->master_user != NULL &&
            !auth_fields_exists(request->extra_fields, "auth_user"))
                auth_str_add_keyvalue(dest, "auth_user", request->master_user);
-
+       if (*request->set->anonymous_username != '\0' &&
+           null_strcmp(request->user, 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(dest, "\tanonymous");
+       }
        if (!request->auth_only &&
            auth_fields_exists(request->extra_fields, "proxy")) {
                /* we're proxying */