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