Browse Source

[Rspamd] Fix tag handling for mailboxes

andryyy 4 years ago
parent
commit
9034e0f3a8
2 changed files with 3 additions and 2 deletions
  1. 2 1
      data/conf/rspamd/dynmaps/aliasexp.php
  2. 1 1
      data/conf/rspamd/lua/rspamd.local.lua

+ 2 - 1
data/conf/rspamd/dynmaps/aliasexp.php

@@ -167,7 +167,8 @@ catch (PDOException $e) {
   exit;
   exit;
 }
 }
 
 
-if (count($rcpt_final_mailboxes) == 1 && $rcpt_final_mailboxes[0] != $rcpt) {
+// Does also return the mailbox name if question == answer (query == mailbox)
+if (count($rcpt_final_mailboxes) == 1) {
   error_log("ALIASEXP: direct alias " . $rcpt . " expanded to " . $rcpt_final_mailboxes[0] . PHP_EOL);
   error_log("ALIASEXP: direct alias " . $rcpt . " expanded to " . $rcpt_final_mailboxes[0] . PHP_EOL);
   echo trim($rcpt_final_mailboxes[0]);
   echo trim($rcpt_final_mailboxes[0]);
 }
 }

+ 1 - 1
data/conf/rspamd/lua/rspamd.local.lua

@@ -234,7 +234,7 @@ rspamd_config:register_symbol({
 
 
       local function http_callback(err_message, code, body, headers)
       local function http_callback(err_message, code, body, headers)
         if body ~= nil and body ~= "" then
         if body ~= nil and body ~= "" then
-          rspamd_logger.infox(rspamd_config, "expanding alias to \"%s\"", body)
+          rspamd_logger.infox(rspamd_config, "expanding rcpt to \"%s\"", body)
 
 
           local function tag_callback_subject(err, data)
           local function tag_callback_subject(err, data)
             if err or type(data) ~= 'string' then
             if err or type(data) ~= 'string' then