]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp, quota-status: Don't send mail_storage_service_lookup() error to client.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 27 May 2016 09:49:30 +0000 (12:49 +0300)
committerGitLab <gitlab@git.dovecot.net>
Mon, 30 May 2016 12:26:24 +0000 (15:26 +0300)
This is in preparation for changing the returned error to contain the full
error string. The current error string is pretty useless for any purpose.

src/lmtp/commands.c
src/plugins/quota/quota-status.c

index 77d271cb7bb244e36fc95d130c040990d694f602..49abcafd616345e1a14a899c0cbdc21e01983d47 100644 (file)
@@ -627,7 +627,7 @@ int cmd_rcpt(struct client *client, const char *args)
 {
        struct mail_recipient *rcpt;
        struct mail_storage_service_input input;
-       const char *params, *address, *username, *detail, *prefix;
+       const char *params, *address, *username, *detail;
        const char *const *argv;
        const char *error = NULL;
        char delim = '\0';
@@ -691,9 +691,8 @@ int cmd_rcpt(struct client *client, const char *args)
                                          &rcpt->service_user, &error);
 
        if (ret < 0) {
-               prefix = t_strdup_printf(ERRSTR_TEMP_USERDB_FAIL_PREFIX,
-                                        username);
-               client_send_line(client, "%s%s", prefix, error);
+               i_error("Failed to lookup user %s: %s", username, error);
+               client_send_line(client, ERRSTR_TEMP_MAILBOX_FAIL, address);
                return 0;
        }
        if (ret == 0) {
index 53164b282f10f3d3708ed3c5ab679e3cd8519920..f2ab82ee95457d891c96d940157df11dff12f9f1 100644 (file)
@@ -117,7 +117,11 @@ static void client_handle_request(struct quota_client *client)
                value = t_strdup(value); /* user's pool is being freed */
                mail_user_unref(&user);
                mail_storage_service_user_free(&service_user);
+       } else {
+               i_error("Failed to lookup user %s: %s", input.username, error);
+               error = "Temporary internal error";
        }
+
        if (ret < 0) {
                /* temporary failure */
                o_stream_send_str(client->conn.output, t_strdup_printf(