diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2009-07-20 02:46:07 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2009-07-20 02:46:07 +0200 |
commit | aad2cd42ee3d71920648b649e759403b0cb0e138 (patch) | |
tree | c63e0e5a68e55b084b423bf78493a9c6d91ff858 | |
parent | e23fb3e749d1529dc312f770ae383363fdb367cd (diff) | |
parent | af0f8f8de27901e2efb9560a1fc66c7af3cd810b (diff) | |
download | dovecot-antispam-aad2cd42ee3d71920648b649e759403b0cb0e138.tar.gz dovecot-antispam-aad2cd42ee3d71920648b649e759403b0cb0e138.tar.xz dovecot-antispam-aad2cd42ee3d71920648b649e759403b0cb0e138.zip |
Merge commit 'base/master'
-rw-r--r-- | antispam-plugin.h | 13 |
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 |