From: Stephan Bosch Date: Sat, 3 Nov 2018 00:00:13 +0000 (+0100) Subject: lmtp: Add support for module contexts to recipient. X-Git-Tag: 2.3.7~175 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=265e999c755666b37e299a3c28e3c7c1e86102f8;p=thirdparty%2Fdovecot%2Fcore.git lmtp: Add support for module contexts to recipient. --- diff --git a/src/lmtp/lmtp-recipient.c b/src/lmtp/lmtp-recipient.c index 2be468427b..cb4999a60a 100644 --- a/src/lmtp/lmtp-recipient.c +++ b/src/lmtp/lmtp-recipient.c @@ -1,9 +1,13 @@ /* Copyright (c) 2018 Dovecot authors, see the included COPYING file */ #include "lib.h" +#include "array.h" #include "smtp-server.h" #include "lmtp-recipient.h" +struct lmtp_recipient_module_register +lmtp_recipient_module_register = { 0 }; + struct lmtp_recipient * lmtp_recipient_create(struct client *client, struct smtp_server_recipient *rcpt) @@ -16,6 +20,8 @@ lmtp_recipient_create(struct client *client, rcpt->context = lrcpt; + p_array_init(&lrcpt->module_contexts, rcpt->pool, 5); + return lrcpt; } diff --git a/src/lmtp/lmtp-recipient.h b/src/lmtp/lmtp-recipient.h index 89720d443f..3614a8b937 100644 --- a/src/lmtp/lmtp-recipient.h +++ b/src/lmtp/lmtp-recipient.h @@ -5,6 +5,7 @@ struct smtp_address; struct smtp_server_cmd_ctx; struct smtp_server_cmd_rcpt; struct smtp_server_recipient; +union lmtp_recipient_module_context; struct client; enum lmtp_recipient_type { @@ -18,7 +19,19 @@ struct lmtp_recipient { enum lmtp_recipient_type type; void *backend_context; + + /* Module-specific contexts. */ + ARRAY(union lmtp_recipient_module_context *) module_contexts; +}; + +struct lmtp_recipient_module_register { + unsigned int id; +}; + +union lmtp_recipient_module_context { + struct lmtp_recipient_module_register *reg; }; +extern struct lmtp_recipient_module_register lmtp_recipient_module_register; struct lmtp_recipient * lmtp_recipient_create(struct client *client,