[pmg-devel] [PATCH pmg-api] fix #2276: restore line format for pmg-log-tracker

Dominik Csapak d.csapak at proxmox.com
Fri Jul 12 15:49:05 CEST 2019


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 <d.csapak at proxmox.com>
---
 PMG/RuleDB/Accept.pm     | 2 +-
 PMG/RuleDB/Quarantine.pm | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

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');
-- 
2.20.1




More information about the pmg-devel mailing list