]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp: Add support for module contexts to recipient.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sat, 3 Nov 2018 00:00:13 +0000 (01:00 +0100)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 25 Jun 2019 11:19:16 +0000 (11:19 +0000)
src/lmtp/lmtp-recipient.c
src/lmtp/lmtp-recipient.h

index 2be468427b9837584a60f65cb0fdd7b70a6bf4b2..cb4999a60a43350dd0a2ee3ee18c3b16e0c9c9eb 100644 (file)
@@ -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;
 }
 
index 89720d443fb539b8978e9aa7f3a8718457a2554c..3614a8b9377e04ca4696169ef0138b5c9bc19aef 100644 (file)
@@ -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,