]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
* Whitelist settings now affects on metric's action
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 3 May 2011 14:46:33 +0000 (18:46 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 3 May 2011 14:46:33 +0000 (18:46 +0400)
src/settings.c

index 65dea078ed9109e4c5f377ce2022d1ef6614e899..af4c37b8075dfcd6c5b051600fc2348b3aa31d59 100644 (file)
@@ -456,7 +456,13 @@ check_metric_action_settings (struct worker_task *task, struct metric *metric, d
 
        if (check_setting (task, &us, &ds)) {
                if (us != NULL) {
+                       /* Check whitelist and set appropriate action for whitelisted users */
+                       if (check_whitelist(task, us)) {
+                               *result = METRIC_ACTION_NOACTION;
+                               return TRUE;
+                       }
                        if ((cur = g_hash_table_lookup (us->metric_actions, metric->name)) != NULL) {
+
                                while (cur) {
                                        act = cur->data;
                                        if (score >= act->score) {
@@ -467,6 +473,11 @@ check_metric_action_settings (struct worker_task *task, struct metric *metric, d
                        }
                }
                else if (ds != NULL) {
+                       /* Check whitelist and set appropriate action for whitelisted users */
+                       if (check_whitelist(task, ds)) {
+                               *result = METRIC_ACTION_NOACTION;
+                               return TRUE;
+                       }
                        if ((cur = g_hash_table_lookup (ds->metric_actions, metric->name)) != NULL) {
                                while (cur) {
                                        act = cur->data;