From 68dc2ae77915b24a2fc258484735a1df65651464 Mon Sep 17 00:00:00 2001 From: Andreas Knuth Date: Sat, 15 Mar 2025 10:57:15 +0100 Subject: [PATCH] fixes --- dovecot/config/dovecot.conf | 3 ++- dovecot/config/passwd | 2 +- dovecot/setup-permissions.sh | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 dovecot/setup-permissions.sh diff --git a/dovecot/config/dovecot.conf b/dovecot/config/dovecot.conf index 7d39e89..f1f55af 100644 --- a/dovecot/config/dovecot.conf +++ b/dovecot/config/dovecot.conf @@ -10,7 +10,8 @@ info_log_path = /var/log/dovecot-info.log debug_log_path = /var/log/dovecot-debug.log # Mail-Location -mail_location = maildir:/var/mail/%u +# Für Benutzer mit @ in der E-Mail-Adresse +mail_location = maildir:/var/mail/%d/%n # Authentifizierung auth_mechanisms = plain login diff --git a/dovecot/config/passwd b/dovecot/config/passwd index 5712158..3bac958 100644 --- a/dovecot/config/passwd +++ b/dovecot/config/passwd @@ -2,4 +2,4 @@ # Für Plaintext-Passwörter user1:{PLAIN}geheim:1000:1000::/var/mail/user1:/bin/false bizmatch.net:{PLAIN}passwort123:1001:1000::/var/mail/bizmatch.net:/bin/false -info@bizmatch.net:{PLAIN}passwort123:1001:1000::/var/mail/info@bizmatch.net:/bin/false \ No newline at end of file +info\@bizmatch.net:{PLAIN}passwort123:1001:1000::/var/mail/bizmatch.net/info:/bin/false \ No newline at end of file diff --git a/dovecot/setup-permissions.sh b/dovecot/setup-permissions.sh new file mode 100644 index 0000000..a564f35 --- /dev/null +++ b/dovecot/setup-permissions.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Dieses Skript richtet die Verzeichnisstruktur und Berechtigungen für Dovecot ein + +# Erstellen der Verzeichnisstruktur +mkdir -p /var/mail/domains/bizmatch.net/info +mkdir -p /var/mail/user1 +mkdir -p /var/mail/user2 + +# Festlegen der richtigen Besitzer und Berechtigungen +chown -R 1001:1000 /var/mail/domains/bizmatch.net/info +chown -R 1000:1000 /var/mail/user1 +chown -R 1001:1000 /var/mail/user2 + +# Setzen der Berechtigungen (wichtig für den dovecot Zugriff) +chmod -R 0770 /var/mail + +# Ausgabe zur Bestätigung +echo "Verzeichnisse und Berechtigungen wurden korrekt eingerichtet." +echo "Verzeichnisstruktur:" +ls -la /var/mail +ls -la /var/mail/domains/bizmatch.net \ No newline at end of file