From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 74A341FF16F for ; Thu, 30 Jan 2025 12:22:28 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3D40FF643; Thu, 30 Jan 2025 12:22:26 +0100 (CET) From: Stoiko Ivanov To: pmg-devel@lists.proxmox.com Date: Thu, 30 Jan 2025 12:21:39 +0100 Message-Id: <20250130112140.42219-2-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250130112140.42219-1-s.ivanov@proxmox.com> References: <20250130112140.42219-1-s.ivanov@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.068 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pmg-devel] [PATCH pmg-api 1/2] quarantine: add receiver to delivery/delete log-messages X-BeenThere: pmg-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pmg-devel-bounces@lists.proxmox.com Sender: "pmg-devel" 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 --- 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