Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
lpi2:postfix-dovecot-imapd [2016/12/08 19:52] ingo_wichmann [Postfix Maildir Konfiguration] |
lpi2:postfix-dovecot-imapd [2025/08/14 20:00] (aktuell) ingo_wichmann |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
====== postfix und dovecot-imapd verbinden ====== | ====== postfix und dovecot-imapd verbinden ====== | ||
- | Vorraussetzung: [[postfix]] | + | Vorraussetzung: |
+ | * [[dovecot]] ( Paket ''dovecot-imapd'' soll installiert sein ) | ||
+ | * [[postfix]] ( Paket ''postfix'' soll installiert sein ) | ||
- | ===== Einfach: Maildir ===== | + | ===== Speicherformat für Mails ===== |
- | ==== Dovecot Maildir Konfiguration ==== | + | Mails im Maildir-Format speichern: ((alternative Möglichkeiten: https://wiki.dovecot.org/MailboxFormat)) |
- | ''/etc/dovecot/conf.d/10-mail.conf'' ( Debian 8 ) | + | |
- | <file> | + | ==== bis Version Dovecot 2.3 ==== |
+ | |||
+ | <file txt /etc/dovecot/local.conf> | ||
+ | … | ||
mail_location = maildir:~/Maildir | mail_location = maildir:~/Maildir | ||
+ | … | ||
</file> | </file> | ||
- | service dovecot reload | ||
=== prüfen === | === prüfen === | ||
doveconf mail_location | doveconf mail_location | ||
+ | -> gibt aus: ''mail_location = maildir:~/Maildir'' | ||
- | ==== Postfix Maildir Konfiguration ==== | + | ==== ab Version Dovecot 2.4 ==== |
- | ''/etc/postfix/main.cf'' : ( Debian ab 5.0, openSuSE 12.1 ) | + | <file txt /etc/dovecot/local.conf> |
- | <file> | + | … |
- | home_mailbox = Maildir/ | + | mail_driver = maildir |
- | mailbox_command = | + | mail_path = %{home}/Maildir |
+ | mail_inbox_path = . | ||
+ | … | ||
</file> | </file> | ||
- | === Testen mit mutt === | + | === prüfen === |
- | <file txt ~/.muttrc> | + | doveconf mail_driver |
- | set mbox_type=Maildir | + | doveconf mail_path |
- | set folder="~/Maildir/" | + | doveconf mail_inbox_path |
- | set mbox="~/Maildir/" | + | |
- | set spoolfile="~/Maildir/" | + | |
- | </file> | + | |
- | ===== Performanter: LMTP ===== | + | ===== per LMTP von Postfix zu Dovecot ===== |
- | Pakete: | + | === Pakete === |
- | * Debian (7): ''dovecot-lmtpd'' | + | Debian: ''dovecot-lmtpd'' |
- | ==== Postfix ==== | + | |
- | postconf -e 'mailbox_transport = lmtp:unix:private/dovecot-lmtp' | + | |
- | ==== Dovecot 2.0 / 2.0 ==== | + | ==== dovecot Konfiguration ==== |
- | ( openSuSE 12.1 )\\ | + | ==== bis Version Dovecot 2.3 ==== |
- | auth_username_format ist essentiell, weil LMTP bei der Delivery nach diesem Verzeichnis sucht! | + | <file txt /etc/dovecot/local.conf> |
- | + | … | |
- | <file raw /etc/dovecot/conf.d/10-master.conf> | + | |
auth_username_format = %Ln | 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'' | ||
+ | |||
+ | ==== ab Version Dovecot 2.4 ==== | ||
+ | <file txt /etc/dovecot/local.conf> | ||
+ | … | ||
+ | #auth_username_format = %{user | username | lower } # already set similar in /etc/dovecot/conf.d/20-lmtp.conf, but for lmtp only? | ||
+ | … | ||
+ | </file> | ||
+ | |||
+ | ==== Dovecot 2.3 und 2.4 ==== | ||
+ | |||
+ | <file raw /etc/dovecot/local.conf> | ||
+ | … | ||
service lmtp { | service lmtp { | ||
unix_listener /var/spool/postfix/private/dovecot-lmtp { | unix_listener /var/spool/postfix/private/dovecot-lmtp { | ||
+ | user = postfix | ||
group = postfix | group = postfix | ||
mode = 0660 | mode = 0660 | ||
- | user = postfix | ||
} | } | ||
} | } | ||
+ | … | ||
</file> | </file> | ||
- | ( openSUSE Leap 42.1 )\\ | + | Konfiguration prüfen: |
- | Existiert noch kein ''~./Maildir'', schlägt die storage auto detection von dovecot fehl. | + | doveconf protocols |
- | <file raw /etc/dovecot/conf.d/10-mail.conf> | + | -> gibt u.a. aus: ''lmtp'' |
- | mail_location = maildir:~/Maildir | + | doveconf -n |
- | </file> | + | |
+ | 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'' | ||
====== Dokumentation ====== | ====== Dokumentation ====== | ||
* http://wiki2.dovecot.org/HowTo/PostfixDovecotLMTP | * http://wiki2.dovecot.org/HowTo/PostfixDovecotLMTP |