From: Timo Sirainen Date: Mon, 6 Dec 2010 04:36:30 +0000 (+0000) Subject: auth: When logging in as anonymous user, return "anonymous" userdb extra field. X-Git-Tag: 2.1.alpha1~435 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9981d8da4f564d0448555a939908862ed22f8d58;p=thirdparty%2Fdovecot%2Fcore.git auth: When logging in as anonymous user, return "anonymous" userdb extra field. --- diff --git a/TODO b/TODO index 41a05fa909..f2d9e10bf7 100644 --- a/TODO +++ b/TODO @@ -127,7 +127,6 @@ - read the entire file to memory only once and keep it there, stat() later to see if it has changed. if not, perhaps don't even bother stat()ing dovecot-acl files? at least not that often.. - - add anonymous environment for anon logins (for managesieve mainly) - fs quota: getquotaroot inbox vs. other-box should return different quotas if two quotas are defined - new primes code: are hash tables now being resized too often? diff --git a/src/auth/auth-request-handler.c b/src/auth/auth-request-handler.c index 2d0f773e25..80be810367 100644 --- a/src/auth/auth-request-handler.c +++ b/src/auth/auth-request-handler.c @@ -589,6 +589,15 @@ static void userdb_callback(enum userdb_result result, "master_user", request->master_user); } + if (*request->set->anonymous_username != '\0' && + 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 */ + auth_stream_reply_add(request->userdb_reply, + "anonymous", NULL); + } auth_stream_reply_import(reply, auth_stream_reply_export(request->userdb_reply)); break;