Skip to content

Commit

Permalink
lib-smtp: server: Record the index in the list of approved recipients…
Browse files Browse the repository at this point in the history
… in the recipient object.

This avoids the need to do that in application code.
  • Loading branch information
stephanbosch authored and villesavolainen committed Feb 12, 2019
1 parent 964ab70 commit f8fc07f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib-smtp/smtp-server-transaction.c
Expand Up @@ -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);
}
Expand Down
3 changes: 3 additions & 0 deletions src/lib-smtp/smtp-server.h
Expand Up @@ -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 *);
Expand Down

0 comments on commit f8fc07f

Please sign in to comment.