Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
— |
fortgeschrittene:postfix-dovecot-imapd-2-3 [2025/08/30 04:33] (aktuell) ingo_wichmann angelegt |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== postfix und dovecot-imapd bis Version 2.3 verbinden ====== | ||
+ | Vorraussetzung: | ||
+ | * [[dovecot]] ( Paket ''dovecot-imapd'' bis Version 2.3 soll installiert sein ) | ||
+ | * [[postfix]] ( Paket ''postfix'' soll installiert sein ) | ||
+ | |||
+ | ===== Speicherformat für Mails ===== | ||
+ | Mails im Maildir-Format speichern: ((alternative Möglichkeiten: https://doc.dovecot.org/2.3/admin_manual/mailbox_formats/maildir/)) | ||
+ | |||
+ | <file txt /etc/dovecot/local.conf> | ||
+ | … | ||
+ | mail_location = maildir:~/Maildir | ||
+ | … | ||
+ | </file> | ||
+ | |||
+ | === prüfen === | ||
+ | doveconf mail_location | ||
+ | -> gibt aus: ''mail_location = maildir:~/Maildir'' | ||
+ | |||
+ | ===== per LMTP von Postfix zu Dovecot ===== | ||
+ | === Pakete === | ||
+ | Debian: ''dovecot-lmtpd'' | ||
+ | |||
+ | ==== dovecot Konfiguration ==== | ||
+ | <file txt /etc/dovecot/local.conf> | ||
+ | … | ||
+ | auth_username_format = %Ln | ||
+ | … | ||
+ | </file>((''auth_username_format'' ist essentiell, weil [[wpde>LMTP]] bei der Zustellung nach diesem Verzeichnis sucht. | ||
+ | * ''L'' = lowercase, email-Adresse wird in Kleinbuchstaben umgewandelt | ||
+ | * ''n'' = nur Benutzername | ||
+ | * ''u'' = komplette email-Adresse (Benutzername@domain) | ||
+ | Ersetzung siehe https://doc.dovecot.org/configuration_manual/config_file/config_variables/ | ||
+ | )) | ||
+ | doveconf auth_username_format | ||
+ | -> gibt aus: ''auth_username_format = %Ln'' | ||
+ | |||
+ | <file raw /etc/dovecot/local.conf> | ||
+ | … | ||
+ | service lmtp { | ||
+ | unix_listener /var/spool/postfix/private/dovecot-lmtp { | ||
+ | user = postfix | ||
+ | group = postfix | ||
+ | mode = 0660 | ||
+ | } | ||
+ | } | ||
+ | … | ||
+ | </file> | ||
+ | |||
+ | Konfiguration prüfen: | ||
+ | doveconf protocols | ||
+ | -> gibt u.a. aus: ''lmtp'' | ||
+ | doveconf -n | ||
+ | |||
+ | Dienst neu starten: | ||
+ | systemctl restart dovecot.service | ||
+ | |||
+ | Prüfen, ob dovecot den Socket angelegt hat: | ||
+ | namei -l /var/spool/postfix/private/dovecot-lmtp | ||
+ | lsof /var/spool/postfix/private/dovecot-lmtp | ||
+ | |||
+ | ==== Postfix Konfiguration ==== | ||
+ | postconf -e 'mailbox_transport = lmtp:unix:private/dovecot-lmtp' | ||
+ | |||
+ | === Testen === | ||
+ | Auf dem Client: | ||
+ | swaks -f test@lxht.de -t testuser@klaus-1.lxht.de -s klaus-1.lxht.de | ||
+ | -> ''250 2.0.0 Ok: queued as B0EF53FA42'' | ||
+ | |||
+ | Auf dem Server: | ||
+ | journalctl -g B0EF53FA42 | ||
+ | -> ''postfix/lmtp[…]: B0EF53FA42: to=<testuser@klaus-1.lxht.de>, relay=klaus-1.lxht.de[private/dovecot-lmtp],…, status=sent'' | ||