added backup and email client

This commit is contained in:
2026-02-01 00:02:35 +01:00
parent ff857be01a
commit e4fdfbc95f
210 changed files with 24211 additions and 742 deletions
+68
View File
@@ -81,6 +81,72 @@ EOF'
docker exec $CONTAINER bash -c 'systemctl restart fail2ban 2>/dev/null || service fail2ban restart 2>/dev/null || true'
echo " -> Bantime auf 60 Sekunden gesetzt"
echo ""
echo "Aktiviere SMTP auf Port 587 (Submission/STARTTLS)..."
# Konfiguriere Dovecot Auth-Socket für Postfix-Zugriff
docker exec $CONTAINER bash -c '
# 1. Postfix-Benutzer zur Dovecot-Gruppe hinzufügen für Socket-Zugriff
usermod -aG dovecot postfix 2>/dev/null || true
echo "Postfix zur Dovecot-Gruppe hinzugefügt"
# 2. Dovecot-Konfiguration für Postfix SASL erweitern
# Prüfen ob auth-client bereits für Postfix konfiguriert ist
if ! grep -q "unix_listener auth-client" /etc/dovecot/conf.d/*auth*.conf 2>/dev/null; then
# Neue Auth-Socket Konfiguration für Postfix hinzufügen
cat >> /etc/dovecot/conf.d/10-master.conf << DOVECONF
# Auth-Socket für Postfix SASL (OpenCRM Setup)
service auth {
unix_listener auth-client {
mode = 0660
user = postfix
group = postfix
}
}
DOVECONF
echo "Dovecot Auth-Socket für Postfix konfiguriert"
# Dovecot neu laden
doveadm reload 2>/dev/null || systemctl reload dovecot 2>/dev/null || true
fi
# 3. Entferne alte submission-Konfiguration falls vorhanden
if grep -q "^submission" /etc/postfix/master.cf; then
echo "Entferne alte submission-Konfiguration..."
awk "/^submission/{skip=1; next} /^[^ \t]/ && skip{skip=0} !skip" /etc/postfix/master.cf > /tmp/master.cf.new
mv /tmp/master.cf.new /etc/postfix/master.cf
fi
# 4. Neue Submission-Konfiguration hinzufügen
cat >> /etc/postfix/master.cf << EOF
# Submission Port 587 für STARTTLS (OpenCRM Setup)
submission inet n - n - - smtpd
-o syslog_name=postfix/submission
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
-o smtpd_sasl_type=dovecot
-o smtpd_sasl_path=/run/dovecot/auth-client
-o smtpd_sasl_security_options=noanonymous
-o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
-o smtpd_relay_restrictions=permit_sasl_authenticated,reject
EOF
echo "Port 587 mit Dovecot SASL konfiguriert"
# 5. Dovecot neustarten damit Socket-Berechtigungen wirksam werden
systemctl restart dovecot 2>/dev/null || service dovecot restart 2>/dev/null || true
sleep 1
# 6. Socket-Berechtigungen als Fallback direkt setzen
chmod 666 /run/dovecot/auth-client 2>/dev/null || true
echo "Auth-Socket Berechtigungen gesetzt"
# 7. Postfix komplett neustarten (nicht nur reload)
postfix stop 2>/dev/null || true
postfix start
echo "Postfix neugestartet"
'
echo " -> SMTP Submission Port 587 konfiguriert"
echo ""
echo "Setze Admin-Passwort..."
docker exec $CONTAINER plesk bin admin --set-admin-password -passwd "$ADMIN_PASSWORD" 2>&1
@@ -124,6 +190,8 @@ echo " -> Policy auf 'None' setzen"
echo "4. Websites & Domains > Add Domain"
echo "5. Domain: stressfrei-wechseln.de"
echo "6. Mail-Service aktivieren"
echo "7. Optional: Tools & Settings > Mail Server Settings"
echo " -> 'Enable SMTP service on port 587' aktivieren (bereits per Script konfiguriert)"
echo ""
echo "============================================"
echo "OpenCRM Einstellungen"