]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pop3c: If authentication fails, log if it was done with USER+PASS or AUTH PLAIN
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 19 Jan 2016 00:30:53 +0000 (02:30 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 19 Jan 2016 00:30:53 +0000 (02:30 +0200)
src/lib-storage/index/pop3c/pop3c-client.c

index be7e0b014f940353b0b7050cd186d6008b5ed704..d35ebeafe7cb838b3ee241eebce0e7669fdc3697 100644 (file)
@@ -54,6 +54,7 @@ struct pop3c_client {
 
        enum pop3c_client_state state;
        enum pop3c_capability capabilities;
+       const char *auth_mech;
 
        pop3c_login_callback_t *login_callback;
        void *login_context;
@@ -370,6 +371,7 @@ pop3c_client_prelogin_input_line(struct pop3c_client *client, const char *line)
                o_stream_nsend_str(client->output,
                        t_strdup_printf("PASS %s\r\n", client->set.password));
                client->state = POP3C_CLIENT_STATE_PASS;
+               client->auth_mech = "USER+PASS";
                break;
        case POP3C_CLIENT_STATE_AUTH:
                if (line[0] != '+') {
@@ -380,6 +382,7 @@ pop3c_client_prelogin_input_line(struct pop3c_client *client, const char *line)
                o_stream_nsend_str(client->output,
                        pop3c_client_get_sasl_plain_request(client));
                client->state = POP3C_CLIENT_STATE_PASS;
+               client->auth_mech = "AUTH PLAIN";
                break;
        case POP3C_CLIENT_STATE_PASS:
                if (client->login_callback != NULL) {
@@ -390,8 +393,8 @@ pop3c_client_prelogin_input_line(struct pop3c_client *client, const char *line)
                                              POP3C_COMMAND_STATE_OK :
                                              POP3C_COMMAND_STATE_ERR, reply);
                } else if (!success) {
-                       i_error("pop3c(%s): Authentication failed: %s",
-                               client->set.host, line);
+                       i_error("pop3c(%s): Authentication via %s failed: %s",
+                               client->set.host, client->auth_mech, line);
                }
                if (!success)
                        return -1;