Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Nächste Überarbeitung | Vorherige Überarbeitung Letzte Überarbeitung Beide Seiten, nächste Überarbeitung | ||
lpi2:dovecot-virtual-domains [2014/02/26 23:12] ingo_wichmann angelegt |
lpi2:dovecot-virtual-domains [2022/12/25 08:32] ingo_wichmann gelöscht |
||
---|---|---|---|
Zeile 4: | Zeile 4: | ||
Voraussetzung: [[dovecot-imapd]] | Voraussetzung: [[dovecot-imapd]] | ||
- | ''/etc/dovecot/dovecot.conf'' : | + | Benutzer vmail und Mailverzeichnis anlegen: |
+ | 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 | ||
+ | |||
+ | Dovecot konfigurieren: | ||
+ | |||
+ | ''/etc/dovecot/local.conf'' : | ||
<file> | <file> | ||
- | mail_location = maildir:/srv/vmail/%d/maildir/%n | + | mail_location = maildir:/srv/vmail/%d/home/%n/Maildir |
+ | auth_username_format = %Lu | ||
userdb { | userdb { | ||
args = username_format=%n /srv/vmail/%d/passwd | args = username_format=%n /srv/vmail/%d/passwd | ||
+ | default_fields = uid=vmail gid=vmail home=/srv/vmail/%d/home/%n | ||
driver = passwd-file | driver = passwd-file | ||
} | } | ||
Zeile 18: | Zeile 27: | ||
</file> | </file> | ||
- | mkdir -p /srv/vmail/example.com/{passwd,maildir} | + | Beispiel-Benutzer anlegen: ((https://doc.dovecot.org/configuration_manual/authentication/password_schemes/#authentication-password-schemes)) |
+ | doveadm pw -l | ||
+ | doveadm pw -s BLF-CRYPT | ||
+ | |||
+ | ''/srv/vmail/example.com/passwd'' : | ||
+ | <file> | ||
+ | user1:{BLF-CRYPT}$2y$05$XF8X/y47o1sfXTiwX5JkzOn0uGvZw9QCtHOKRinCsMc.rtAElVHOG | ||
+ | user2:{SSHA256}NZMbbjQl2IsI8Qurnfgl2XjTxD/8eNf4IYD+AdiikArZ+WZI | ||
+ | </file> | ||
+ | |||
+ | ====== Testen ====== | ||
+ | Kennt dovecot die Benutzer? | ||
+ | doveadm user '*' | ||
+ | doveadm user user1@example.com | ||
+ | |||
+ | Funktioniert die Authentifizierung? | ||
+ | doveadm auth test user1@example.com | ||
+ | |||
+ | Kann man sich lokal anmelden (ohne TLS geht das per default nicht): | ||
+ | netcat -v localhost 143 | ||
+ | . login user1@example.com xxx | ||