diff options
author | Andrew Lewis <nerf@judo.za.org> | 2017-09-08 10:09:26 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2017-09-08 10:09:26 +0200 |
commit | 583a135fce425105337a3b9728e3b1b48587ea0f (patch) | |
tree | a32937168dd6602b3de67720adb53c820487800a /src/libserver | |
parent | 52c0789dad8a6693eb3bd85acf15e1917b1d8e31 (diff) | |
download | rspamd-583a135fce425105337a3b9728e3b1b48587ea0f.tar.gz rspamd-583a135fce425105337a3b9728e3b1b48587ea0f.zip |
[Fix] Rewriting subjects via force actions module
Diffstat (limited to 'src/libserver')
-rw-r--r-- | src/libserver/cfg_file.h | 2 | ||||
-rw-r--r-- | src/libserver/protocol.c | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/libserver/cfg_file.h b/src/libserver/cfg_file.h index d96c6e474..48f352f49 100644 --- a/src/libserver/cfg_file.h +++ b/src/libserver/cfg_file.h @@ -269,7 +269,7 @@ struct rspamd_metric { gdouble unknown_weight; /**< weight of unknown symbols */ gdouble grow_factor; /**< grow factor for metric */ GHashTable *symbols; /**< weights of symbols in metric */ - gchar *subject; /**< subject rewrite string */ + const gchar *subject; /**< subject rewrite string */ GHashTable * groups; /**< groups of symbols */ struct metric_action actions[METRIC_ACTION_MAX]; /**< all actions of the metric */ }; diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index b012aee08..69427e8b5 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -747,7 +747,11 @@ make_rewritten_subject (struct rspamd_metric *metric, struct rspamd_task *task) const gchar *s, *c, *p; gsize slen = 0; - c = metric->subject; + c = rspamd_mempool_get_variable (task->task_pool, "metric_subject"); + + if (c == NULL) { + c = metric->subject; + } if (c == NULL) { c = SPAM_SUBJECT; |