Skip to content

Commit

Permalink
stats plugin: stats_notify_path can now specify path to the stats-mai…
Browse files Browse the repository at this point in the history
…l FIFO
  • Loading branch information
sirainen authored and GitLab committed Apr 18, 2016
1 parent ba081c6 commit 84ba16c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/plugins/stats/stats-plugin.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 84ba16c

Please sign in to comment.