- adjust for dovecot 2.2
[packages/dovecot-antispam.git] / dovecot-2.2.patch
1 diff -ur dovecot-antispam-2.0/antispam-plugin.h dovecot-antispam-2.0-2.2/antispam-plugin.h
2 --- dovecot-antispam-2.0/antispam-plugin.h      2013-07-16 08:49:17.445971507 +0200
3 +++ dovecot-antispam-2.0-2.2/antispam-plugin.h  2013-07-16 08:47:54.968547139 +0200
4 @@ -287,6 +287,25 @@
5  {
6         return dict_init(uri, DICT_DATA_TYPE_STRING, username, NULL);
7  }
8 +#elif DOVECOT_IS_EQ(2, 2)
9 +#define mempool_unref          pool_unref
10 +#define module_arg             struct module *
11 +#define ME(err)                        MAIL_ERROR_ ##err,
12 +
13 +static inline const char *const *
14 +get_mail_headers(struct mail *mail, const char *hdr)
15 +{
16 +       const char *const *ret;
17 +       if (mail_get_headers(mail, hdr, &ret))
18 +               return NULL;
19 +       return ret;
20 +}
21 +
22 +static inline struct ostream *
23 +o_stream_create_from_fd(int fd, pool_t pool ATTR_UNUSED)
24 +{
25 +       return o_stream_create_fd(fd, 0, TRUE);
26 +}
27  #else
28  #error "Building against this dovecot version is not supported"
29  #endif
30 diff -ur dovecot-antispam-2.0/dovecot-version.c dovecot-antispam-2.0-2.2/dovecot-version.c
31 --- dovecot-antispam-2.0/dovecot-version.c      2013-07-16 08:49:17.445971507 +0200
32 +++ dovecot-antispam-2.0-2.2/dovecot-version.c  2013-07-16 08:48:53.755753877 +0200
33 @@ -55,7 +55,7 @@
34                 "DOVECOT_VCODE <= DOVECOT_VERSION_CODE(maj, min, 0)\n");
35  
36         /* Use the antispam-storage-2.0.c for dovecot 2.1 as well */
37 -       if (maj == 2 && min == 1)
38 +       if (maj == 2 && (min == 1 || min == 2))
39                 min = 0;
40  
41         printf("#define ANTISPAM_STORAGE                        "
This page took 0.061038 seconds and 3 git commands to generate.