====== Dovecot unter Debian 6.0 ====== [[http://www.dovecot.org/|Dovecot]] unter Debian 6.0 als IMAP-Server einrichten: ===== Installation ===== * Dovecot installieren: # apt-get install dovecot-imapd ===== Dienste ===== * Normales IMAP nur auf localhost anbieten, IMAP-over-SSL auf einer bestimmten IPv4-Adresse: # vi /etc/dovecot/dovecot.conf [...] protocol imap { listen = 127.0.0.1 ssl_listen = 81.169.132.218 ===== Mailbox-Format ===== * Mailbox-Format auf Maildir umstellen: # vi /etc/dovecot/dovecot.conf [...] mail_location = maildir:%h/Maildir ===== SSL ===== * Verzeichnis für Zertifikat und privaten Schlüssel einrichten: # mkdir /etc/dovecot/ssl # chmod 700 /etc/dovecot/ssl # chown root:root /etc/dovecot/ssl * Zertifikat und privaten Schlüssel kopieren und absichern: # cp mail.disorganized.de.cert mail.disorganized.de.key /etc/dovecot/ssl # chmod 444 /etc/dovecot/ssl/mail.disorganized.de.cert # chown root:root ssl/mail.disorganized.de.cert # chmod 400 /etc/dovecot/ssl/mail.disorganized.de.key # chown root:root /etc/dovecot/ssl/mail.disorganized.de.key * SSL konfigurieren: # vi /etc/dovecot/dovecot.conf [...] ssl_cert_file = /etc/dovecot/ssl/mail.disorganized.de.cert ssl_key_file = /etc/dovecot/ssl/mail.disorganized.de.key * Testen: $ openssl s_client -showcerts -connect mail.disorganized.de:993 -crlf ===== Authentifizierung ===== Die Authentifizierung der Benutzer erfolgt gegen die [[server::Exim]]-Kennwort-Datei. Zusätzlich wird ''/etc/passwd'' benutzt, um weitere Informationen zu einem Benutzer zu erhalten (UID, GID und Home-Verzeichnis). * Klartext-Authentifizierung verbieten (eigentlich unnötig, weil ich ja nach außen nur IMAP-over-SSL anbiete): # vi /etc/dovecot/dovecot.conf [...] disable_plaintext_auth = yes * Im Abschnitt ''auth default'' alle aktiven ''passdb''-Einträge auskommentieren und folgenden Eintrag hinzufügen (der ''userdb''-Eintrag ist schon richtig konfiguriert): # vi /etc/dovecot/dovecot.conf [...] auth default { [...] # passwd-like file with specified location # passdb passwd-file { # Path for passwd-file args = /etc/exim4/passwd } * Den Benutzer des Authentifizierungs-Daemons von ''root'' auf ''Debian-exim'' ändern. # vi /etc/dovecot/dovecot.conf [...] auth default { [...] #user = root user = Debian-exim * Testen: $ telnet localhost 143 [...] . LOGIN ewald geheim . OK Logged in. . LOGOUT [...] ===== Problembehebungen ===== * Debian jessie: systemd so konfigurieren, dass IMAP-Port nicht überwacht werden. Dovecot kann sich sonst nicht auf die Ports binden: # cp /lib/systemd/system/dovecot.socket /etc/systemd/system/ # systemctl reenable dovecot.socket # vi /etc/systemd/system/dovecot.socket Alle Zeilen mit ListenStream auskommentieren # systemctl stop dovecot.service # systemctl start dovecot.service # systemctl status dovecot.socket ● dovecot.socket - Dovecot IMAP/POP3 email server activation socket Loaded: error (Reason: Invalid argument) Active: active (running) since Fri 2015-12-04 16:11:48 CET; 25min ago