~ubuntu-branches/ubuntu/trusty/dovecot/trusty-updates

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-01-08 09:35:49 UTC
  • mfrom: (1.15.3) (96.1.1 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20140108093549-814nkqdcxfbvgktg
Tags: 1:2.2.9-1ubuntu1
* Merge from Debian unstable, remaining changes:
  + Add mail-stack-delivery package:
    - Update d/rules
    - d/control: convert existing dovecot-postfix package to a dummy
      package and add new mail-stack-delivery package.
    - Update maintainer scripts.
    - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
    - d/mail-stack-delivery.preinst: Move previously installed backups and
      config files to a new package namespace.
    - d/mail-stack-delivery.prerm: Added to handle downgrades.
  + Use Snakeoil SSL certificates by default:
    - d/control: Depend on ssl-cert.
    - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - d/dovecot-core.ufw.profile: new ufw profile.
    - d/rules: install profile in dovecot-core.
    - d/control: dovecot-core - suggest ufw.
  + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
  + Add apport hook:
    - d/rules, d/source_dovecot.py
  + Add upstart job:
    - d/rules, d/dovecot-core.dovecot.upstart, d/control,
      d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
      d/dovecot-pop3d.{postinst, postrm, prerm}.
      d/mail-stack-deliver.postinst: Convert init script to upstart.
  + Use the autotools-dev dh addon to update config.guess/config.sub for
    arm64.
* Dropped changes, included in Debian:
  - Update Dovecot name to reflect distribution in login greeting.
  - Update Drac plugin for >= 2.0.0 support.
* d/control: Drop dovecot-postfix package as its no longer required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2002-2012 Pigeonhole authors, see the included COPYING file
 
1
/* Copyright (c) 2002-2013 Pigeonhole authors, see the included COPYING file
2
2
 */
3
3
 
4
4
/* Extensions spamtest, spamtestplus and virustest
7
7
 * Authors: Stephan Bosch
8
8
 * Specification: RFC 5235
9
9
 * Implementation: full
10
 
 * Status: experimental
 
10
 * Status: testing
11
11
 *
12
12
 */
13
13
 
18
18
 * sieve_spamtest_status_header = \
19
19
 *   X-Spam-Score: [[:alnum:]]+, score=(-?[[:digit:]]+\.[[:digit:]])
20
20
 * sieve_spamtest_max_value = 5.0
21
 
 * 
 
21
 *
22
22
 * # 2: X-Spam-Status: Yes
23
23
 *
24
24
 * sieve_spamtest_status_header = X-Spam-Status
33
33
 * # 4: X-Spam-Score: status=3.2 required=5.0
34
34
 *
35
35
 * sieve_spamtest_status_header = \
36
 
 *   X-Spam-Score: score=(-?[[:digit:]]+\.[[:digit:]]).* 
 
36
 *   X-Spam-Score: score=(-?[[:digit:]]+\.[[:digit:]]).*
37
37
 * sieve_spamtest_max_header = \
38
 
 *   X-Spam-Score: score=-?[[:digit:]]+\.[[:digit:]] required=([[:digit:]]+\.[[:digit:]]) 
 
38
 *   X-Spam-Score: score=-?[[:digit:]]+\.[[:digit:]] required=([[:digit:]]+\.[[:digit:]])
39
39
 *
40
40
 * # 5: X-Virus-Scan: Found to be clean.
41
41
 *
45
45
 * sieve_virustest_text_value1 = clean
46
46
 * sieve_virustest_text_value5 = infected
47
47
 */
48
 
 
 
48
 
49
49
#include "lib.h"
50
50
#include "array.h"
51
51
 
58
58
 
59
59
#include "ext-spamvirustest-common.h"
60
60
 
61
 
/* 
62
 
 * Extensions 
 
61
/*
 
62
 * Extensions
63
63
 */
64
64
 
65
65
/* Spamtest */
67
67
static bool ext_spamvirustest_validator_load
68
68
(const struct sieve_extension *ext, struct sieve_validator *validator);
69
69
 
70
 
const struct sieve_extension_def spamtest_extension = { 
71
 
        "spamtest", 
72
 
        ext_spamvirustest_load, 
73
 
        ext_spamvirustest_unload,
74
 
        ext_spamvirustest_validator_load, 
75
 
        NULL, NULL, NULL, NULL, NULL,
76
 
        SIEVE_EXT_DEFINE_OPERATION(spamtest_operation), 
77
 
        SIEVE_EXT_DEFINE_NO_OPERANDS
78
 
};
79
 
 
80
 
const struct sieve_extension_def spamtestplus_extension = { 
81
 
        "spamtestplus", 
82
 
        ext_spamvirustest_load,  
83
 
        ext_spamvirustest_unload,
84
 
        ext_spamvirustest_validator_load, 
85
 
        NULL, NULL, NULL, NULL, NULL,
86
 
        SIEVE_EXT_DEFINE_OPERATION(spamtest_operation), 
87
 
        SIEVE_EXT_DEFINE_NO_OPERANDS
88
 
};
89
 
 
90
 
const struct sieve_extension_def virustest_extension = { 
91
 
        "virustest", 
92
 
        ext_spamvirustest_load, 
93
 
        ext_spamvirustest_unload,
94
 
        ext_spamvirustest_validator_load, 
95
 
        NULL, NULL, NULL, NULL, NULL,
96
 
        SIEVE_EXT_DEFINE_OPERATION(virustest_operation), 
97
 
        SIEVE_EXT_DEFINE_NO_OPERANDS
 
70
const struct sieve_extension_def spamtest_extension = {
 
71
        .name = "spamtest",
 
72
        .load = ext_spamvirustest_load,
 
73
        .unload = ext_spamvirustest_unload,
 
74
        .validator_load = ext_spamvirustest_validator_load,
 
75
        SIEVE_EXT_DEFINE_OPERATION(spamtest_operation)
 
76
};
 
77
 
 
78
const struct sieve_extension_def spamtestplus_extension = {
 
79
        .name = "spamtestplus",
 
80
        .load = ext_spamvirustest_load,
 
81
        .unload = ext_spamvirustest_unload,
 
82
        .validator_load = ext_spamvirustest_validator_load,
 
83
        SIEVE_EXT_DEFINE_OPERATION(spamtest_operation)
 
84
};
 
85
 
 
86
const struct sieve_extension_def virustest_extension = {
 
87
        .name = "virustest",
 
88
        .load = ext_spamvirustest_load,
 
89
        .unload = ext_spamvirustest_unload,
 
90
        .validator_load = ext_spamvirustest_validator_load,
 
91
        SIEVE_EXT_DEFINE_OPERATION(virustest_operation)
98
92
};
99
93
 
100
94
/*
102
96
 */
103
97
 
104
98
static bool ext_spamtest_validator_extension_validate
105
 
        (const struct sieve_extension *ext, struct sieve_validator *valdtr, 
 
99
        (const struct sieve_extension *ext, struct sieve_validator *valdtr,
106
100
                void *context, struct sieve_ast_argument *require_arg);
107
101
 
108
102
const struct sieve_validator_extension spamtest_validator_extension = {
132
126
}
133
127
 
134
128
static bool ext_spamtest_validator_extension_validate
135
 
(const struct sieve_extension *ext, struct sieve_validator *valdtr, 
 
129
(const struct sieve_extension *ext, struct sieve_validator *valdtr,
136
130
        void *context ATTR_UNUSED, struct sieve_ast_argument *require_arg)
137
131
{
138
132
        const struct sieve_extension *ext_spamtestplus =