/src/pigeonhole/src/lib-sieve/plugins/metadata/ext-metadata.c
Line | Count | Source |
1 | | /* Copyright (c) 2002-2018 Pigeonhole authors, see the included COPYING file |
2 | | */ |
3 | | |
4 | | #include "lib.h" |
5 | | |
6 | | #include "sieve-extensions.h" |
7 | | #include "sieve-commands.h" |
8 | | #include "sieve-binary.h" |
9 | | |
10 | | #include "sieve-validator.h" |
11 | | #include "sieve-interpreter.h" |
12 | | |
13 | | #include "ext-metadata-common.h" |
14 | | |
15 | | /* |
16 | | * Extension mboxmetadata |
17 | | * ----------------------------- |
18 | | * |
19 | | * Authors: Stephan Bosch |
20 | | * Specification: RFC 5490; Section 3 |
21 | | * Implementation: skeleton |
22 | | * Status: development |
23 | | * |
24 | | */ |
25 | | |
26 | | const struct sieve_operation_def *mboxmetadata_operations[] = { |
27 | | &metadata_operation, |
28 | | &metadataexists_operation, |
29 | | }; |
30 | | |
31 | | static bool ext_mboxmetadata_validator_load |
32 | | (const struct sieve_extension *ext, struct sieve_validator *valdtr); |
33 | | |
34 | | const struct sieve_extension_def mboxmetadata_extension = { |
35 | | .name = "mboxmetadata", |
36 | | .validator_load = ext_mboxmetadata_validator_load, |
37 | | SIEVE_EXT_DEFINE_OPERATIONS(mboxmetadata_operations) |
38 | | }; |
39 | | |
40 | | static bool ext_mboxmetadata_validator_load |
41 | | (const struct sieve_extension *ext, struct sieve_validator *valdtr) |
42 | 0 | { |
43 | 0 | sieve_validator_register_command(valdtr, ext, &metadata_test); |
44 | 0 | sieve_validator_register_command(valdtr, ext, &metadataexists_test); |
45 | |
|
46 | 0 | return TRUE; |
47 | 0 | } |
48 | | |
49 | | /* |
50 | | * Extension servermetadata |
51 | | * ----------------------------- |
52 | | * |
53 | | * Authors: Stephan Bosch |
54 | | * Specification: RFC 5490; Section 4 |
55 | | * Implementation: skeleton |
56 | | * Status: development |
57 | | * |
58 | | */ |
59 | | |
60 | | const struct sieve_operation_def *servermetadata_operations[] = { |
61 | | &servermetadata_operation, |
62 | | &servermetadataexists_operation, |
63 | | }; |
64 | | |
65 | | static bool ext_servermetadata_validator_load |
66 | | (const struct sieve_extension *ext, struct sieve_validator *valdtr); |
67 | | |
68 | | const struct sieve_extension_def servermetadata_extension = { |
69 | | .name = "servermetadata", |
70 | | .validator_load = ext_servermetadata_validator_load, |
71 | | SIEVE_EXT_DEFINE_OPERATIONS(servermetadata_operations) |
72 | | }; |
73 | | |
74 | | static bool ext_servermetadata_validator_load |
75 | | (const struct sieve_extension *ext, struct sieve_validator *valdtr) |
76 | 0 | { |
77 | 0 | sieve_validator_register_command(valdtr, ext, &servermetadata_test); |
78 | 0 | sieve_validator_register_command(valdtr, ext, &servermetadataexists_test); |
79 | |
|
80 | 0 | return TRUE; |
81 | 0 | } |
82 | | |
83 | | |