dovecot-2.2: imap/pop3-login: If auth failure reason already beg...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 29 17:28:05 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/86b75d360241
changeset: 18893:86b75d360241
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 29 20:25:15 2015 +0300
description:
imap/pop3-login: If auth failure reason already begins with [resp-code], don't prefix it with another one.

diffstat:

 src/imap-login/client-authenticate.c |  8 ++++++--
 src/pop3-login/client.c              |  5 ++++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r b268e186d029 -r 86b75d360241 src/imap-login/client-authenticate.c
--- a/src/imap-login/client-authenticate.c	Mon Jun 29 13:36:38 2015 +0300
+++ b/src/imap-login/client-authenticate.c	Mon Jun 29 20:25:15 2015 +0300
@@ -81,8 +81,12 @@
 		client_send_reply(client, IMAP_CMD_REPLY_BAD, text);
 		break;
 	case CLIENT_AUTH_RESULT_AUTHFAILED_REASON:
-		client_send_reply_code(client, IMAP_CMD_REPLY_NO,
-				       "ALERT", text);
+		if (text[0] == '[')
+			client_send_reply(client, IMAP_CMD_REPLY_NO, text);
+		else {
+			client_send_reply_code(client, IMAP_CMD_REPLY_NO,
+					       "ALERT", text);
+		}
 		break;
 	case CLIENT_AUTH_RESULT_AUTHZFAILED:
 		client_send_reply_code(client, IMAP_CMD_REPLY_NO,
diff -r b268e186d029 -r 86b75d360241 src/pop3-login/client.c
--- a/src/pop3-login/client.c	Mon Jun 29 13:36:38 2015 +0300
+++ b/src/pop3-login/client.c	Mon Jun 29 20:25:15 2015 +0300
@@ -243,7 +243,10 @@
 		prefix = "-ERR [SYS/TEMP]";
 		break;
 	case POP3_CMD_REPLY_AUTH_ERROR:
-		prefix = "-ERR [AUTH]";
+		if (text[0] == '[')
+			prefix = "-ERR";
+		else
+			prefix = "-ERR [AUTH]";
 		break;
 	case POP3_CMD_REPLY_ERROR:
 		break;


More information about the dovecot-cvs mailing list