]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp: Add recipient type to struct lmtp_recipient.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sat, 13 Jan 2018 12:34:47 +0000 (13:34 +0100)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 18 Jan 2018 07:10:12 +0000 (09:10 +0200)
src/lmtp/lmtp-common.c
src/lmtp/lmtp-common.h
src/lmtp/lmtp-local.c
src/lmtp/lmtp-proxy.c

index e3e34bf5b53e7d182a541c1a0ed235c021025e2b..612ec57a628d91be06bb8f727a2d096fdc26995c 100644 (file)
@@ -6,10 +6,12 @@
 
 void lmtp_recipient_init(struct lmtp_recipient *rcpt,
                         struct client *client,
+                        enum lmtp_recipient_type type,
                         struct smtp_server_cmd_ctx *cmd,
                         struct smtp_server_cmd_rcpt *data)
 {
        rcpt->client = client;
+       rcpt->type = type;
        rcpt->rcpt_cmd = cmd;
        rcpt->path = data->path;
 }
index 11db05b5e646a7e2af4570088f235ed8ad871b25..e7e90d757f92e9d6a802bd2d336d926f0cc212fe 100644 (file)
@@ -7,8 +7,14 @@ struct smtp_server_cmd_rcpt;
 struct smtp_server_recipient;
 struct client;
 
+enum lmtp_recipient_type {
+       LMTP_RECIPIENT_TYPE_LOCAL,
+       LMTP_RECIPIENT_TYPE_PROXY,
+};
+
 struct lmtp_recipient {
        struct client *client;
+       enum lmtp_recipient_type type;
 
        struct smtp_address *path;
        struct smtp_server_cmd_ctx *rcpt_cmd;
@@ -18,6 +24,7 @@ struct lmtp_recipient {
 
 void lmtp_recipient_init(struct lmtp_recipient *rcpt,
                         struct client *client,
+                        enum lmtp_recipient_type type,
                         struct smtp_server_cmd_ctx *cmd,
                         struct smtp_server_cmd_rcpt *data);
 
index fe135826e76a91cbb7b99fac53cd5a334449d00a..9c313c011662ebe2515350adbb60fd5e08efbe61 100644 (file)
@@ -382,7 +382,8 @@ int lmtp_local_rcpt(struct client *client,
                client->local = lmtp_local_init(client);
 
        rcpt = i_new(struct lmtp_local_recipient, 1);
-       lmtp_recipient_init(&rcpt->rcpt, client, cmd, data);
+       lmtp_recipient_init(&rcpt->rcpt, client,
+                           LMTP_RECIPIENT_TYPE_LOCAL, cmd, data);
 
        rcpt->detail = i_strdup(detail);
        rcpt->service_user = service_user;
index 46256a3f223981257e9d8e814a44c8ca61c8d008..2d0c774b1e83166091fd676479e912bc0cb3b3ef 100644 (file)
@@ -522,7 +522,8 @@ int lmtp_proxy_rcpt(struct client *client,
        pool_unref(&auth_pool);
 
        rcpt = i_new(struct lmtp_proxy_recipient, 1);
-       lmtp_recipient_init(&rcpt->rcpt, client, cmd, data);
+       lmtp_recipient_init(&rcpt->rcpt, client,
+                           LMTP_RECIPIENT_TYPE_PROXY, cmd, data);
 
        rcpt->conn = conn;