浏览代码

[Rspamd, Web] Add rewrite subject to known soft quarantine actions

andryyy 4 年之前
父节点
当前提交
5d9c40b8b4
共有 3 个文件被更改,包括 10 次插入4 次删除
  1. 1 1
      data/conf/rspamd/local.d/metadata_exporter.conf
  2. 4 2
      data/web/js/site/qhandler.js
  3. 5 1
      data/web/js/site/quarantine.js

+ 1 - 1
data/conf/rspamd/local.d/metadata_exporter.conf

@@ -53,7 +53,7 @@ return function(task)
     and not task:has_symbol('GLOBAL_RCPT_BL')
     and not task:has_symbol('MAILCOW_BLACK') then
       local action = task:get_metric_action('default')
-      if action == 'reject' or action == 'add header' then
+      if action == 'reject' or action == 'add header' or action == 'rewrite subject' then
         return true
       end
   end

+ 4 - 2
data/web/js/site/qhandler.js

@@ -47,8 +47,10 @@ jQuery(function($){
       if (typeof data.score !== 'undefined' && typeof data.action !== 'undefined') {
         if (data.action === "add header") {
           $('#qid_detail_score').append('<span class="label-rspamd-action label label-warning"><b>' + data.score + '</b> - ' + lang.junk_folder + '</span>');
-        } else {
+        } else if (data.action === "reject") {
           $('#qid_detail_score').append('<span class="label-rspamd-action label label-danger"><b>' + data.score + '</b> - ' + lang.rejected + '</span>');
+        } else if (data.action === "rewrite subject") {
+          $('#qid_detail_score').append('<span class="label-rspamd-action label label-warning"><b>' + data.score + '</b> - ' + lang.rewrite_subject + '</span>');
         }
       }
       if (typeof data.recipients !== 'undefined') {
@@ -66,4 +68,4 @@ jQuery(function($){
       }
     }
   });
-});
+});

+ 5 - 1
data/web/js/site/quarantine.js

@@ -86,6 +86,8 @@ jQuery(function($){
               item.rspamdaction = '<span class="label label-danger">' + lang.rejected + '</span>';
             } else if (item.action === "add header") {
               item.rspamdaction = '<span class="label label-warning">' + lang.junk_folder + '</span>';
+            } else if (item.action === "rewrite subject") {
+              item.rspamdaction = '<span class="label label-warning">' + lang.rewrite_subject + '</span>';
             }
             if(item.notified > 0) {
               item.notified = '&#10004;';
@@ -182,8 +184,10 @@ jQuery(function($){
         if (typeof data.score !== 'undefined' && typeof data.action !== 'undefined') {
           if (data.action == "add header") {
             $('#qid_detail_score').append('<span class="label-rspamd-action label label-warning"><b>' + data.score + '</b> - ' + lang.junk_folder + '</span>');
-          } else {
+          } else if (data.action == "reject") {
             $('#qid_detail_score').append('<span class="label-rspamd-action label label-danger"><b>' + data.score + '</b> - ' + lang.rejected + '</span>');
+          } else if (data.action == "rewrite subject") {
+            $('#qid_detail_score').append('<span class="label-rspamd-action label label-warning"><b>' + data.score + '</b> - ' + lang.rewrite_subject + '</span>');
           }
         }
         if (typeof data.recipients !== 'undefined') {