diff --git a/data/conf/rspamd/dynmaps/footer.php b/data/conf/rspamd/dynmaps/footer.php index ca18697a..6e44f519 100644 --- a/data/conf/rspamd/dynmaps/footer.php +++ b/data/conf/rspamd/dynmaps/footer.php @@ -43,6 +43,8 @@ $headers = getallheaders(); $domain = $headers['Domain']; // Get Username $username = $headers['Username']; +// Get From +$from = $headers['From']; // define empty footer $empty_footer = json_encode(array( 'html' => '', @@ -50,7 +52,7 @@ $empty_footer = json_encode(array( 'vars' => array() )); -error_log("FOOTER: checking for domain " . $domain . " and user " . $username . PHP_EOL); +error_log("FOOTER: checking for domain " . $domain . ", user " . $username . " and address " . $from . PHP_EOL); try { $stmt = $pdo->prepare("SELECT `plain`, `html`, `mbox_exclude` FROM `domain_wide_footer` @@ -59,7 +61,7 @@ try { ':domain' => $domain )); $footer = $stmt->fetch(PDO::FETCH_ASSOC); - if (in_array($username, json_decode($footer['mbox_exclude']))){ + if (in_array($from, json_decode($footer['mbox_exclude']))){ $footer = false; } if (empty($footer)){ diff --git a/data/conf/rspamd/lua/rspamd.local.lua b/data/conf/rspamd/lua/rspamd.local.lua index 44be2e34..24fa4f8c 100644 --- a/data/conf/rspamd/lua/rspamd.local.lua +++ b/data/conf/rspamd/lua/rspamd.local.lua @@ -538,7 +538,8 @@ rspamd_config:register_symbol({ return false end local uname = uname:lower() - local env_from_domain = envfrom[1].domain:lower() -- get smtp from domain in lower case + local env_from_domain = envfrom[1].domain:lower() + local env_from_addr = envfrom[1].addr:lower() -- determine newline type local function newline(task) @@ -669,7 +670,7 @@ rspamd_config:register_symbol({ url='http://nginx:8081/footer.php', body='', callback=footer_cb, - headers={Domain=env_from_domain,Username=uname}, + headers={Domain=env_from_domain,Username=uname,From=env_from_addr}, }) return true