]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp: Use the path in the server recipient object rather than the lmtp recipient.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 7 Oct 2018 17:47:59 +0000 (19:47 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 12 Feb 2019 13:41:01 +0000 (15:41 +0200)
It is recorded reliably on a pool from the start now.

src/lmtp/lmtp-common.c
src/lmtp/lmtp-common.h
src/lmtp/lmtp-local.c
src/lmtp/lmtp-proxy.c

index 58678e56c64f2bc20be89a281c3d271209b632a4..ca126795eafb11b70767293c8e28261d0c01727f 100644 (file)
@@ -14,7 +14,6 @@ void lmtp_recipient_init(struct lmtp_recipient *lrcpt,
        lrcpt->type = type;
        lrcpt->rcpt_cmd = cmd;
        lrcpt->rcpt = rcpt;
-       lrcpt->path = rcpt->path;
 }
 
 void lmtp_recipient_finish(struct lmtp_recipient *lrcpt)
index 92adcdf6ffc3e62a49f9d67ca5e9f4f63349e376..ae893cfb45d499dade4a209647f24e5db2b6b6e7 100644 (file)
@@ -17,7 +17,6 @@ struct lmtp_recipient {
        struct smtp_server_recipient *rcpt;
        enum lmtp_recipient_type type;
 
-       struct smtp_address *path;
        struct smtp_server_cmd_ctx *rcpt_cmd;
        unsigned int index;
 };
index 29d671506295251b6b31397a2be7435734638869..f0d6721a98b3eefcf221792833a7b1e353eeb0f0 100644 (file)
@@ -127,7 +127,8 @@ lmtp_local_rcpt_reply_overquota(struct lmtp_local_recipient *llrcpt,
                                struct smtp_server_cmd_ctx *cmd,
                                const char *error)
 {
-       struct smtp_address *address = llrcpt->rcpt.path;
+       struct smtp_server_recipient *rcpt = llrcpt->rcpt.rcpt;
+       struct smtp_address *address = rcpt->path;
        unsigned int rcpt_idx = llrcpt->rcpt.index;
        struct lda_settings *lda_set =
                mail_storage_service_user_get_set(llrcpt->service_user)[2];
@@ -158,9 +159,11 @@ lmtp_local_rcpt_fail_all(struct lmtp_local *local,
 
        llrcpts = array_get(&local->rcpt_to, &count);
        for (i = 0; i < count; i++) {
+               struct smtp_server_recipient *rcpt = llrcpts[i]->rcpt.rcpt;
+
                smtp_server_reply_index(cmd, llrcpts[i]->rcpt.index,
                        status, enh_code, "<%s> %s",
-                       smtp_address_encode(llrcpts[i]->rcpt.rcpt->path), msg);
+                       smtp_address_encode(rcpt->path), msg);
        }
 }
 
@@ -172,8 +175,9 @@ static int
 lmtp_local_rcpt_check_quota(struct lmtp_local_recipient *llrcpt)
 {
        struct client *client = llrcpt->rcpt.client;
+       struct smtp_server_recipient *rcpt = llrcpt->rcpt.rcpt;
        struct smtp_server_cmd_ctx *cmd = llrcpt->rcpt.rcpt_cmd;
-       struct smtp_address *address = llrcpt->rcpt.path;
+       struct smtp_address *address = rcpt->path;
        struct mail_user *user;
        struct mail_namespace *ns;
        struct mailbox *box;
@@ -269,7 +273,8 @@ lmtp_local_rcpt_anvil_cb(const char *reply, void *context)
                (struct lmtp_local_recipient *)context;
        struct smtp_server_cmd_ctx *cmd = llrcpt->rcpt.rcpt_cmd;
        struct client *client = llrcpt->rcpt.client;
-       struct smtp_address *address = llrcpt->rcpt.path;
+       struct smtp_server_recipient *rcpt = llrcpt->rcpt.rcpt;
+       struct smtp_address *address = rcpt->path;
        const struct mail_storage_service_input *input;
        unsigned int parallel_count = 0;
 
index 505f17981d3787d5d1f18dea80bb7859cfb936b6..c2ac67f31669e14fe4fb866fbd16da8e5f3259f4 100644 (file)
@@ -56,6 +56,8 @@ struct lmtp_proxy_recipient {
        struct lmtp_recipient rcpt;
        struct lmtp_proxy_connection *conn;
 
+       struct smtp_address *address;
+
        bool rcpt_to_failed:1;
        bool data_reply_received:1;
 };
@@ -569,7 +571,7 @@ int lmtp_proxy_rcpt(struct client *client,
        lprcpt = p_new(rcpt->pool, struct lmtp_proxy_recipient, 1);
        lmtp_recipient_init(&lprcpt->rcpt, client,
                            LMTP_RECIPIENT_TYPE_PROXY, cmd, rcpt);
-       lprcpt->rcpt.path = smtp_address_clone(rcpt->pool, address);
+       lprcpt->address = smtp_address_clone(rcpt->pool, address);
        lprcpt->conn = conn;
 
        smtp_server_recipient_add_hook(
@@ -595,7 +597,7 @@ lmtp_proxy_data_cb(const struct smtp_reply *proxy_reply,
        struct lmtp_proxy *proxy = conn->proxy;
        struct smtp_server_cmd_ctx *cmd = proxy->pending_data_cmd;
        struct smtp_server_transaction *trans = proxy->trans;
-       struct smtp_address *address = lprcpt->rcpt.path;
+       struct smtp_address *address = lprcpt->address;
        const struct smtp_client_transaction_times *times =
                smtp_client_transaction_get_times(conn->lmtp_trans);
        unsigned int rcpt_index = lprcpt->rcpt.index;