const char *ident;
ident = auth_penalty_get_ident(auth_request);
- if (penalty->disabled || ident == NULL) {
+ if (penalty->disabled || ident == NULL || auth_request->no_penalty) {
callback(0, auth_request);
return;
}
const char *ident;
ident = auth_penalty_get_ident(auth_request);
- if (penalty->disabled || ident == NULL)
+ if (penalty->disabled || ident == NULL || auth_request->no_penalty)
return;
if (value > AUTH_PENALTY_MAX_PENALTY) {
auth_stream_reply_add(reply, "skip_password_check", "1");
if (request->valid_client_cert)
auth_stream_reply_add(reply, "valid-client-cert", "1");
+ if (request->no_penalty)
+ auth_stream_reply_add(reply, "no-penalty", "1");
if (request->mech_name != NULL)
auth_stream_reply_add(reply, "mech", request->mech_name);
}
request->no_login = TRUE;
else if (strcmp(key, "valid-client-cert") == 0)
request->valid_client_cert = TRUE;
+ else if (strcmp(key, "no-penalty") == 0)
+ request->no_penalty = TRUE;
else if (strcmp(key, "skip_password_check") == 0) {
i_assert(request->master_user != NULL);
request->skip_password_check = TRUE;
unsigned int proxy:1;
unsigned int proxy_maybe:1;
unsigned int valid_client_cert:1;
+ unsigned int no_penalty:1;
unsigned int cert_username:1;
unsigned int userdb_lookup:1;
unsigned int userdb_lookup_failed:1;
if ((info->flags & AUTH_REQUEST_FLAG_SECURED) != 0)
str_append(str, "\tsecured");
+ if ((info->flags & AUTH_REQUEST_FLAG_NO_PENALTY) != 0)
+ str_append(str, "\tno-penalty");
if ((info->flags & AUTH_REQUEST_FLAG_VALID_CLIENT_CERT) != 0)
str_append(str, "\tvalid-client-cert");
enum auth_request_flags {
AUTH_REQUEST_FLAG_SECURED = 0x01,
- AUTH_REQUEST_FLAG_VALID_CLIENT_CERT = 0x02
+ AUTH_REQUEST_FLAG_VALID_CLIENT_CERT = 0x02,
+ /* Skip penalty checks for this request */
+ AUTH_REQUEST_FLAG_NO_PENALTY = 0x04
};
enum auth_request_status {