changeset 8106:16cb3a2b25ab HEAD

If client disconnects without any auth attempts, don't log "auth failed".
author Timo Sirainen <tss@iki.fi>
date Mon, 25 Aug 2008 17:14:27 +0300
parents ad9ad222729c
children dfae8a7d695b
files src/imap-login/client.c src/pop3-login/client.c
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap-login/client.c	Mon Aug 25 16:47:22 2008 +0300
+++ b/src/imap-login/client.c	Mon Aug 25 17:14:27 2008 +0300
@@ -547,8 +547,10 @@
 	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);
--- a/src/pop3-login/client.c	Mon Aug 25 16:47:22 2008 +0300
+++ b/src/pop3-login/client.c	Mon Aug 25 17:14:27 2008 +0300
@@ -352,8 +352,10 @@
 	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);