From: Timo Sirainen Date: Mon, 25 Aug 2008 14:14:27 +0000 (+0300) Subject: If client disconnects without any auth attempts, don't log "auth failed". X-Git-Tag: 1.2.alpha1~55 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4de81f67714532d4e2a8e9d2a202e2f1ff15db76;p=thirdparty%2Fdovecot%2Fcore.git If client disconnects without any auth attempts, don't log "auth failed". --HG-- branch : HEAD --- diff --git a/src/imap-login/client.c b/src/imap-login/client.c index f7be75a3ef..19e07ff679 100644 --- a/src/imap-login/client.c +++ b/src/imap-login/client.c @@ -547,8 +547,10 @@ void client_destroy(struct imap_client *client, const char *reason) client->destroyed = TRUE; if (!client->login_success && reason != NULL) { - reason = t_strdup_printf("%s (auth failed, %u attempts)", - reason, client->common.auth_attempts); + reason = client->common.auth_attempts == 0 ? + t_strdup_printf("%s (no auth attempts)", reason) : + t_strdup_printf("%s (auth failed, %u attempts)", + reason, client->common.auth_attempts); } if (reason != NULL) client_syslog(&client->common, reason); diff --git a/src/pop3-login/client.c b/src/pop3-login/client.c index d047a7a9b1..ec7980c75e 100644 --- a/src/pop3-login/client.c +++ b/src/pop3-login/client.c @@ -352,8 +352,10 @@ void client_destroy(struct pop3_client *client, const char *reason) client->destroyed = TRUE; if (!client->login_success && reason != NULL) { - reason = t_strdup_printf("%s (auth failed, %u attempts)", - reason, client->common.auth_attempts); + reason = client->common.auth_attempts == 0 ? + t_strdup_printf("%s (no auth attempts)", reason) : + t_strdup_printf("%s (auth failed, %u attempts)", + reason, client->common.auth_attempts); } if (reason != NULL) client_syslog(&client->common, reason);