From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id AAAE66AB74 for ; Fri, 5 Mar 2021 22:43:23 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A883F29BD3 for ; Fri, 5 Mar 2021 22:43:23 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 2D49329BC6 for ; Fri, 5 Mar 2021 22:43:20 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id EAF89462B9 for ; Fri, 5 Mar 2021 22:43:19 +0100 (CET) Message-ID: Date: Fri, 5 Mar 2021 22:43:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:87.0) Gecko/20100101 Thunderbird/87.0 Content-Language: en-US To: Stoiko Ivanov , pmg-devel@lists.proxmox.com References: <20210301141225.18394-1-s.ivanov@proxmox.com> <20210301141225.18394-3-s.ivanov@proxmox.com> From: Thomas Lamprecht In-Reply-To: <20210301141225.18394-3-s.ivanov@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.424 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [backup.pm, pbsconfig.pm, job.pm, backup-notification.tt] URIBL_SBL 0.644 Contains an URL's NS IP listed in the Spamhaus SBL blocklist [backup.pm] URIBL_SBL_A 0.1 Contains URL's A record listed in the Spamhaus SBL blocklist [backup.pm] Subject: [pmg-devel] applied: [PATCH pmg-api v2 2/3] backup: fix #3146 add email notifications 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: , X-List-Received-Date: Fri, 05 Mar 2021 21:43:23 -0000 On 01.03.21 15:12, Stoiko Ivanov wrote: > this patch addresses the missing email notification for scheduled > backup related tasks, which we have in all our other products, for our > mail product. > > the parameter names are inspired by PBS' datastore config. > > the default is 'never' in order to stay consistent with the current > code. > > it uses the templateing system for the notification, because this > results in less code and a bit of added flexibility for the users. > > the recipient address is currently hardcoded to the admin address in > pmg.conf as we also send the (admin) pmgreport there, and I did not > want to overengineer this (even more). > > I shortly considered adding a $SIG{'__DIE__'} handler to the > run_backup API call but dropped the idea due to the warning in > perlvar(1). > > Signed-off-by: Stoiko Ivanov > --- > src/Makefile | 1 + > src/PMG/API2/PBS/Job.pm | 34 ++++++++++++++++++++------- > src/PMG/Backup.pm | 35 ++++++++++++++++++++++++++++ > src/PMG/PBSConfig.pm | 7 ++++++ > src/templates/backup-notification.tt | 19 +++++++++++++++ > 5 files changed, 88 insertions(+), 8 deletions(-) > create mode 100644 src/templates/backup-notification.tt > > applied, squashed in a fixup dropping the extra \n in $log->() calls we talked about off-list. thanks!