[Rspamd] Add symbol HAM_TRAP or SPAM_TRAP for trap aliases
parent
c586ddd5db
commit
d94b5e43ea
|
@ -394,13 +394,8 @@ while ($row = array_shift($rows)) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
?>
|
?>
|
||||||
traps {
|
ham_trap {
|
||||||
<?php
|
<?php
|
||||||
foreach (ucl_rcpts('spam@localhost', 'mailbox') as $rcpt) {
|
|
||||||
?>
|
|
||||||
rcpt = <?=json_encode($rcpt, JSON_UNESCAPED_SLASHES);?>;
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
foreach (ucl_rcpts('ham@localhost', 'mailbox') as $rcpt) {
|
foreach (ucl_rcpts('ham@localhost', 'mailbox') as $rcpt) {
|
||||||
?>
|
?>
|
||||||
rcpt = <?=json_encode($rcpt, JSON_UNESCAPED_SLASHES);?>;
|
rcpt = <?=json_encode($rcpt, JSON_UNESCAPED_SLASHES);?>;
|
||||||
|
@ -408,7 +403,29 @@ while ($row = array_shift($rows)) {
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
priority = 9;
|
priority = 9;
|
||||||
want_spam = yes;
|
apply "default" {
|
||||||
|
symbols_enabled = ["HISTORY_SAVE"];
|
||||||
|
}
|
||||||
|
symbols [
|
||||||
|
"HAM_TRAP"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
spam_trap {
|
||||||
|
<?php
|
||||||
|
foreach (ucl_rcpts('spam@localhost', 'mailbox') as $rcpt) {
|
||||||
|
?>
|
||||||
|
rcpt = <?=json_encode($rcpt, JSON_UNESCAPED_SLASHES);?>;
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
priority = 9;
|
||||||
|
apply "default" {
|
||||||
|
symbols_enabled = ["HISTORY_SAVE"];
|
||||||
|
}
|
||||||
|
symbols [
|
||||||
|
"SPAM_TRAP"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
<?php
|
<?php
|
||||||
// Start additional content
|
// Start additional content
|
||||||
|
|
|
@ -113,9 +113,9 @@ rspamd_config:register_symbol({
|
||||||
for _,fr in ipairs(from) do
|
for _,fr in ipairs(from) do
|
||||||
local fr_split = rspamd_str_split(fr['addr'], '@')
|
local fr_split = rspamd_str_split(fr['addr'], '@')
|
||||||
if #fr_split == 2 then
|
if #fr_split == 2 then
|
||||||
if fr_split[1] == 'postmaster' then
|
if fr_split[1] == 'postmaster' and task:get_user() then
|
||||||
-- no whitelist, keep signatures
|
-- no whitelist, keep signatures
|
||||||
task:insert_result(true, 'POSTMASTER_FROM', -2500.0, from_ip_string)
|
task:insert_result(true, 'POSTMASTER_FROM', -2500.0)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue