Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
lpi2:dovecot-virtual-domains [2024/08/07 05:47] 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 ====== | ||
+ | |||
+ | Dokumentation: https://doc.dovecot.org/configuration_manual/virtual_users/ | ||
Voraussetzung: [[dovecot-imapd]] | Voraussetzung: [[dovecot-imapd]] | ||
Zeile 11: | Zeile 13: | ||
<file txt /etc/dovecot/local.conf> | <file txt /etc/dovecot/local.conf> | ||
- | mail_location = maildir:/srv/vmail/%d/%n/Maildir | + | mail_location = maildir:~/Maildir |
auth_username_format = %Lu | auth_username_format = %Lu | ||
userdb { | userdb { | ||
- | args = username_format=%u /srv/vmail/passwd | + | args = /srv/vmail/passwd |
default_fields = uid=vmail gid=vmail home=/srv/vmail/%d/%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/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 | ||
- | Beispiel-Benutzer anlegen: ((https://doc.dovecot.org/configuration_manual/authentication/password_schemes/#authentication-password-schemes)) | + | Benutzer anlegen: ((https://doc.dovecot.org/configuration_manual/authentication/password_schemes/#authentication-password-schemes)) |
doveadm pw -l | doveadm pw -l | ||
- | doveadm pw -s BLF-CRYPT | + | doveadm pw -s BLF-CRYPT | tee -a /srv/vmail/passwd |
<file txt /srv/vmail/passwd> | <file txt /srv/vmail/passwd> | ||
- | user1@example.com:{BLF-CRYPT}$2y$05$XF8X/y47o1sfXTiwX5JkzOn0uGvZw9QCtHOKRinCsMc.rtAElVHOG | + | user1@example.com:{BLF-CRYPT}$2y$05$XF8X/y47o1sfXTiwX5JkzOn0uGvZw9QCtHOKRinCsMc.rtAElVHOG:: |
- | user2@example.com:{SSHA256}NZMbbjQl2IsI8Qurnfgl2XjTxD/8eNf4IYD+AdiikArZ+WZI | + | user2@example.com:{SSHA256}NZMbbjQl2IsI8Qurnfgl2XjTxD/8eNf4IYD+AdiikArZ+WZI:: |
</file> | </file> | ||
Zeile 37: | Zeile 43: | ||
doveadm user '*' | doveadm user '*' | ||
doveadm user user1@example.com | doveadm user user1@example.com | ||
+ | -> ''home /srv/vmail/example.com/user1'' | ||
Funktioniert die Authentifizierung? | Funktioniert die Authentifizierung? | ||
doveadm auth test user1@example.com | 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): | Kann man sich lokal anmelden (mit TLS): | ||
Zeile 45: | Zeile 60: | ||
. login user1@example.com xxx | . login user1@example.com xxx | ||
- | Mit curl: | + | |
- | curl -v --ssl-reqd --url imaps://example.com:993 --user user1@example.com | + |