Linuxhotel Wiki

Wie ging das nochmal?

Benutzer-Werkzeuge

Webseiten-Werkzeuge


lpi2:dovecot-virtual-domains

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen gezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
lpi2:dovecot-virtual-domains [2014/02/26 23:59]
ingo_wichmann
lpi2:dovecot-virtual-domains [2024/08/10 10:22] (aktuell)
ingo_wichmann [Testen]
Zeile 1: Zeile 1:
 ====== Dovecot: virtuelle Domains und Benutzer in Textdateien ====== ====== Dovecot: virtuelle Domains und Benutzer in Textdateien ======
-//in der Praxis würde ich LDAP oder eine Datenbank bevorzugen//+ 
 +Dokumentation:​ https://doc.dovecot.org/configuration_manual/​virtual_users/
  
 Voraussetzung:​ [[dovecot-imapd]] Voraussetzung:​ [[dovecot-imapd]]
  
-''​/etc/dovecot/dovecot.conf'' ​+Benutzer vmail und Mailverzeichnis anlegen: 
 +  mkdir -p /srv/vmail/example.com 
 +  useradd -r -U -s /bin/false -d /srv/vmail vmail 
 +  chown vmail:vmail /​srv/​vmail/​example.com
  
-<​file>​ +Dovecot konfigurieren:​ 
-mail_location = maildir:/​srv/​vmail/​%d/​home/​%n/Maildir+ 
 +<​file ​txt /​etc/​dovecot/​local.conf
 +mail_location = maildir:~/Maildir 
 +auth_username_format = %Lu
 userdb { userdb {
-  args = username_format=%n ​/srv/vmail/%d/passwd +  args = /​srv/​vmail/​passwd 
-  default_fields = uid=vmail gid=vmail home=/​srv/​vmail/​%d/home/%n+  default_fields = uid=vmail gid=vmail home=/​srv/​vmail/​%d/​%n
   driver = passwd-file   driver = passwd-file
 } }
 passdb { passdb {
-  args = username_format=%n ​/srv/vmail/%d/passwd+  args = /​srv/​vmail/​passwd
   driver = passwd-file   driver = passwd-file
 } }
 </​file>​ </​file>​
 +  doveconf auth_username_format
 +-> ''​auth_username_format = **%Lu**''​
 +  doveconf -n | grep -EA4 '​^(userdb|passdb)'​
 +  systemctl reload dovecot.service
  
-Benutzer ​vmail anlegen: +Benutzer anlegen: ​((https://doc.dovecot.org/configuration_manual/authentication/password_schemes/#​authentication-password-schemes))
-  mkdir -p /srv/vmail/​example.com/home +
-  useradd -r -U -s /bin/false -d /srv/vmail vmail +
-  chown -R vmail:vmail /​srv/​vmail/​example.com +
- +
-Beispiel-Benutzer anlegen:+
   doveadm pw -l   doveadm pw -l
-  doveadm pw -s SSHA256+  doveadm pw -s BLF-CRYPT | tee -a /​srv/​vmail/​passwd
  
-''​/​srv/​vmail/​example.com/​passwd'' ​+<file txt /srv/vmail/passwd>​ 
-<​file>​ +user1@example.com:​{BLF-CRYPT}$2y$05$XF8X/y47o1sfXTiwX5JkzOn0uGvZw9QCtHOKRinCsMc.rtAElVHOG:​
-user1:​{SSHA256}NZMbbjQl2IsI8Qurnfgl2XjTxD/​8eNf4IYD+AdiikArZ+WZI+user2@example.com:​{SSHA256}NZMbbjQl2IsI8Qurnfgl2XjTxD/​8eNf4IYD+AdiikArZ+WZI::
 </​file>​ </​file>​
  
 ====== Testen ====== ====== Testen ======
-  netcat ​-v localhost 143+Kennt dovecot die Benutzer? 
 +  doveadm user '​*'​ 
 +  doveadm user user1@example.com 
 +-> ''​home ​   /​srv/​vmail/​example.com/​user1''​ 
 + 
 +Funktioniert die Authentifizierung?​ 
 +  doveadm auth test user1@example.com 
 +-> ''​auth succeeded''​ 
 + 
 +Mit curl: 
 +  curl -v --url imap://localhost:143 --user me@klaus-1.lxht.de 
 +-> ''​OK Logged in''​ 
 + 
 +Mit curl + TLS: 
 +  curl -v --ssl-reqd --url imaps://​example.com:​993 --user user1@example.com 
 + 
 +Kann man sich lokal anmelden (mit TLS): 
 +  openssl s_client -crlf -connect localhost:​993
   . login user1@example.com xxx   . login user1@example.com xxx
 +
  
lpi2/dovecot-virtual-domains.1393459148.txt.gz · Zuletzt geändert: 2014/02/26 23:59 von ingo_wichmann