--- dovecot-antispam-2.0/antispam-plugin.h~ 2011-11-07 10:49:47.000000000 +0100 +++ dovecot-antispam-2.0/antispam-plugin.h 2012-05-09 11:50:32.432166565 +0200 @@ -285,6 +285,31 @@ { return dict_init(uri, DICT_DATA_TYPE_STRING, username, NULL); } +#elif DOVECOT_IS_EQ(2, 1) +#define mempool_unref pool_unref +#define module_arg struct module * +#define ME(err) MAIL_ERROR_ ##err, + +static inline const char *const * +get_mail_headers(struct mail *mail, const char *hdr) +{ + const char *const *ret; + if (mail_get_headers(mail, hdr, &ret)) + return NULL; + return ret; +} + +static inline struct ostream * +o_stream_create_from_fd(int fd, pool_t pool ATTR_UNUSED) +{ + return o_stream_create_fd(fd, 0, TRUE); +} + +static inline struct dict * +string_dict_init(const char *uri, const char *username) +{ + return dict_init(uri, DICT_DATA_TYPE_STRING, username, NULL); +} #else #error "Building against this dovecot version is not supported" #endif