From: Timo Sirainen Date: Fri, 15 Apr 2016 11:51:42 +0000 (+0300) Subject: stats plugin: stats_notify_path can now specify path to the stats-mail FIFO X-Git-Tag: 2.3.0.rc1~4017 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84ba16ca61846ea305653dc11f36e08aa77b2a11;p=thirdparty%2Fdovecot%2Fcore.git stats plugin: stats_notify_path can now specify path to the stats-mail FIFO --- diff --git a/src/plugins/stats/stats-plugin.c b/src/plugins/stats/stats-plugin.c index fa65bb8c34..283817b0bd 100644 --- a/src/plugins/stats/stats-plugin.c +++ b/src/plugins/stats/stats-plugin.c @@ -18,7 +18,7 @@ Must be smaller than MAIL_SESSION_IDLE_TIMEOUT_MSECS in stats server */ #define SESSION_STATS_FORCE_REFRESH_SECS (5*60) #define REFRESH_CHECK_INTERVAL 100 -#define MAIL_STATS_SOCKET_NAME "stats-mail" +#define MAIL_STATS_FIFO_NAME "stats-mail" struct stats_storage { union mail_storage_module_context module_ctx; @@ -379,8 +379,11 @@ static void stats_user_created(struct mail_user *user) } if (global_stats_conn == NULL) { - path = t_strconcat(user->set->base_dir, - "/"MAIL_STATS_SOCKET_NAME, NULL); + path = mail_user_plugin_getenv(user, "stats_notify_path"); + if (path == NULL) + path = MAIL_STATS_FIFO_NAME; + if (path[0] != '/') + path = t_strconcat(user->set->base_dir, "/", path, NULL); global_stats_conn = stats_connection_create(path); } stats_connection_ref(global_stats_conn);