aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-07-02 14:17:54 +0200
committerJohannes Berg <johannes@sipsolutions.net>2009-07-02 14:17:54 +0200
commitaf0f8f8de27901e2efb9560a1fc66c7af3cd810b (patch)
tree01fee070541b02f4e24a87b5ce405f37e7fb42e3
parent8f7c08bc8a39c22b3cca1e306cf454d64b405b8c (diff)
downloaddovecot-antispam-af0f8f8de27901e2efb9560a1fc66c7af3cd810b.tar.gz
dovecot-antispam-af0f8f8de27901e2efb9560a1fc66c7af3cd810b.tar.xz
dovecot-antispam-af0f8f8de27901e2efb9560a1fc66c7af3cd810b.zip
make it compile with dovecot 1.2
-rw-r--r--antispam-plugin.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/antispam-plugin.h b/antispam-plugin.h
index df59e88..493fd1e 100644
--- a/antispam-plugin.h
+++ b/antispam-plugin.h
@@ -113,11 +113,24 @@ o_stream_create_from_fd(int fd, pool_t pool ATTR_UNUSED)
return o_stream_create_fd(fd, 0, TRUE);
}
+#if DOVECOT_VERSION_CODE(1, 2) == DOVECOT_VERSION
+static inline struct dict *
+string_dict_init(const char *uri, const char *username)
+{
+ const char *base_dir;
+
+ base_dir = getenv("BASE_DIR");
+ if (base_dir == NULL)
+ base_dir = "/var/run/dovecot";
+ return dict_init(uri, DICT_DATA_TYPE_STRING, username, base_dir);
+}
+#else /* 1.1 */
static inline struct dict *
string_dict_init(const char *uri, const char *username)
{
return dict_init(uri, DICT_DATA_TYPE_STRING, username);
}
+#endif
#elif DOVECOT_VERSION_CODE(1, 0) == DOVECOT_VERSION
#define ME(err)
#define PLUGIN_ID