]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: server: Record the index in the list of approved recipients in the recipien...
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 7 Oct 2018 19:13:44 +0000 (21:13 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 12 Feb 2019 13:41:00 +0000 (15:41 +0200)
This avoids the need to do that in application code.

src/lib-smtp/smtp-server-transaction.c
src/lib-smtp/smtp-server.h

index c56fce75667a2d154d2e79f3bc7a2a25f9955ec6..3613626de591a83a2d85b225fe3c8d74eea635d1 100644 (file)
@@ -84,6 +84,7 @@ void smtp_server_transaction_add_rcpt(struct smtp_server_transaction *trans,
                p_array_init(&trans->rcpt_to, trans->pool, 8);
 
        rcpt->trans = trans;
+       rcpt->index = array_count(&trans->rcpt_to);
 
        array_append(&trans->rcpt_to, &rcpt, 1);
 }
index 5e85786b940d730187cb59483130ef00eee16181..ac8c60d8c282da60fca67e1b26539835a29044c7 100644 (file)
@@ -69,6 +69,9 @@ struct smtp_server_recipient {
        struct smtp_address *path;
        struct smtp_params_rcpt params;
 
+       /* The index in the list of approved recipients */
+       unsigned int index;
+
        void *context;
 };
 ARRAY_DEFINE_TYPE(smtp_server_recipient, struct smtp_server_recipient *);