diff src/imap-login/client-authenticate.c @ 3059:08c640bdf749 HEAD

If authentication failed because of temporary failure, show different error message to clients.
author Timo Sirainen <tss@iki.fi>
date Fri, 07 Jan 2005 19:29:25 +0200
parents e624a9ad6a30
children 3b75956d20c4
line wrap: on
line diff
--- a/src/imap-login/client-authenticate.c	Fri Jan 07 19:27:20 2005 +0200
+++ b/src/imap-login/client-authenticate.c	Fri Jan 07 19:29:25 2005 +0200
@@ -85,13 +85,15 @@
 	const char *reason = NULL, *host = NULL, *destuser = NULL, *pass = NULL;
 	string_t *reply;
 	unsigned int port = 143;
-	int proxy = FALSE;
+	int proxy = FALSE, temp = FALSE;
 
 	for (; *args != NULL; args++) {
 		if (strcmp(*args, "nologin") == 0)
 			nologin = TRUE;
 		else if (strcmp(*args, "proxy") == 0)
 			proxy = TRUE;
+		else if (strcmp(*args, "temp") == 0)
+			temp = TRUE;
 		else if (strncmp(*args, "reason=", 7) == 0)
 			reason = *args + 7;
 		else if (strncmp(*args, "host=", 5) == 0)
@@ -146,6 +148,8 @@
 		reply = t_str_new(128);
 		if (reason != NULL)
 			str_printfa(reply, "NO %s", reason);
+		else if (temp)
+			str_append(reply, "NO "AUTH_TEMP_FAILED_MSG);
 		else
 			str_append(reply, "NO "AUTH_FAILED_MSG);
 		client_send_tagline(client, str_c(reply));