content:serverbasics:docker-dovecot
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige Überarbeitung | ||
| content:serverbasics:docker-dovecot [2025/08/02 18:30] – obel1x | content:serverbasics:docker-dovecot [2025/08/22 12:38] (aktuell) – obel1x | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| ====== Docker: Dovecot ====== | ====== Docker: Dovecot ====== | ||
| - | Dovecot ( [[https:// | + | Dovecot ( [[https:// |
| - | (is currently working | + | ===== Prerequisites ===== |
| + | |||
| + | You will need all stuff to have [[: | ||
| + | |||
| + | ===== Docker composer ===== | ||
| + | |||
| + | Dovecot does not use any Database, as Mails will be stored in MailDir- Format, which is using Directories and Files for each Mail, so mounting the mail- Directory is enough. | ||
| + | |||
| + | In your docker_compose- Directory, create the '' | ||
| + | < | ||
| + | |||
| + | services: | ||
| + | # Small but performant and secure Imap- Server: https:// | ||
| + | dovecot: | ||
| + | image: dovecot/ | ||
| + | #For testing: | ||
| + | # image: dovecot/ | ||
| + | restart: always | ||
| + | read_only: true | ||
| + | stop_grace_period: | ||
| + | volumes: | ||
| + | - dovecot_config:/ | ||
| + | - dovecot_maildata:/ | ||
| + | tmpfs: | ||
| + | - /tmp | ||
| + | - / | ||
| + | - /srv/mail | ||
| + | environment: | ||
| + | # Those passwords shuld not be used/only for testing | ||
| + | # They will allow any username with that password to connect | ||
| + | USER_PASSWORD: | ||
| + | DOVEADM_PASSWORD: | ||
| + | ports: | ||
| + | - " | ||
| + | #Listeners from Homepage | ||
| + | # POP3 on 31110, TLS 31995 (needs config file to enable, disabled by default) | ||
| + | # IMAP on 31143, TLS 31993 | ||
| + | # Submission on 31587 | ||
| + | # LMTPS on 31024 | ||
| + | # ManageSieve on 34190 | ||
| + | # HTTP API on 8080 | ||
| + | # Metrics on 9090 | ||
| + | networks: | ||
| + | - default | ||
| + | |||
| + | volumes: | ||
| + | dovecot_config: | ||
| + | dovecot_maildata: | ||
| + | |||
| + | networks: | ||
| + | # Still needs to be defined while without it won't enable ipv6 | ||
| + | default: | ||
| + | driver: bridge | ||
| + | enable_ipv6: | ||
| + | |||
| + | </ | ||
| + | |||
| + | Basically, '' | ||
| + | ===== LDAP Password-Checks ===== | ||
| + | |||
| + | In your Volume dovecot_config you will now find the directory conf.d - put some file in here like domainname.conf to have it loaded in your dovecot- config. It will overwrite all basic settings. | ||
| + | |||
| + | < | ||
| + | ssl = required | ||
| + | auth_allow_cleartext = no | ||
| + | |||
| + | #external connection: check SSL validity. Won't validate let's encrypt LDAP- Certs without importing CA | ||
| + | ssl_client_require_valid_cert = no | ||
| + | |||
| + | ssl_server { | ||
| + | cert_file = / | ||
| + | key_file = / | ||
| + | } | ||
| + | |||
| + | #LDAP Auth | ||
| + | # Password lookup: will also do full user/pass bind to check, so this should be enough | ||
| + | # https:// | ||
| + | |||
| + | #For debugging and also provides useful informations about logins | ||
| + | log_debug = category=auth | ||
| + | |||
| + | passdb ldap { | ||
| + | # will speed up check of user when using multiple queries to ldap-server like userdb- checking too | ||
| + | # will slow down if only one check is done per login | ||
| + | # use_worker = yes | ||
| + | driver = ldap | ||
| + | ldap_uris = ldaps:// | ||
| + | bind = yes | ||
| + | bind_userdn = uid=%{user}, | ||
| + | filter = (& | ||
| + | ldap_base = dc=domain, | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | Change Domain, tld and your docker-hostname to match your needs. | ||
| + | |||
| + | ===== SSL Setup ===== | ||
| + | |||
| + | Also, you need your ACME- Certificates of Caddy copied to that Volume. I do it with the file '' | ||
| + | < | ||
| + | # | ||
| + | #Renew ACME Certs of Dovecot from Caddy | ||
| + | cat / | ||
| + | cat / | ||
| + | |||
| + | </ | ||
| + | |||
| + | which i call every Day with dockers crontab. | ||
| + | |||
| + | Make sure that the files are accessible for dovecot (and if possible to noone else, not in container nor on your host). | ||
| ===== Possible problems ===== | ===== Possible problems ===== | ||
content/serverbasics/docker-dovecot.1754152257.txt.gz · Zuletzt geändert: von obel1x
