#include "array.h"
#include "hostpid.h"
#include "network.h"
+#include "module-dir.h"
#include "home-expand.h"
#include "str.h"
#include "strescape.h"
return ret;
}
+bool mail_user_is_plugin_loaded(struct mail_user *user, struct module *module)
+{
+ const char *const *plugins;
+ bool ret;
+
+ T_BEGIN {
+ plugins = t_strsplit_spaces(user->set->mail_plugins, ", ");
+ ret = str_array_find(plugins, module_get_plugin_name(module));
+ } T_END;
+ return ret;
+}
+
const char *mail_user_plugin_getenv(struct mail_user *user, const char *name)
{
return mail_user_set_plugin_getenv(user->set, name);
#include "mail-storage-settings.h"
+struct module;
struct mail_user;
struct mail_user_vfuncs {
/* Returns path + file prefix for creating a temporary file. Uses home
directory if possible, fallbacks to mail directory. */
const char *mail_user_get_temp_prefix(struct mail_user *user);
+
+/* Returns TRUE if plugin is loaded for the user. */
+bool mail_user_is_plugin_loaded(struct mail_user *user, struct module *module);
/* If name exists in plugin_envs, return its value. */
const char *mail_user_plugin_getenv(struct mail_user *user, const char *name);
const char *mail_user_set_plugin_getenv(const struct mail_user_settings *set,