~ubuntu-branches/ubuntu/quantal/dovecot/quantal

« back to all changes in this revision

Viewing changes to sieve/src/lib-sieve/plugins/copy/ext-copy.c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short, Scott Kitterman
  • Date: 2010-06-22 10:33:51 UTC
  • mfrom: (1.13.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100622103351-ifbmnklp8kxrhb30
Tags: 1:1.2.12-0ubuntu1
* New upstream release:
  - deliver: Don't crash when a message with Auto-submitted: header gets
   rejected.
  - lib-storage: Fixed header searches to work correctly when there are
    multiple headers with same name.
  - dict client: Disconnect from dict server after 1 second of idling.
  - dict: If process crashed, it wasn't automatically restarted
  - dict file: If dict file's group permissions equal world permissions,
    don't try to change its gid.
  - maildir: Fixed a memory leak when copying with hardlinks.
  - maildir: Expunging last messages may have assert-crashed if their
    filenames had just changed.
 * Update sieve patch to 0.1.17
 * debian/dovecot-common.postinst: Add warning about expired certificate.
   (Debian Bug: #576455)
 * Silence lintian warnings.

 [Scott Kitterman]
 * Rename dovecot-postfix to mail-stack-delivery per server-maverick-mail-
   integration spec.
   - Update debian/rules
   - Convert existing package to a dummy package and add new binary in debian/control
   - Update maintainer scripts.
   - Move previously installed backups and config files to new package name
     space in preinst
   - Add new debian/mail-stack-delivery.prerm to handle downgrades
   - Rename debian/dovecot-postfix.* to debian/mail-stack-delivery.*

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 * Specification: RFC 3894
9
9
 * Implementation: full
10
10
 * Status: experimental, largely untested
11
 
 *
 
11
 * 
12
12
 */
13
13
 
14
14
#include <stdio.h>
24
24
#include "sieve-interpreter.h"
25
25
#include "sieve-result.h"
26
26
 
27
 
/*
28
 
 * Forward declarations
 
27
/* 
 
28
 * Forward declarations 
29
29
 */
30
30
 
31
31
static const struct sieve_argument_def copy_tag;
32
32
static const struct sieve_operand_def copy_side_effect_operand;
33
33
 
34
 
/*
 
34
/* 
35
35
 * Extension
36
36
 */
37
37
 
38
38
static bool ext_copy_validator_load
39
39
(const struct sieve_extension *ext, struct sieve_validator *valdtr);
40
40
 
41
 
const struct sieve_extension_def copy_extension = {
42
 
        "copy",
 
41
const struct sieve_extension_def copy_extension = { 
 
42
        "copy", 
43
43
        NULL, NULL,
44
 
        ext_copy_validator_load,
 
44
        ext_copy_validator_load, 
45
45
        NULL, NULL, NULL, NULL, NULL,
46
46
        SIEVE_EXT_DEFINE_NO_OPERATIONS,
47
47
        SIEVE_EXT_DEFINE_OPERAND(copy_side_effect_operand)
52
52
{
53
53
        /* Register copy tag with redirect and fileinto commands and we don't care
54
54
         * whether these commands are registered or even whether they will be
55
 
         * registered at all. The validator handles either situation gracefully
 
55
         * registered at all. The validator handles either situation gracefully 
56
56
         */
57
57
        sieve_validator_register_external_tag
58
58
                (valdtr, "redirect", ext, &copy_tag, SIEVE_OPT_SIDE_EFFECT);
63
63
}
64
64
 
65
65
/*
66
 
 * Side effect
 
66
 * Side effect 
67
67
 */
68
68
 
69
69
static void seff_copy_print
70
 
        (const struct sieve_side_effect *seffect, const struct sieve_action *action,
 
70
        (const struct sieve_side_effect *seffect, const struct sieve_action *action, 
71
71
                const struct sieve_result_print_env *rpenv, bool *keep);
72
72
static void seff_copy_post_commit
73
 
        (const struct sieve_side_effect *seffect, const struct sieve_action *action,
 
73
        (const struct sieve_side_effect *seffect, const struct sieve_action *action, 
74
74
                const struct sieve_action_exec_env *aenv, void *tr_context, bool *keep);
75
75
 
76
76
const struct sieve_side_effect_def copy_side_effect = {
79
79
        NULL, NULL, NULL,
80
80
        seff_copy_print,
81
81
        NULL, NULL,
82
 
        seff_copy_post_commit,
 
82
        seff_copy_post_commit, 
83
83
        NULL
84
84
};
85
85
 
86
 
/*
87
 
 * Tagged argument
 
86
/* 
 
87
 * Tagged argument 
88
88
 */
89
89
 
90
90
static bool tag_copy_validate
91
 
        (struct sieve_validator *valdtr, struct sieve_ast_argument **arg,
 
91
        (struct sieve_validator *valdtr, struct sieve_ast_argument **arg, 
92
92
                struct sieve_command *cmd);
93
93
static bool tag_copy_generate
94
94
        (const struct sieve_codegen_env *cgenv, struct sieve_ast_argument *arg,
95
95
    struct sieve_command *cmd);
96
96
 
97
 
static const struct sieve_argument_def copy_tag = {
98
 
        "copy",
 
97
static const struct sieve_argument_def copy_tag = { 
 
98
        "copy", 
99
99
        NULL,
100
 
        tag_copy_validate,
 
100
        tag_copy_validate, 
101
101
        NULL, NULL,
102
102
        tag_copy_generate
103
103
};
117
117
        &ext_side_effects
118
118
};
119
119
 
120
 
/*
121
 
 * Tag validation
 
120
/* 
 
121
 * Tag validation 
122
122
 */
123
123
 
124
124
static bool tag_copy_validate
125
 
        (struct sieve_validator *valdtr ATTR_UNUSED,
126
 
        struct sieve_ast_argument **arg ATTR_UNUSED,
 
125
        (struct sieve_validator *valdtr ATTR_UNUSED, 
 
126
        struct sieve_ast_argument **arg ATTR_UNUSED, 
127
127
        struct sieve_command *cmd ATTR_UNUSED)
128
128
{
129
129
        *arg = sieve_ast_argument_next(*arg);
132
132
}
133
133
 
134
134
/*
135
 
 * Code generation
 
135
 * Code generation 
136
136
 */
137
137
 
138
138
static bool tag_copy_generate
149
149
        return TRUE;
150
150
}
151
151
 
152
 
/*
 
152
/* 
153
153
 * Side effect implementation
154
154
 */
155
155
 
156
156
static void seff_copy_print
157
 
(const struct sieve_side_effect *seffect ATTR_UNUSED,
158
 
        const struct sieve_action *action ATTR_UNUSED,
 
157
(const struct sieve_side_effect *seffect ATTR_UNUSED, 
 
158
        const struct sieve_action *action ATTR_UNUSED, 
159
159
        const struct sieve_result_print_env *rpenv, bool *keep)
160
160
{
161
161
        sieve_result_seffect_printf(rpenv, "preserve implicit keep");
164
164
}
165
165
 
166
166
static void seff_copy_post_commit
167
 
(const struct sieve_side_effect *seffect ATTR_UNUSED,
168
 
        const struct sieve_action *action ATTR_UNUSED,
169
 
        const struct sieve_action_exec_env *aenv ATTR_UNUSED,
 
167
(const struct sieve_side_effect *seffect ATTR_UNUSED, 
 
168
        const struct sieve_action *action ATTR_UNUSED, 
 
169
        const struct sieve_action_exec_env *aenv ATTR_UNUSED, 
170
170
                void *tr_context ATTR_UNUSED, bool *keep)
171
 
{
 
171
{       
172
172
        *keep = TRUE;
173
173
}
174
174