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 E42FB8ACF0; Fri, 21 Oct 2022 15:03:27 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C6766222D2; Fri, 21 Oct 2022 15:02:57 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (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; Fri, 21 Oct 2022 15:02:56 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 9ED4744AF9; Fri, 21 Oct 2022 15:02:56 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com, pbs-devel@lists.proxmox.com Date: Fri, 21 Oct 2022 15:02:47 +0200 Message-Id: <20221021130252.176316-5-f.ebner@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221021130252.176316-1-f.ebner@proxmox.com> References: <20221021130252.176316-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.028 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH proxmox-mail-forward 3/3] d/postinst: register binary in .forward X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2022 13:03:27 -0000 Similar to how it is done for pve-manager in PVE. If pvemailforward is detected, nothing is done. An adapted pve-manager will cleanly handle the switchover for PVE installations. Signed-off-by: Fiona Ebner --- debian/proxmox-mail-forward.postinst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 debian/proxmox-mail-forward.postinst diff --git a/debian/proxmox-mail-forward.postinst b/debian/proxmox-mail-forward.postinst new file mode 100755 index 0000000..1c81eea --- /dev/null +++ b/debian/proxmox-mail-forward.postinst @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +case "$1" in + configure) + # pve-manager is responsible for switching over, so skip when detecting pvemailforward + if ! test -f /root/.forward || ! grep -E -q '\|/usr/bin/(proxmox-mail-|pvemail)forward' /root/.forward; then + echo '|/usr/bin/proxmox-mail-forward' >>/root/.forward + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure|triggered) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +exit 0 -- 2.30.2