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>
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