all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH pmg-api 1/2] quarantine: add receiver to delivery/delete log-messages
Date: Thu, 30 Jan 2025 12:21:39 +0100	[thread overview]
Message-ID: <20250130112140.42219-2-s.ivanov@proxmox.com> (raw)
In-Reply-To: <20250130112140.42219-1-s.ivanov@proxmox.com>

The question: "What happened to the quarantined e-mail" comes up every
now and then in our support-channels, and it always feels a bit clumsy
to explain how to get to the fitting logline, by referring to the
general timeframe when a user did the request and to look for the
queue-ids and quarantine-file-ids for identifying a particular mail.

Adding the receiver of the mail to the log lines should make this a
bit more straight-forward.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 src/PMG/Quarantine.pm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/PMG/Quarantine.pm b/src/PMG/Quarantine.pm
index d06a88d..28138ba 100644
--- a/src/PMG/Quarantine.pm
+++ b/src/PMG/Quarantine.pm
@@ -128,12 +128,12 @@ sub deliver_quarantined_mail {
     };
     my $err = $@;
     if ($err) {
-	my $msg = "deliver quarantined mail '$id' ($path) failed: $err";
+	my $msg = "deliver quarantined mail '$id' ($path) to $receiver failed: $err";
 	syslog('err', $msg);
 	die "$msg\n";
     }
 
-    syslog('info', "delivered quarantined mail '$id' ($path)");
+    syslog('info', "delivered quarantined mail '$id' ($path) to $receiver");
 
     return 1;
 }
@@ -141,6 +141,7 @@ sub deliver_quarantined_mail {
 sub delete_quarantined_mail {
     my ($dbh, $ref) = @_;
 
+    my $pmail = $ref->{pmail};
     my $filename = $ref->{file};
     my $spooldir = $PMG::MailQueue::spooldir;
     my $path = "$spooldir/$filename";
@@ -155,12 +156,12 @@ sub delete_quarantined_mail {
 	$sth->finish;
     };
     if (my $err = $@) {
-	my $msg = "delete quarantined mail '$id' ($path) failed: $err";
+	my $msg = "delete quarantined mail '$id' ($path) for $pmail failed: $err";
 	syslog ('err', $msg);
 	die "$msg\n";
     }
 
-    syslog ('info', "marked quarantined mail '$id' as deleted ($path)");
+    syslog ('info', "marked quarantined mail '$id' as deleted ($path) for $pmail");
 
     return 1;
 }
-- 
2.39.5



_______________________________________________
pmg-devel mailing list
pmg-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel


  reply	other threads:[~2025-01-30 11:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-30 11:21 [pmg-devel] [PATCH pmg-api 0/2] fix #6126 and improve logging for quarantine actions Stoiko Ivanov
2025-01-30 11:21 ` Stoiko Ivanov [this message]
2025-01-30 11:21 ` [pmg-devel] [PATCH pmg-api 2/2] fix #6126: do not deliver/delete quarantined mails multiple times Stoiko Ivanov
2025-02-18  9:37 ` [pmg-devel] [PATCH pmg-api 0/2] fix #6126 and improve logging for quarantine actions Christian Ebner
2025-02-21 16:59 ` [pmg-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250130112140.42219-2-s.ivanov@proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal