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

« back to all changes in this revision

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

  • 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
/* Extension notify
 
5
 * ----------------
 
6
 *
 
7
 * Authors: Stephan Bosch
 
8
 * Specification: draft-ietf-sieve-notify-00.txt
 
9
 * Implementation: deprecated; provided for backwards compatibility
 
10
 * Status: deprecated
 
11
 * 
 
12
 */
 
13
 
 
14
/* FIXME: Currently the following CMUSieve features are not supported:
 
15
 * 
 
16
 * (*) The $text$ substitution is not available for the :message argument.
 
17
 */
 
18
        
 
19
#include <stdio.h>
 
20
 
 
21
#include "sieve-common.h"
 
22
 
 
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"
 
31
 
 
32
#include "ext-notify-common.h"
 
33
 
 
34
/*
 
35
 * Operations
 
36
 */
 
37
 
 
38
const struct sieve_operation *ext_notify_operations[] = {
 
39
        &notify_old_operation,
 
40
        &denotify_operation
 
41
};
 
42
 
 
43
/* 
 
44
 * Extension
 
45
 */
 
46
 
 
47
static bool ext_notify_validator_load(struct sieve_validator *valdtr);
 
48
 
 
49
static int ext_notify_my_id = -1;
 
50
 
 
51
const struct sieve_extension notify_extension = { 
 
52
        "notify", 
 
53
        &ext_notify_my_id,
 
54
        NULL,
 
55
        NULL,
 
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,
 
60
};
 
61
 
 
62
/*
 
63
 * Extension validation
 
64
 */
 
65
 
 
66
static bool ext_notify_validator_extension_validate
 
67
        (struct sieve_validator *valdtr, void *context, 
 
68
                struct sieve_ast_argument *require_arg);
 
69
 
 
70
const struct sieve_validator_extension notify_validator_extension = {
 
71
        &notify_extension,
 
72
        ext_notify_validator_extension_validate,
 
73
        NULL
 
74
};
 
75
 
 
76
static bool ext_notify_validator_load(struct sieve_validator *valdtr)
 
77
{
 
78
        /* Register validator extension to check for conflict with enotify */
 
79
        sieve_validator_extension_register
 
80
                (valdtr, &notify_validator_extension, NULL);
 
81
 
 
82
        /* Register new commands */
 
83
        sieve_validator_register_command(valdtr, &cmd_notify_old);
 
84
        sieve_validator_register_command(valdtr, &cmd_denotify);
 
85
        
 
86
        return TRUE;
 
87
}
 
88
 
 
89
static bool ext_notify_validator_extension_validate
 
90
(struct sieve_validator *valdtr, void *context ATTR_UNUSED,
 
91
    struct sieve_ast_argument *require_arg)
 
92
{
 
93
        const struct sieve_extension *ext;
 
94
 
 
95
        if ( (ext=sieve_extension_get_by_name("enotify")) != NULL ) {
 
96
 
 
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");
 
102
                        return FALSE;
 
103
                }
 
104
        }
 
105
 
 
106
        return TRUE;
 
107
}
 
108
 
 
109