]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp: Use the recipient index in the server recipient object rather than the lmtp...
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 7 Oct 2018 19:23:44 +0000 (21:23 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 12 Feb 2019 13:41:02 +0000 (15:41 +0200)
src/lmtp/lmtp-common.c
src/lmtp/lmtp-common.h
src/lmtp/lmtp-local.c
src/lmtp/lmtp-proxy.c

index ca126795eafb11b70767293c8e28261d0c01727f..1bd143bfb19a833d9bd22c8182dcc164877aa018 100644 (file)
@@ -18,7 +18,6 @@ void lmtp_recipient_init(struct lmtp_recipient *lrcpt,
 
 void lmtp_recipient_finish(struct lmtp_recipient *lrcpt)
 {
-       lrcpt->index = lrcpt->rcpt->index;
        lrcpt->rcpt_cmd = NULL;
 }
 
index ae893cfb45d499dade4a209647f24e5db2b6b6e7..5325f73d171f9112609f12f10ad347d404114afa 100644 (file)
@@ -18,7 +18,6 @@ struct lmtp_recipient {
        enum lmtp_recipient_type type;
 
        struct smtp_server_cmd_ctx *rcpt_cmd;
-       unsigned int index;
 };
 
 void lmtp_recipient_init(struct lmtp_recipient *lrcpt,
index f0d6721a98b3eefcf221792833a7b1e353eeb0f0..4e8e68272b26a7bb648bbd224fb67a96d2684fab 100644 (file)
@@ -129,7 +129,7 @@ lmtp_local_rcpt_reply_overquota(struct lmtp_local_recipient *llrcpt,
 {
        struct smtp_server_recipient *rcpt = llrcpt->rcpt.rcpt;
        struct smtp_address *address = rcpt->path;
-       unsigned int rcpt_idx = llrcpt->rcpt.index;
+       unsigned int rcpt_idx = rcpt->index;
        struct lda_settings *lda_set =
                mail_storage_service_user_get_set(llrcpt->service_user)[2];
 
@@ -161,7 +161,7 @@ lmtp_local_rcpt_fail_all(struct lmtp_local *local,
        for (i = 0; i < count; i++) {
                struct smtp_server_recipient *rcpt = llrcpts[i]->rcpt.rcpt;
 
-               smtp_server_reply_index(cmd, llrcpts[i]->rcpt.index,
+               smtp_server_reply_index(cmd, rcpt->index,
                        status, enh_code, "<%s> %s",
                        smtp_address_encode(rcpt->path), msg);
        }
@@ -441,7 +441,7 @@ lmtp_local_deliver(struct lmtp_local *local,
        struct client *client = local->client;
        struct smtp_server_recipient *rcpt = llrcpt->rcpt.rcpt;
        struct smtp_address *rcpt_to = rcpt->path;
-       unsigned int rcpt_idx = llrcpt->rcpt.index;
+       unsigned int rcpt_idx = rcpt->index;
        struct mail_storage_service_user *service_user = llrcpt->service_user;
        struct mail_deliver_context dctx;
        struct mail_user *rcpt_user;
@@ -628,11 +628,14 @@ lmtp_local_deliver_to_rcpts(struct lmtp_local *local,
        llrcpts = array_get(&local->rcpt_to, &count);
        for (i = 0; i < count; i++) {
                struct lmtp_local_recipient *llrcpt = llrcpts[i];
+               struct smtp_server_recipient *rcpt = llrcpt->rcpt.rcpt;
 
                if (llrcpt->duplicate != NULL) {
+                       struct smtp_server_recipient *drcpt =
+                               llrcpt->duplicate->rcpt.rcpt;
                        /* don't deliver more than once to the same recipient */
-                       smtp_server_reply_submit_duplicate(cmd,
-                           llrcpt->rcpt.index, llrcpt->duplicate->rcpt.index);
+                       smtp_server_reply_submit_duplicate(cmd, rcpt->index,
+                                                          drcpt->index);
                        continue;
                }
 
index c2ac67f31669e14fe4fb866fbd16da8e5f3259f4..a8b8e3ae1c97e248d10b00dfa26d77d6371407c5 100644 (file)
@@ -594,13 +594,14 @@ lmtp_proxy_data_cb(const struct smtp_reply *proxy_reply,
                   struct lmtp_proxy_recipient *lprcpt)
 {
        struct lmtp_proxy_connection *conn = lprcpt->conn;
+       struct smtp_server_recipient *rcpt = lprcpt->rcpt.rcpt;
        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->address;
        const struct smtp_client_transaction_times *times =
                smtp_client_transaction_get_times(conn->lmtp_trans);
-       unsigned int rcpt_index = lprcpt->rcpt.index;
+       unsigned int rcpt_index = rcpt->index;
        struct smtp_reply reply;
        string_t *msg;