[Rspamd] Pushover: Fixes

master
andryyy 2020-04-16 22:29:01 +02:00
parent 47a15c21aa
commit 35d3586950
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
1 changed files with 14 additions and 5 deletions

View File

@ -202,12 +202,21 @@ foreach ($rcpt_final_mailboxes as $rcpt_final) {
$senders = explode(',', $api_data['senders']);
$senders = array_filter($senders);
$senders_regex = $api_data['senders_regex'];
$sender_validated = true;
if (!empty($senders_regex) && !preg_match($senders_regex, $sender)) {
$sender_validated = false;
$sender_validated = false;
if (empty($senders) && empty($senders_regex)) {
$sender_validated = true;
}
if (!empty($senders) && !in_array($sender, $senders)) {
$sender_validated = false;
else {
if (!empty($senders)) {
if (in_array($sender, $senders)) {
$sender_validated = true;
}
}
if (!empty($senders_regex) && $sender_validated !== true) {
if (preg_match($senders_regex, $sender)) {
$sender_validated = true;
}
}
}
if ($sender_validated === false) {
error_log("NOTIFY: pushover pipe: skipping unwanted sender " . $sender);