aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2017-09-08 10:09:26 +0200
committerAndrew Lewis <nerf@judo.za.org>2017-09-08 10:09:26 +0200
commit583a135fce425105337a3b9728e3b1b48587ea0f (patch)
treea32937168dd6602b3de67720adb53c820487800a /src/libserver
parent52c0789dad8a6693eb3bd85acf15e1917b1d8e31 (diff)
downloadrspamd-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.h2
-rw-r--r--src/libserver/protocol.c6
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;