Files
setup-email-pve-pbs/setup-email-pbs.sh

41 lines
1.1 KiB
Bash

#!/bin/bash
echo "=== Proxmox Backup Server Benachrichtigungssystem konfigurieren ==="
read -p "SMTP Server: " SMTP_SERVER
read -p "SMTP Port [587]: " SMTP_PORT
SMTP_PORT=${SMTP_PORT:-587}
read -p "SMTP Benutzer: " SMTP_USER
read -s -p "SMTP Passwort: " SMTP_PASS
echo
read -p "Absender-Adresse: " MAIL_FROM
read -p "Empfänger-Adresse: " MAIL_TO
# Sender anlegen
proxmox-notify sender update smtp-default \
--type smtp \
--mailfrom "$MAIL_FROM" \
--smarthost "$SMTP_SERVER:$SMTP_PORT" \
--authuser "$SMTP_USER" \
--password "$SMTP_PASS" \
--mailname "$(hostname -f)"
# Ziel anlegen
proxmox-notify target update mail-admin \
--type sendmail \
--mailto "$MAIL_TO"
# Policy zuweisen (optional)
proxmox-notify policy update default \
--targets mail-admin \
--sender smtp-default
# Test
echo
echo "==> Sende Testmail..."
proxmox-notify test --target mail-admin --subject "Testmail von PBS $(hostname)" --body "Dies ist eine Testbenachrichtigung vom neuen PBS-System."
echo "==> Konfiguration abgeschlossen. Sichtbar in der PBS Web-GUI unter: Verwaltung → Benachrichtigungen"