allow custom milter-reject regex

This commit is contained in:
biji 2021-09-01 12:17:11 +07:00
parent c216f5a73d
commit 7009e559b1
2 changed files with 3 additions and 1 deletions

View file

@ -309,3 +309,5 @@ NO_HOST_DOMAIN 0
# this directive to force sendmailanalyzer to take them as sent.
NO_QUEUE_EXCLUSION 0
# Custom milter-reject regex detected as spam
#MILTER_REJECT_REGEX Mailbox not found

View file

@ -1606,7 +1606,7 @@ sub parse_sendmail
$status =~ s/ \(.*//;
#push(@{$TO{$host}{$id}{status}}, &clear_status($status));
}
} elsif ($status =~ /Spam message rejected/) {
} elsif ($status =~ /Spam message rejected/ || ($CONFIG{MILTER_REJECT_REGEX} && $status =~ /$CONFIG{MILTER_REJECT_REGEX}/)) {
$SPAM{$host}{$id}{relay} = $relay;
$SPAM{$host}{$id}{rule} = 'reject';
$SPAM{$host}{$id}{spam} = $status;