dovecot-2.2-pigeonhole: Sieve vnd.dovecot.environment extension:...
pigeonhole at rename-it.nl
pigeonhole at rename-it.nl
Wed Sep 23 19:50:15 UTC 2015
details: http://hg.rename-it.nl/dovecot-2.2-pigeonhole/rev/fc67d3f0db2d
changeset: 2099:fc67d3f0db2d
user: Stephan Bosch <stephan at rename-it.nl>
date: Wed Sep 23 21:49:25 2015 +0200
description:
Sieve vnd.dovecot.environment extension: Made activation of the environment extension implicit.
diffstat:
src/lib-sieve/plugins/environment/sieve-ext-environment.h | 8 +++++++
src/lib-sieve/plugins/vnd.dovecot/environment/ext-vnd-environment.c | 11 +++++++++-
tests/extensions/vnd.dovecot/environment/basic.svtest | 1 -
tests/extensions/vnd.dovecot/environment/variables.svtest | 1 -
4 files changed, 18 insertions(+), 3 deletions(-)
diffs (64 lines):
diff -r 9f3118148e67 -r fc67d3f0db2d src/lib-sieve/plugins/environment/sieve-ext-environment.h
--- a/src/lib-sieve/plugins/environment/sieve-ext-environment.h Wed Sep 23 20:06:15 2015 +0200
+++ b/src/lib-sieve/plugins/environment/sieve-ext-environment.h Wed Sep 23 21:49:25 2015 +0200
@@ -22,6 +22,14 @@
(svinst, &environment_extension, FALSE);
}
+static inline const struct sieve_extension *
+sieve_ext_environment_require_extension
+(struct sieve_instance *svinst)
+{
+ return sieve_extension_require
+ (svinst, &environment_extension, TRUE);
+}
+
bool sieve_ext_environment_is_active
(const struct sieve_extension *env_ext,
struct sieve_interpreter *interp);
diff -r 9f3118148e67 -r fc67d3f0db2d src/lib-sieve/plugins/vnd.dovecot/environment/ext-vnd-environment.c
--- a/src/lib-sieve/plugins/vnd.dovecot/environment/ext-vnd-environment.c Wed Sep 23 20:06:15 2015 +0200
+++ b/src/lib-sieve/plugins/vnd.dovecot/environment/ext-vnd-environment.c Wed Sep 23 21:49:25 2015 +0200
@@ -62,7 +62,7 @@
ext_vnd_environment_unload(ext);
ectx = i_new(struct ext_vnd_environment_context, 1);
- ectx->env_ext = sieve_ext_environment_get_extension(ext->svinst);
+ ectx->env_ext = sieve_ext_environment_require_extension(ext->svinst);
ectx->var_ext = sieve_ext_variables_get_extension(ext->svinst);
*context = (void *) ectx;
@@ -85,6 +85,15 @@
static bool ext_vnd_environment_validator_load
(const struct sieve_extension *ext, struct sieve_validator *valdtr)
{
+ const struct sieve_extension *env_ext;
+
+ /* Load environment extension implicitly */
+
+ env_ext = sieve_validator_extension_load_implicit
+ (valdtr, environment_extension.name);
+ if ( env_ext == NULL )
+ return FALSE;
+
ext_environment_variables_init(ext, valdtr);
return TRUE;
}
diff -r 9f3118148e67 -r fc67d3f0db2d tests/extensions/vnd.dovecot/environment/basic.svtest
--- a/tests/extensions/vnd.dovecot/environment/basic.svtest Wed Sep 23 20:06:15 2015 +0200
+++ b/tests/extensions/vnd.dovecot/environment/basic.svtest Wed Sep 23 21:49:25 2015 +0200
@@ -1,5 +1,4 @@
require "vnd.dovecot.testsuite";
-require "environment";
require "vnd.dovecot.environment";
require "variables";
diff -r 9f3118148e67 -r fc67d3f0db2d tests/extensions/vnd.dovecot/environment/variables.svtest
--- a/tests/extensions/vnd.dovecot/environment/variables.svtest Wed Sep 23 20:06:15 2015 +0200
+++ b/tests/extensions/vnd.dovecot/environment/variables.svtest Wed Sep 23 21:49:25 2015 +0200
@@ -1,5 +1,4 @@
require "vnd.dovecot.testsuite";
-require "environment";
require "vnd.dovecot.environment";
require "variables";
require "relational";
More information about the dovecot-cvs
mailing list