summaryrefslogtreecommitdiffstats
path: root/src/lmtp/lmtp-recipient.h
blob: d7604409a33995f369e26847049959b60bff72f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef LMTP_RECIPIENT_H
#define LMTP_RECIPIENT_H

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 {
	LMTP_RECIPIENT_TYPE_LOCAL,
	LMTP_RECIPIENT_TYPE_PROXY,
};

struct lmtp_recipient {
	struct client *client;
	struct smtp_server_recipient *rcpt;

	enum lmtp_recipient_type type;
	void *backend_context;

	const char *session_id;
	const char *forward_fields;

	/* 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,
		      struct smtp_server_transaction *trans,
		      struct smtp_server_recipient *rcpt);

struct lmtp_recipient *
lmtp_recipient_find_duplicate(struct lmtp_recipient *lrcpt,
			      struct smtp_server_transaction *trans);

#endif