From: Dominik Csapak Date: Fri, 12 Jul 2019 13:49:05 +0000 (+0200) Subject: fix #2276: restore line format for pmg-log-tracker X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=bb1b6f1efcb5cd9f903b7292610f45069f76f92b;p=pmg-api.git fix #2276: restore line format for pmg-log-tracker pmg-log-tracker requires a specific format of the output of the smtp-filter to correctly detect and recognize emails and message ids commit 365d5b9549d25a910c82cd37034f05e1c906565a changed the format of some lines (by including the rule name) so that pmg-log-tacker did not correctly parse it anymore this patch changes the format in a way that the log-tracker can parse and still display the new information Signed-off-by: Dominik Csapak --- diff --git a/PMG/RuleDB/Accept.pm b/PMG/RuleDB/Accept.pm index 79fb0d8..8e76d8f 100644 --- a/PMG/RuleDB/Accept.pm +++ b/PMG/RuleDB/Accept.pm @@ -113,7 +113,7 @@ sub execute { $msginfo->{xforward}, $msginfo->{fqdn}); if ($qid) { foreach (@$tg) { - syslog('info', "%s: accept mail to <%s> (rule: %s, %s)", $queue->{logid}, encode('UTF-8', $_), $rulename, $qid); + syslog('info', "%s: accept mail to <%s> (%s) (rule: %s)", $queue->{logid}, encode('UTF-8', $_), $qid, $rulename); } $queue->set_status ($tg, 'delivered', $qid); } else { diff --git a/PMG/RuleDB/Quarantine.pm b/PMG/RuleDB/Quarantine.pm index aaa8623..1426393 100644 --- a/PMG/RuleDB/Quarantine.pm +++ b/PMG/RuleDB/Quarantine.pm @@ -100,7 +100,7 @@ sub execute { if (my $qid = $queue->quarantine_mail($ruledb, 'V', $entity, $tg, $msginfo, $vars, $ldap)) { foreach (@$tg) { - syslog ('info', "$queue->{logid}: moved mail for <%s> to virus quarantine (rule: %s, %s)", $_, $rulename, $qid); + syslog ('info', "$queue->{logid}: moved mail for <%s> to virus quarantine - %s (rule: %s)", $_, $qid, $rulename); } $queue->set_status ($tg, 'delivered'); @@ -110,7 +110,7 @@ sub execute { if (my $qid = $queue->quarantine_mail($ruledb, 'S', $entity, $tg, $msginfo, $vars, $ldap)) { foreach (@$tg) { - syslog ('info', "$queue->{logid}: moved mail for <%s> to spam quarantine (rule: %s, %s)", $_, $rulename, $qid); + syslog ('info', "$queue->{logid}: moved mail for <%s> to spam quarantine - %s (rule: %s)", $_, $qid, $rulename); } $queue->set_status($tg, 'delivered');