1
/* Copyright (c) 2002-2009 Dovecot Sieve authors, see the included COPYING file
7
* Authors: Stephan Bosch
8
* Specification: draft-ietf-sieve-notify-00.txt
9
* Implementation: deprecated; provided for backwards compatibility
14
/* FIXME: Currently the following CMUSieve features are not supported:
16
* (*) The $text$ substitution is not available for the :message argument.
21
#include "sieve-common.h"
23
#include "sieve-code.h"
24
#include "sieve-extensions.h"
25
#include "sieve-actions.h"
26
#include "sieve-commands.h"
27
#include "sieve-validator.h"
28
#include "sieve-generator.h"
29
#include "sieve-interpreter.h"
30
#include "sieve-result.h"
32
#include "ext-notify-common.h"
38
const struct sieve_operation *ext_notify_operations[] = {
39
¬ify_old_operation,
47
static bool ext_notify_validator_load(struct sieve_validator *valdtr);
49
static int ext_notify_my_id = -1;
51
const struct sieve_extension notify_extension = {
56
ext_notify_validator_load,
57
NULL, NULL, NULL, NULL, NULL,
58
SIEVE_EXT_DEFINE_OPERATIONS(ext_notify_operations),
59
SIEVE_EXT_DEFINE_NO_OPERANDS,
63
* Extension validation
66
static bool ext_notify_validator_extension_validate
67
(struct sieve_validator *valdtr, void *context,
68
struct sieve_ast_argument *require_arg);
70
const struct sieve_validator_extension notify_validator_extension = {
72
ext_notify_validator_extension_validate,
76
static bool ext_notify_validator_load(struct sieve_validator *valdtr)
78
/* Register validator extension to check for conflict with enotify */
79
sieve_validator_extension_register
80
(valdtr, ¬ify_validator_extension, NULL);
82
/* Register new commands */
83
sieve_validator_register_command(valdtr, &cmd_notify_old);
84
sieve_validator_register_command(valdtr, &cmd_denotify);
89
static bool ext_notify_validator_extension_validate
90
(struct sieve_validator *valdtr, void *context ATTR_UNUSED,
91
struct sieve_ast_argument *require_arg)
93
const struct sieve_extension *ext;
95
if ( (ext=sieve_extension_get_by_name("enotify")) != NULL ) {
97
/* Check for conflict with enotify */
98
if ( sieve_validator_extension_loaded(valdtr, ext) ) {
99
sieve_argument_validate_error(valdtr, require_arg,
100
"the (deprecated) notify extension cannot be used "
101
"together with the enotify extension");