[pmg-devel] [PATCH pmg-api v2 1/2] fix #2232: set rulename for default accept

Stoiko Ivanov s.ivanov at proxmox.com
Thu Jun 6 11:26:37 CEST 2019


Logging the rulename along with the action taken introduced in
365d5b9549d25a910c82cd37034f05e1c906565a, introduced a regression, for the
default action (accept), since the accept-rule is instantiated directly it
did not set a name, resulting in an 'Use of uninitialized value' being written
to the mail.log for every mail not triggering any explicit rule.

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 bin/pmg-smtp-filter | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/pmg-smtp-filter b/bin/pmg-smtp-filter
index 31fddd5..d198239 100755
--- a/bin/pmg-smtp-filter
+++ b/bin/pmg-smtp-filter
@@ -353,7 +353,7 @@ sub apply_rules {
     if ($unmatched) {
 	my $accept = PMG::RuleDB::Accept->new ();
 	$accept->execute ($queue, $self->{ruledb}, $mod_group, $unmatched,
-			  $msginfo, undef, undef, undef);
+			  $msginfo, { RULE => 'default-accept' }, undef);
     }
 
     return $matching_rules;
-- 
2.11.0




More information about the pmg-devel mailing list