summaryrefslogtreecommitdiffstats
path: root/pigeonhole/src/lib-sieve/sieve-address-source.h
blob: fac4b496e0c1b44f9eb7dae251f9485d3c180f66 (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
#ifndef SIEVE_ADDRESS_SOURCE_H
#define SIEVE_ADDRESS_SOURCE_H

#include "sieve-common.h"

enum sieve_address_source_type {
	SIEVE_ADDRESS_SOURCE_DEFAULT = 0,
	SIEVE_ADDRESS_SOURCE_SENDER,
	SIEVE_ADDRESS_SOURCE_RECIPIENT,
	SIEVE_ADDRESS_SOURCE_ORIG_RECIPIENT,
	SIEVE_ADDRESS_SOURCE_USER_EMAIL,
	SIEVE_ADDRESS_SOURCE_POSTMASTER,
	SIEVE_ADDRESS_SOURCE_EXPLICIT
};

struct sieve_address_source {
	enum sieve_address_source_type type;
	const struct smtp_address *address;
};

bool sieve_address_source_parse
	(pool_t pool, const char *value,
		struct sieve_address_source *asrc);
bool sieve_address_source_parse_from_setting
	(struct sieve_instance *svinst, pool_t pool,
		const char *setting, struct sieve_address_source *asrc);

int sieve_address_source_get_address
	(struct sieve_address_source *asrc,
		struct sieve_instance *svinst,
		const struct sieve_script_env *senv,
		struct sieve_message_context *msgctx,
		enum sieve_execute_flags flags,
		const struct smtp_address **addr_r);

#endif