]> git.proxmox.com Git - pve-manager.git/commitdiff
d/postinst: replace pvemailforward with proxmox-mail-forward
authorFiona Ebner <f.ebner@proxmox.com>
Fri, 21 Oct 2022 13:02:50 +0000 (15:02 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 10 Nov 2022 10:56:45 +0000 (11:56 +0100)
proxmox-mail-forward is a new helper binary in Rust intended to behave
essentially the same on PVE installations. It can also handle mixed
PBS+PVE installations.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
debian/postinst

index 7980ef98b5e23651eff83c7bbec61c24efd345d6..d8ee170db7b04cf0336e4e7ddeb954fee2795304 100755 (executable)
@@ -126,8 +126,14 @@ case "$1" in
         pveam update || true
     fi
 
-    if ! test -f /root/.forward || ! grep -q '|/usr/bin/pvemailforward' /root/.forward; then
-        echo '|/usr/bin/pvemailforward' >>/root/.forward
+    # Always try to clean old entry, even when proxmox-mail-forward entry is already present.
+    # This ensures it will still be cleaned after an upgrade following a downgrade.
+    if test -f /root/.forward; then
+        sed -i '\!|/usr/bin/pvemailforward!d' /root/.forward
+    fi
+
+    if ! test -f /root/.forward || ! grep -q '|/usr/bin/proxmox-mail-forward' /root/.forward; then
+        echo '|/usr/bin/proxmox-mail-forward' >>/root/.forward
     fi
 
     systemctl --system daemon-reload >/dev/null || true