~ubuntu-dev/ubuntu/lucid/dovecot/lucid-201002101901

« back to all changes in this revision

Viewing changes to libsieve/src/lib-sieve/sieve-extensions.h

  • Committer: Chuck Short
  • Date: 2010-01-21 20:21:25 UTC
  • mfrom: (4.1.11 squeeze)
  • Revision ID: zulcss@ubuntu.com-20100121202125-pme73o491kfwj5nc
* Merge from debian testing, remaining changes:
  + Add new binary pkg dovecot-postfix that integrates postfix and dovecot
    automatically: (LP: #164837)
  + debian/control:
    - add new binary with short description
    - set Architecture all for dovecot-postfix (LP: #329878)
  + debian/dovecot-postfix.postinst:
    - create initial certificate symlinks to snakeoil.
    - set up postfix with postconf to:
      - use Maildir/ as the default mailbox.
      - use dovecot as the sasl authentication server.
      - use dovecot LDA (deliver).
      - use tls for smtp{d} services.
    - fix certificates paths in postfix' main.cf
    - add reject_unauth_destination to postfix' recipient restrictions
    - add reject_unknown_sender_domain to postfix' sender restriction
    - rename configuration name on remove, delete on purge
    - restart dovecot after linking certificates
    - handle use case when postfix is unconfigurated
  + debian/dovecot-postfix.dirs: create backup directory for postfix's config
    configuration
  + restart postfix and dovecot.
  + debian/dovecot-postfix.postrm:
    - remove all dovecot related configuration from postfix.
    - restart postfix and dovecot.
  + debian/dovecot-common.init:
    - check if /etc/dovecot/dovecot-postfix.conf exists and use it
      as the configuration file if so.
  + debian/patches/warning-ubuntu-postfix.dpatch
    - add warning about dovecot-postfix.conf in dovecot default
      configuration file
  + debian/patches/dovecot-postfix.conf.diff:
    - Ubuntu server custom changes to the default dovecot configuration for
      better interfation with postfix.
    - enable sieve plugin.
    - Ubuntu server custom changes to the default dovecot configuration for
      better integration with postfix:
      - enable imap, pop3, imaps, pop3s and managesieve by default.
      - enable dovecot LDA (deliver).
      - enable SASL auth socket in postfix private directory
   + debian/rules:
     - copy, patch and install dovecot-postfix.conf in /etc/dovecot/.
     - build architecure independent packages too
   + Use Snakeoil SSL certificates by default.
     - debian/control: Depend on ssl-cert.
     - debian/patches/ssl-cert-snakeoil.dpatch: Change default SSL cert
       paths to snakeoil.
     - debian/dovecot-common.postinst: Relax grep for SSL_* a bit.
   + Add autopkgtest to debian/tests/*.
   + Fast TearDown: Update the lsb init header to not stop in level 6.
   + Add ufw integration:
     - Created debian/dovecot-common.ufw.profile.
     - debian/rules: install profile.
     - debian/control: suggest ufw.
   + debian/{control,rules}: enable PIE hardening.
   + dovecot-imapd, dovecot-pop3: Replaces dovecot-common (<< 1:1.1). (LP: #254721)
   + debian/control: Update Vcs-* headers.
   + Add SMTP-AUTH support for Outlook (login auth mechanism)
* New upstream release.
* debian/patches/gold-fix.patch: Removed. Fixed upstream.
* Moved libexec to lib corrections in dovecot-managesieve.patch and
  dovecot-managesieve-dist.patch to dovecot-example.patch
* debian/patches/dovecot-mboxlocking.patch: Regenerated to avoid FTBFS
  when quilt isn't installed.
* debian/patches/quota-mountpoint.patch: Removed. Not needed anymore.
* debian/patches/dovecot-quota.patch: Removed. Quotas aren't properly
  enabled unless mail_plugins = quota imap_quota.
* debian/patches/gold-fix.patch: Fixed configure script to build even
  with binutils-gold or --no-add-needed linker flag (Closes: #554306)
* debian/dovecot-common.init: fixed LSB headers. Thanks to Pascal Volk.
  (Closes: #558040)
* debian/changelog: added CVE references to previous changelog entry.
* debian/rules: checked up the build system. It's not fragile anymore.
  (Closes: 493803)
* debian/dovecot-common.postinst: Now invoking dpkg-reconfigure
  on dovecot-common is enough to generate new certificates
  if the previous ones were removed. (Closes: #545582)
* debian/rules: No longer install convert-tool in /usr/bin.
  It isn't an user utility and it should stay in /usr/lib/dovecot
  like all other similar tool.
* New upstream release. (Closes: #557601)
* [SECURITY] Fixes local information disclosure and denial of service.
  (see: http://www.dovecot.org/list/dovecot-news/2009-November/000143.html
  and CVE-2009-3897)
* Added myself to uploaders.
* Switched to the new source format "3.0 (quilt)":
  - removed dpatch from build-depends
  - removed debian/README.source because now we use only standard
    dpkg features
  - regenerated all patches
* Prepared to switch to multi-origin source:
  - recreated dovecot-libsieve.patch and dovecot-managesieve-dist.patch
    starting from the upstream tarball
  - removed all autotools related build-depends and build-conflict
  - renamed dovecot-libsieve and dovecot-managesieve directories
    to libsieve and managesieve.
* debian/rules: Moved the configuration of libsieve and managesieve from
  the build phase to the configuration phase
* Added dovecot-dbg package  with debugging symbols.  Thanks Stephan Bosch.
  (Closes: #554710)
* Fixed some stray libexec'isms in the default configuration.
* New upstream release.
* debian/dovecot-common.init:
  - use $CONF when starting the daemon. (Closes: #549944)
  - always output start/stop messages. (Closes: #523810)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (c) 2002-2009 Dovecot Sieve authors, see the included COPYING file
 
2
 */
 
3
 
 
4
#ifndef __SIEVE_EXTENSIONS_H
 
5
#define __SIEVE_EXTENSIONS_H
 
6
 
 
7
#include "lib.h"
 
8
#include "sieve-common.h"
 
9
 
 
10
/* 
 
11
 * Per-extension object registry 
 
12
 */
 
13
 
 
14
struct sieve_extension_objects {
 
15
        const void *objects;
 
16
        unsigned int count;
 
17
};
 
18
 
 
19
/* 
 
20
 * Extension object 
 
21
 */
 
22
 
 
23
struct sieve_extension {
 
24
        const char *name;
 
25
 
 
26
        int *const _id;
 
27
                
 
28
        bool (*load)(void);
 
29
        void (*unload)(void);
 
30
 
 
31
        bool (*validator_load)
 
32
                (struct sieve_validator *validator);    
 
33
        bool (*generator_load)
 
34
                (const struct sieve_codegen_env *cgenv);
 
35
        bool (*interpreter_load)
 
36
                (const struct sieve_runtime_env *renv, sieve_size_t *address);
 
37
        bool (*binary_load)
 
38
                (struct sieve_binary *binary);
 
39
        
 
40
        bool (*binary_dump)
 
41
                (struct sieve_dumptime_env *denv);
 
42
        bool (*code_dump)
 
43
                (const struct sieve_dumptime_env *denv, sieve_size_t *address);
 
44
 
 
45
        struct sieve_extension_objects operations;
 
46
        struct sieve_extension_objects operands;
 
47
};
 
48
 
 
49
#define SIEVE_EXT_ID(EXT) (*((EXT)->_id))
 
50
#define SIEVE_EXT_ENABLED(EXT) (((EXT)->_id != NULL) && (*((EXT)->_id) >= 0))
 
51
 
 
52
#define SIEVE_EXT_DEFINE_NO_OBJECTS \
 
53
        { NULL, 0 }
 
54
#define SIEVE_EXT_DEFINE_OBJECT(OBJ) \
 
55
        { &OBJ, 1 }
 
56
#define SIEVE_EXT_DEFINE_OBJECTS(OBJS) \
 
57
        { OBJS, N_ELEMENTS(OBJS) }
 
58
 
 
59
#define SIEVE_EXT_GET_OBJECTS_COUNT(ext, field) \
 
60
        ext->field->count;
 
61
 
 
62
/* 
 
63
 * Defining opcodes and operands 
 
64
 */
 
65
 
 
66
#define SIEVE_EXT_DEFINE_NO_OPERATIONS SIEVE_EXT_DEFINE_NO_OBJECTS
 
67
#define SIEVE_EXT_DEFINE_OPERATION(OP) SIEVE_EXT_DEFINE_OBJECT(OP)
 
68
#define SIEVE_EXT_DEFINE_OPERATIONS(OPS) SIEVE_EXT_DEFINE_OBJECTS(OPS)
 
69
 
 
70
#define SIEVE_EXT_DEFINE_NO_OPERANDS SIEVE_EXT_DEFINE_NO_OBJECTS
 
71
#define SIEVE_EXT_DEFINE_OPERAND(OP) SIEVE_EXT_DEFINE_OBJECT(OP)
 
72
#define SIEVE_EXT_DEFINE_OPERANDS(OPS) SIEVE_EXT_DEFINE_OBJECTS(OPS)
 
73
 
 
74
/* 
 
75
 * Pre-loaded extensions 
 
76
 */
 
77
 
 
78
extern const struct sieve_extension *sieve_preloaded_extensions[];
 
79
extern const unsigned int sieve_preloaded_extensions_count;
 
80
 
 
81
/*  
 
82
 * Extensions init/deinit 
 
83
 */
 
84
 
 
85
bool sieve_extensions_init(void);
 
86
void sieve_extensions_deinit(void);
 
87
 
 
88
/* 
 
89
 * Extension registry 
 
90
 */
 
91
 
 
92
int sieve_extension_register(const struct sieve_extension *extension, bool load);
 
93
int sieve_extension_require(const struct sieve_extension *extension);
 
94
int sieve_extensions_get_count(void);
 
95
const struct sieve_extension *sieve_extension_get_by_id(unsigned int ext_id);
 
96
const struct sieve_extension *sieve_extension_get_by_name(const char *name);
 
97
 
 
98
const char *sieve_extensions_get_string(void);
 
99
void sieve_extensions_set_string(const char *ext_string);
 
100
 
 
101
/*
 
102
 * Capability registries
 
103
 */
 
104
 
 
105
struct sieve_extension_capabilities {
 
106
        const char *name;
 
107
 
 
108
        const struct sieve_extension *extension;
 
109
 
 
110
        const char *(*get_string)(void);        
 
111
};
 
112
 
 
113
void sieve_extension_capabilities_register
 
114
        (const struct sieve_extension_capabilities *cap);
 
115
const char *sieve_extension_capabilities_get_string
 
116
        (const char *cap_name);
 
117
 
 
118
#endif /* __SIEVE_EXTENSIONS_H */