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

« back to all changes in this revision

Viewing changes to sieve/src/lib-sieve/plugins/environment/ext-environment-common.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:
18
18
 */
19
19
 
20
20
static const struct sieve_environment_item *core_env_items[] = {
21
 
        &domain_env_item,
22
 
        &host_env_item,
23
 
        &location_env_item,
24
 
        &phase_env_item,
25
 
        &name_env_item,
 
21
        &domain_env_item, 
 
22
        &host_env_item, 
 
23
        &location_env_item, 
 
24
        &phase_env_item, 
 
25
        &name_env_item, 
26
26
        &version_env_item
27
27
};
28
28
 
33
33
 */
34
34
 
35
35
static void ext_environment_item_register
36
 
(struct ext_environment_context *ectx,
 
36
(struct ext_environment_context *ectx, 
37
37
        const struct sieve_environment_item *item)
38
38
{
39
39
        hash_table_insert
43
43
void sieve_ext_environment_item_register
44
44
(const struct sieve_extension *ext, const struct sieve_environment_item *item)
45
45
{
46
 
        struct ext_environment_context *ectx =
 
46
        struct ext_environment_context *ectx = 
47
47
                (struct ext_environment_context *) ext->context;
48
 
 
 
48
        
49
49
        ext_environment_item_register(ectx, item);
50
50
}
51
51
 
54
54
 */
55
55
 
56
56
bool ext_environment_init
57
 
(const struct sieve_extension *ext ATTR_UNUSED, void **context)
 
57
(const struct sieve_extension *ext ATTR_UNUSED, void **context) 
58
58
{
59
 
        struct ext_environment_context *ectx =
 
59
        struct ext_environment_context *ectx = 
60
60
                i_new(struct ext_environment_context, 1);
61
61
 
62
62
        unsigned int i;
75
75
 
76
76
void ext_environment_deinit(const struct sieve_extension *ext)
77
77
{
78
 
        struct ext_environment_context *ectx =
 
78
        struct ext_environment_context *ectx = 
79
79
                (struct ext_environment_context *) ext->context;
80
80
 
81
81
        hash_table_destroy(&ectx->environment_items);
88
88
 */
89
89
 
90
90
const char *ext_environment_item_get_value
91
 
(const struct sieve_extension *ext, const char *name,
 
91
(const struct sieve_extension *ext, const char *name, 
92
92
        const struct sieve_script_env *senv)
93
93
{
94
 
        struct ext_environment_context *ectx =
 
94
        struct ext_environment_context *ectx = 
95
95
                (struct ext_environment_context *) ext->context;
96
 
        const struct sieve_environment_item *item =
97
 
                (const struct sieve_environment_item *)
 
96
        const struct sieve_environment_item *item = 
 
97
                (const struct sieve_environment_item *) 
98
98
                        hash_table_lookup(ectx->environment_items, name);
99
99
 
100
100
        if ( item == NULL )
103
103
        if ( item->value != NULL )
104
104
                return item->value;
105
105
 
106
 
        if ( item->get_value != NULL )
 
106
        if ( item->get_value != NULL ) 
107
107
                return item->get_value(senv);
108
108
 
109
 
        return NULL;
 
109
        return NULL; 
110
110
}
111
111
 
112
112
/*
115
115
 
116
116
/* "domain":
117
117
 *
118
 
 *   The primary DNS domain associated with the Sieve execution context, usually
 
118
 *   The primary DNS domain associated with the Sieve execution context, usually 
119
119
 *   but not always a proper suffix of the host name.
120
120
 */
121
121
const struct sieve_environment_item domain_env_item = {
126
126
 
127
127
/* "host":
128
128
 *
129
 
 *   The fully-qualified domain name of the host where the Sieve script is
 
129
 *   The fully-qualified domain name of the host where the Sieve script is 
130
130
 *   executing.
131
131
 */
132
132
 
143
143
 
144
144
/* "location":
145
145
 *
146
 
 *   Sieve evaluation can be performed at various different points as messages
 
146
 *   Sieve evaluation can be performed at various different points as messages 
147
147
 *   are processed. This item provides additional information about the type of
148
148
 *   service that is evaluating the script.  Possible values are:
149
 
 *    "MTA" - the Sieve script is being evaluated by a Message Transfer Agent
150
 
 *    "MDA" - evaluation is being performed by a Mail Delivery Agent
 
149
 *    "MTA" - the Sieve script is being evaluated by a Message Transfer Agent 
 
150
 *    "MDA" - evaluation is being performed by a Mail Delivery Agent 
151
151
 *    "MUA" - evaluation is being performed by a Mail User Agent
152
152
 *    "MS"  - evaluation is being performed by a Message Store
153
153
 */
160
160
/* "phase":
161
161
 *
162
162
 *   The point relative to final delivery where the Sieve script is being
163
 
 *   evaluated.  Possible values are "pre", "during", and "post", referring
164
 
 *   respectively to processing before, during, and after final delivery has
 
163
 *   evaluated.  Possible values are "pre", "during", and "post", referring 
 
164
 *   respectively to processing before, during, and after final delivery has 
165
165
 *   taken place.
166
166
 */
167
167
 
183
183
 
184
184
/* "version":
185
185
 *
186
 
 * The product version associated with the Sieve interpreter. The meaning of the
 
186
 * The product version associated with the Sieve interpreter. The meaning of the 
187
187
 * product version string is product-specific and should always be considered
188
188
 * in the context of the product name given by the "name" item.
189
189
 */