[pmg-devel] [PATCH pmg-api] dkim: add QID in warnings
Mira Limbeck
m.limbeck at proxmox.com
Thu Feb 29 14:47:53 CET 2024
adding the QID in warnings allows those log lines to be picked up by the
pmg-log-tracker. this way the warnings show up in the tracking center.
Signed-off-by: Mira Limbeck <m.limbeck at proxmox.com>
---
src/PMG/RuleDB/Accept.pm | 8 ++++++--
src/PMG/RuleDB/BCC.pm | 8 ++++++--
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/PMG/RuleDB/Accept.pm b/src/PMG/RuleDB/Accept.pm
index d14c2fb..e3e39a7 100644
--- a/src/PMG/RuleDB/Accept.pm
+++ b/src/PMG/RuleDB/Accept.pm
@@ -104,8 +104,12 @@ sub execute {
eval {
$entity = PMG::DKIMSign::sign_entity($entity, $dkim, $msginfo->{sender});
};
- syslog('warning',
- "Could not create DKIM-Signature - disabling Signing: $@") if $@;
+ if ($@) {
+ syslog('warning',
+ "%s: Could not create DKIM-Signature - disabling Signing: $@",
+ $queue->{logid}
+ );
+ }
}
diff --git a/src/PMG/RuleDB/BCC.pm b/src/PMG/RuleDB/BCC.pm
index 65b6fb5..81301cf 100644
--- a/src/PMG/RuleDB/BCC.pm
+++ b/src/PMG/RuleDB/BCC.pm
@@ -144,8 +144,12 @@ sub execute {
eval {
$entity = PMG::DKIMSign::sign_entity($entity, $dkim, $msginfo->{sender});
};
- syslog('warning',
- "Could not create DKIM-Signature - disabling Signing: $@") if $@;
+ if ($@) {
+ syslog('warning',
+ "%s: Could not create DKIM-Signature - disabling Signing: $@",
+ $queue->{logid}
+ );
+ }
}
if ($msginfo->{testmode}) {
--
2.39.2
More information about the pmg-devel
mailing list