From: Stephan Bosch Date: Sun, 7 Oct 2018 19:13:44 +0000 (+0200) Subject: lib-smtp: server: Record the index in the list of approved recipients in the recipien... X-Git-Tag: 2.3.5~128 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f8fc07fb0473941635cb265c19af3de9404c0b35;p=thirdparty%2Fdovecot%2Fcore.git lib-smtp: server: Record the index in the list of approved recipients in the recipient object. This avoids the need to do that in application code. --- diff --git a/src/lib-smtp/smtp-server-transaction.c b/src/lib-smtp/smtp-server-transaction.c index c56fce7566..3613626de5 100644 --- a/src/lib-smtp/smtp-server-transaction.c +++ b/src/lib-smtp/smtp-server-transaction.c @@ -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); } diff --git a/src/lib-smtp/smtp-server.h b/src/lib-smtp/smtp-server.h index 5e85786b94..ac8c60d8c2 100644 --- a/src/lib-smtp/smtp-server.h +++ b/src/lib-smtp/smtp-server.h @@ -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 *);