From b632562c08e8f180bef62ffc47bdb93af145158b Mon Sep 17 00:00:00 2001 From: Fiona Ebner Date: Fri, 21 Oct 2022 15:02:50 +0200 Subject: [PATCH] d/postinst: replace pvemailforward with proxmox-mail-forward 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 --- debian/postinst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/postinst b/debian/postinst index 7980ef98..d8ee170d 100755 --- a/debian/postinst +++ b/debian/postinst @@ -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